public void DeleteAllDocuments() { using (var conn = new ManagedConnection(_factory, CommandRunnerMode.ReadOnly)) { _schema.DocumentTables().Each(tableName => { var sql = "truncate {0} cascade".ToFormat(tableName); conn.Execute(sql); }); } }
public bool ShouldRegenerate(IDocumentSchema schema) { if (!schema.DocumentTables().Contains(TableName)) { return(true); } var existing = schema.TableSchema(TableName); var expected = ToTable(schema); return(!expected.Equals(existing)); }
public void DeleteAllDocuments() { _schema.DocumentTables().Each(truncateTable); }