Esempio n. 1
0
        protected virtual void OnDropStructureSets(Type[] types)
        {
            using (var dbClient = ProviderFactory.GetTransactionalDbClient(_connectionInfo))
            {
                foreach (var type in types)
                {
                    CacheProvider.ClearByType(type);

                    var structureSchema = StructureSchemas.GetSchema(type);
                    DbSchemas.Drop(structureSchema, dbClient);
                    StructureSchemas.RemoveSchema(type);
                }
            }
        }
Esempio n. 2
0
        protected virtual void OnUpsertStructureSets(Type[] types)
        {
            if (!Settings.AllowsAnyDynamicSchemaChanges())
            {
                return;
            }

            using (var dbClient = ProviderFactory.GetTransactionalDbClient(_connectionInfo))
            {
                foreach (var type in types)
                {
                    CacheProvider.ClearByType(type);

                    var structureSchema = StructureSchemas.GetSchema(type);
                    DbSchemas.Upsert(structureSchema, dbClient);
                }
            }
        }