using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CocktailWeb.Migrations { /// public partial class ModifyFlascheAddGlas : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "Alkoholisch", table: "Flaschen", type: "INTEGER", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "ImageURL", table: "Flaschen", type: "TEXT", nullable: true); migrationBuilder.CreateTable( name: "Glaeser", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Fuellmenge = table.Column(type: "INTEGER", nullable: false), ImageURL = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Glaeser", x => x.Id); }); migrationBuilder.UpdateData( table: "Flaschen", keyColumn: "Id", keyValue: 1, columns: new[] { "Alkoholisch", "ImageURL" }, values: new object[] { true, null }); migrationBuilder.UpdateData( table: "Flaschen", keyColumn: "Id", keyValue: 2, columns: new[] { "Alkoholisch", "ImageURL" }, values: new object[] { true, null }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Glaeser"); migrationBuilder.DropColumn( name: "Alkoholisch", table: "Flaschen"); migrationBuilder.DropColumn( name: "ImageURL", table: "Flaschen"); } } }