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); }
public static IEnumerable <string> CreateSql(this ISchemaBuilder builder, ISchemaBuilderCommand command) { return(builder.CreateSql(new[] { command })); }