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); } } }
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); } } }