예제 #1
0
 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);
         });
     }
 }
예제 #2
0
        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));
        }
예제 #3
0
 public void DeleteAllDocuments()
 {
     _schema.DocumentTables().Each(truncateTable);
 }