예제 #1
0
        public SchemaBuilder CreateMapIndexTable(string name, Action <CreateTableCommand> table)
        {
            var createTable = new CreateTableCommand(FormatTable(name));

            createTable
            .Column <int>("Id", column => column.PrimaryKey().Identity().NotNull())
            .Column <int>("DocumentId");

            table(createTable);
            Execute(_builder.CreateSql(createTable));

            CreateForeignKey("FK_" + name, name, new[] { "DocumentId" }, "Document", new[] { "Id" });
            return(this);
        }
예제 #2
0
 public static IEnumerable <string> CreateSql(this ISchemaBuilder builder, ISchemaBuilderCommand command)
 {
     return(builder.CreateSql(new[] { command }));
 }