public ISequence Hilo(Type documentType, HiloSettings settings) { // TODO -- here, need to see if the mt_hilo table is created, and if not, // do it through _creation. if (!_schema.SchemaTableNames().Contains("mt_hilo")) { _creation.RunScript("mt_hilo"); } return(new HiloSequence(_factory, documentType.Name, settings)); }
public void CompletelyRemoveAll() { using (var connection = new ManagedConnection(_factory, CommandRunnerMode.ReadOnly)) { _schema.SchemaTableNames() .Each(tableName => { connection.Execute($"DROP TABLE IF EXISTS {tableName} CASCADE;"); }); var drops = connection.GetStringList(DropAllFunctionSql); drops.Each(drop => connection.Execute(drop)); } }
public void CompletelyRemoveAll() { _schema.SchemaTableNames().Each(dropTable); dropFunctions(_dropAllFunctionSql); }
public bool ShouldRegenerate(IDocumentSchema schema) { var documentTables = schema.SchemaTableNames().ToArray(); return(!documentTables.Contains("mt_streams")); }
public DocumentSchemaWithOverridenDefaultSchemaAndEventsTests() { StoreOptions(options => { options.DatabaseSchemaName = "other"; options.MappingFor(typeof(User)).DatabaseSchemaName = "yet_another"; options.MappingFor(typeof(Issue)).DatabaseSchemaName = "overriden"; options.MappingFor(typeof(Company)); options.Events.AddEventType(typeof(MembersJoined)); }); _schema = theStore.Schema; _sql = _schema.ToDDL(); using (var session = theStore.OpenSession()) { session.Store(new User()); session.Store(new Issue()); session.Store(new Company()); session.SaveChanges(); } _tables = _schema.SchemaTableNames(); _functions = _schema.SchemaFunctionNames(); }
public DocumentSchemaWithOverridenSchemaTests() { StoreOptions(_ => { _.MappingFor(typeof(User)).DatabaseSchemaName = "other"; _.MappingFor(typeof(Issue)).DatabaseSchemaName = "overriden"; _.MappingFor(typeof(Company)); _.DatabaseSchemaName = Marten.StoreOptions.DefaultDatabaseSchemaName; }); _schema = theStore.Schema; _sql = _schema.ToDDL(); using (var session = theStore.OpenSession()) { session.Store(new User()); session.Store(new Issue()); session.Store(new Company()); session.SaveChanges(); } _tables = _schema.SchemaTableNames(); _functions = _schema.SchemaFunctionNames(); }