using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CocktailWeb.Migrations { /// public partial class CreateFillerTable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "Pos", table: "Flaschen"); migrationBuilder.CreateTable( name: "Fillers", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Pos = table.Column(type: "INTEGER", nullable: false), Type = table.Column(type: "INTEGER", nullable: false), FlascheId = table.Column(type: "INTEGER", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Fillers", x => x.Id); table.ForeignKey( name: "FK_Fillers_Flaschen_FlascheId", column: x => x.FlascheId, principalTable: "Flaschen", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_Fillers_FlascheId", table: "Fillers", column: "FlascheId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Fillers"); migrationBuilder.AddColumn( name: "Pos", table: "Flaschen", type: "INTEGER", nullable: true); migrationBuilder.UpdateData( table: "Flaschen", keyColumn: "Id", keyValue: 1, column: "Pos", value: null); migrationBuilder.UpdateData( table: "Flaschen", keyColumn: "Id", keyValue: 2, column: "Pos", value: null); } } }