Flasche um Bild und Alkoholisch-Bool ergänzt

Glas-Tabelle hinzugefügt
This commit is contained in:
BuildTools committed 2024-02-07 19:54:06 +01:00
1 parent 7fcd0c3247
commit b0bebbec8c
10 files changed
+381 -2

No files matched your search

@@ -0,0 +1,263 @@
// <auto-generated />
using System;
using CocktailWeb.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace CocktailWeb.Migrations
{
[DbContext(typeof(DbDataContext))]
[Migration("20240207180034_ModifyFlascheAddGlas")]
partial class ModifyFlascheAddGlas
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.1");
modelBuilder.Entity("CocktailWeb.Data.Cocktail", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("ImageURL")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Cocktails");
});
modelBuilder.Entity("CocktailWeb.Data.CocktailFlasche", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("CocktailID")
.HasColumnType("INTEGER");
b.Property<int>("FlascheID")
.HasColumnType("INTEGER");
b.Property<int>("Menge")
.HasColumnType("INTEGER");
b.Property<int>("Reihenfolge")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("CocktailID");
b.HasIndex("FlascheID");
b.ToTable("CocktailFlaschen");
});
modelBuilder.Entity("CocktailWeb.Data.Filler", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int?>("FlascheId")
.HasColumnType("INTEGER");
b.Property<int>("Pos")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("FlascheId");
b.ToTable("Fillers");
b.HasData(
new
{
Id = 1,
Pos = 1,
Type = 0
},
new
{
Id = 2,
Pos = 2,
Type = 0
},
new
{
Id = 3,
Pos = 3,
Type = 0
},
new
{
Id = 4,
Pos = 4,
Type = 1
},
new
{
Id = 5,
Pos = 5,
Type = 1
},
new
{
Id = 6,
Pos = 6,
Type = 1
},
new
{
Id = 7,
Pos = 7,
Type = 1
},
new
{
Id = 8,
Pos = 8,
Type = 1
},
new
{
Id = 9,
Pos = 9,
Type = 1
},
new
{
Id = 10,
Pos = 10,
Type = 1
},
new
{
Id = 11,
Pos = 11,
Type = 1
},
new
{
Id = 12,
Pos = 12,
Type = 0
},
new
{
Id = 13,
Pos = 13,
Type = 0
},
new
{
Id = 14,
Pos = 14,
Type = 0
});
});
modelBuilder.Entity("CocktailWeb.Data.Flasche", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<bool>("Alkoholisch")
.HasColumnType("INTEGER");
b.Property<string>("ImageURL")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Flaschen", (string)null);
b.HasData(
new
{
Id = 1,
Alkoholisch = true,
Name = "Jägermeister"
},
new
{
Id = 2,
Alkoholisch = true,
Name = "Wodka"
});
});
modelBuilder.Entity("CocktailWeb.Data.Glas", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Fuellmenge")
.HasColumnType("INTEGER");
b.Property<string>("ImageURL")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Glaeser", (string)null);
});
modelBuilder.Entity("CocktailWeb.Data.CocktailFlasche", b =>
{
b.HasOne("CocktailWeb.Data.Cocktail", "Cocktail")
.WithMany("Cocktailflaschen")
.HasForeignKey("CocktailID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CocktailWeb.Data.Flasche", "Flasche")
.WithMany()
.HasForeignKey("FlascheID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Cocktail");
b.Navigation("Flasche");
});
modelBuilder.Entity("CocktailWeb.Data.Filler", b =>
{
b.HasOne("CocktailWeb.Data.Flasche", "Flasche")
.WithMany()
.HasForeignKey("FlascheId");
b.Navigation("Flasche");
});
modelBuilder.Entity("CocktailWeb.Data.Cocktail", b =>
{
b.Navigation("Cocktailflaschen");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,70 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CocktailWeb.Migrations
{
/// <inheritdoc />
public partial class ModifyFlascheAddGlas : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "Alkoholisch",
table: "Flaschen",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "ImageURL",
table: "Flaschen",
type: "TEXT",
nullable: true);
migrationBuilder.CreateTable(
name: "Glaeser",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Fuellmenge = table.Column<int>(type: "INTEGER", nullable: false),
ImageURL = table.Column<string>(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 });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Glaeser");
migrationBuilder.DropColumn(
name: "Alkoholisch",
table: "Flaschen");
migrationBuilder.DropColumn(
name: "ImageURL",
table: "Flaschen");
}
}
}
@@ -176,6 +176,12 @@ namespace CocktailWeb.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<bool>("Alkoholisch")
.HasColumnType("INTEGER");
b.Property<string>("ImageURL")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
@@ -188,15 +194,34 @@ namespace CocktailWeb.Migrations
new
{
Id = 1,
Alkoholisch = true,
Name = "Jägermeister"
},
new
{
Id = 2,
Alkoholisch = true,
Name = "Wodka"
});
});
modelBuilder.Entity("CocktailWeb.Data.Glas", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("Fuellmenge")
.HasColumnType("INTEGER");
b.Property<string>("ImageURL")
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Glaeser", (string)null);
});
modelBuilder.Entity("CocktailWeb.Data.CocktailFlasche", b =>
{
b.HasOne("CocktailWeb.Data.Cocktail", "Cocktail")