Klassen erweitert

This commit is contained in:
Husky
2020-02-21 11:37:04 +01:00
parent 842c42be58
commit f37a7c5dd4
13 changed files with 574 additions and 32 deletions

View File

@@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace KanSan.Base.Migrations
{
[DbContext(typeof(KanSanContext))]
[Migration("20200221084801_InitialCommit")]
[Migration("20200221103518_InitialCommit")]
partial class InitialCommit
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -43,6 +43,23 @@ namespace KanSan.Base.Migrations
b.ToTable("Baustelle");
});
modelBuilder.Entity("KanSan.Base.Models.Fahrzeug", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Kennzeichen")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Fahrzeuge");
});
modelBuilder.Entity("KanSan.Base.Models.Kunde", b =>
{
b.Property<int>("ID")
@@ -72,6 +89,29 @@ namespace KanSan.Base.Migrations
b.ToTable("Kunden");
});
modelBuilder.Entity("KanSan.Base.Models.LeitungsverzeichnisPosition", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Beschreibung")
.HasColumnType("TEXT");
b.Property<string>("Einheit")
.HasColumnType("TEXT");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Positionsnummer")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("LeitungsverzeichnisPositionen");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.Property<int>("ID")
@@ -97,6 +137,50 @@ namespace KanSan.Base.Migrations
b.ToTable("Projekte");
});
modelBuilder.Entity("KanSan.Base.Models.Sanierungskonzept", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int>("SanierungsTyp")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.ToTable("Sanierungskonzept");
});
modelBuilder.Entity("KanSan.Base.Models.Schaeden", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int>("SanierungsTyp")
.HasColumnType("INTEGER");
b.Property<int?>("SanierungskonzeptID")
.HasColumnType("INTEGER");
b.Property<int?>("SewerID")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("SanierungskonzeptID");
b.HasIndex("SewerID");
b.ToTable("Schaeden");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.Property<int>("ID")
@@ -164,6 +248,47 @@ namespace KanSan.Base.Migrations
b.ToTable("SewerPoints");
});
modelBuilder.Entity("KanSan.Base.Models.Taetigkeiten", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<decimal>("Anzahl")
.HasColumnType("TEXT");
b.Property<int?>("FahrzeugID")
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int?>("LeitungsverzeichnisPositionID")
.HasColumnType("INTEGER");
b.Property<string>("Mitarbeiter")
.HasColumnType("TEXT");
b.Property<decimal>("Position")
.HasColumnType("TEXT");
b.Property<int?>("SanierungskonzeptID")
.HasColumnType("INTEGER");
b.Property<DateTime>("ZeitStempel")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("FahrzeugID");
b.HasIndex("LeitungsverzeichnisPositionID");
b.HasIndex("SanierungskonzeptID");
b.ToTable("Taetigkeiten");
});
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.HasOne("KanSan.Base.Models.Projekt", "Projekt")
@@ -178,6 +303,17 @@ namespace KanSan.Base.Migrations
.HasForeignKey("KundeID");
});
modelBuilder.Entity("KanSan.Base.Models.Schaeden", b =>
{
b.HasOne("KanSan.Base.Models.Sanierungskonzept", "Sanierungskonzept")
.WithMany()
.HasForeignKey("SanierungskonzeptID");
b.HasOne("KanSan.Base.Models.Sewer", "Sewer")
.WithMany("Schaeden")
.HasForeignKey("SewerID");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.HasOne("KanSan.Base.Models.Baustelle", "Baustelle")
@@ -192,6 +328,21 @@ namespace KanSan.Base.Migrations
.WithMany()
.HasForeignKey("PunktUntenID");
});
modelBuilder.Entity("KanSan.Base.Models.Taetigkeiten", b =>
{
b.HasOne("KanSan.Base.Models.Fahrzeug", "Fahrzeug")
.WithMany()
.HasForeignKey("FahrzeugID");
b.HasOne("KanSan.Base.Models.LeitungsverzeichnisPosition", "LeitungsverzeichnisPosition")
.WithMany()
.HasForeignKey("LeitungsverzeichnisPositionID");
b.HasOne("KanSan.Base.Models.Sanierungskonzept", "Sanierungskonzept")
.WithMany("Taetigkeiten")
.HasForeignKey("SanierungskonzeptID");
});
#pragma warning restore 612, 618
}
}

View File

@@ -7,6 +7,20 @@ namespace KanSan.Base.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Fahrzeuge",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
Kennzeichen = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Fahrzeuge", x => x.ID);
});
migrationBuilder.CreateTable(
name: "Kunden",
columns: table => new
@@ -25,6 +39,36 @@ namespace KanSan.Base.Migrations
table.PrimaryKey("PK_Kunden", x => x.ID);
});
migrationBuilder.CreateTable(
name: "LeitungsverzeichnisPositionen",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
Positionsnummer = table.Column<string>(nullable: true),
Beschreibung = table.Column<string>(nullable: true),
Einheit = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LeitungsverzeichnisPositionen", x => x.ID);
});
migrationBuilder.CreateTable(
name: "Sanierungskonzept",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
SanierungsTyp = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Sanierungskonzept", x => x.ID);
});
migrationBuilder.CreateTable(
name: "SewerPoints",
columns: table => new
@@ -61,6 +105,44 @@ namespace KanSan.Base.Migrations
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Taetigkeiten",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
SanierungskonzeptID = table.Column<int>(nullable: true),
FahrzeugID = table.Column<int>(nullable: true),
Mitarbeiter = table.Column<string>(nullable: true),
ZeitStempel = table.Column<DateTime>(nullable: false),
Position = table.Column<decimal>(nullable: false),
LeitungsverzeichnisPositionID = table.Column<int>(nullable: true),
Anzahl = table.Column<decimal>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Taetigkeiten", x => x.ID);
table.ForeignKey(
name: "FK_Taetigkeiten_Fahrzeuge_FahrzeugID",
column: x => x.FahrzeugID,
principalTable: "Fahrzeuge",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Taetigkeiten_LeitungsverzeichnisPositionen_LeitungsverzeichnisPositionID",
column: x => x.LeitungsverzeichnisPositionID,
principalTable: "LeitungsverzeichnisPositionen",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Taetigkeiten_Sanierungskonzept_SanierungskonzeptID",
column: x => x.SanierungskonzeptID,
principalTable: "Sanierungskonzept",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Baustelle",
columns: table => new
@@ -124,6 +206,34 @@ namespace KanSan.Base.Migrations
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Schaeden",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
SewerID = table.Column<int>(nullable: true),
SanierungsTyp = table.Column<int>(nullable: false),
SanierungskonzeptID = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Schaeden", x => x.ID);
table.ForeignKey(
name: "FK_Schaeden_Sanierungskonzept_SanierungskonzeptID",
column: x => x.SanierungskonzeptID,
principalTable: "Sanierungskonzept",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Schaeden_Kanaele_SewerID",
column: x => x.SewerID,
principalTable: "Kanaele",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_Baustelle_ProjektID",
table: "Baustelle",
@@ -148,13 +258,53 @@ namespace KanSan.Base.Migrations
name: "IX_Projekte_KundeID",
table: "Projekte",
column: "KundeID");
migrationBuilder.CreateIndex(
name: "IX_Schaeden_SanierungskonzeptID",
table: "Schaeden",
column: "SanierungskonzeptID");
migrationBuilder.CreateIndex(
name: "IX_Schaeden_SewerID",
table: "Schaeden",
column: "SewerID");
migrationBuilder.CreateIndex(
name: "IX_Taetigkeiten_FahrzeugID",
table: "Taetigkeiten",
column: "FahrzeugID");
migrationBuilder.CreateIndex(
name: "IX_Taetigkeiten_LeitungsverzeichnisPositionID",
table: "Taetigkeiten",
column: "LeitungsverzeichnisPositionID");
migrationBuilder.CreateIndex(
name: "IX_Taetigkeiten_SanierungskonzeptID",
table: "Taetigkeiten",
column: "SanierungskonzeptID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Schaeden");
migrationBuilder.DropTable(
name: "Taetigkeiten");
migrationBuilder.DropTable(
name: "Kanaele");
migrationBuilder.DropTable(
name: "Fahrzeuge");
migrationBuilder.DropTable(
name: "LeitungsverzeichnisPositionen");
migrationBuilder.DropTable(
name: "Sanierungskonzept");
migrationBuilder.DropTable(
name: "Baustelle");

View File

@@ -41,6 +41,23 @@ namespace KanSan.Base.Migrations
b.ToTable("Baustelle");
});
modelBuilder.Entity("KanSan.Base.Models.Fahrzeug", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Kennzeichen")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Fahrzeuge");
});
modelBuilder.Entity("KanSan.Base.Models.Kunde", b =>
{
b.Property<int>("ID")
@@ -70,6 +87,29 @@ namespace KanSan.Base.Migrations
b.ToTable("Kunden");
});
modelBuilder.Entity("KanSan.Base.Models.LeitungsverzeichnisPosition", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Beschreibung")
.HasColumnType("TEXT");
b.Property<string>("Einheit")
.HasColumnType("TEXT");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Positionsnummer")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("LeitungsverzeichnisPositionen");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.Property<int>("ID")
@@ -95,6 +135,50 @@ namespace KanSan.Base.Migrations
b.ToTable("Projekte");
});
modelBuilder.Entity("KanSan.Base.Models.Sanierungskonzept", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int>("SanierungsTyp")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.ToTable("Sanierungskonzept");
});
modelBuilder.Entity("KanSan.Base.Models.Schaeden", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int>("SanierungsTyp")
.HasColumnType("INTEGER");
b.Property<int?>("SanierungskonzeptID")
.HasColumnType("INTEGER");
b.Property<int?>("SewerID")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("SanierungskonzeptID");
b.HasIndex("SewerID");
b.ToTable("Schaeden");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.Property<int>("ID")
@@ -162,6 +246,47 @@ namespace KanSan.Base.Migrations
b.ToTable("SewerPoints");
});
modelBuilder.Entity("KanSan.Base.Models.Taetigkeiten", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<decimal>("Anzahl")
.HasColumnType("TEXT");
b.Property<int?>("FahrzeugID")
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int?>("LeitungsverzeichnisPositionID")
.HasColumnType("INTEGER");
b.Property<string>("Mitarbeiter")
.HasColumnType("TEXT");
b.Property<decimal>("Position")
.HasColumnType("TEXT");
b.Property<int?>("SanierungskonzeptID")
.HasColumnType("INTEGER");
b.Property<DateTime>("ZeitStempel")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("FahrzeugID");
b.HasIndex("LeitungsverzeichnisPositionID");
b.HasIndex("SanierungskonzeptID");
b.ToTable("Taetigkeiten");
});
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.HasOne("KanSan.Base.Models.Projekt", "Projekt")
@@ -176,6 +301,17 @@ namespace KanSan.Base.Migrations
.HasForeignKey("KundeID");
});
modelBuilder.Entity("KanSan.Base.Models.Schaeden", b =>
{
b.HasOne("KanSan.Base.Models.Sanierungskonzept", "Sanierungskonzept")
.WithMany()
.HasForeignKey("SanierungskonzeptID");
b.HasOne("KanSan.Base.Models.Sewer", "Sewer")
.WithMany("Schaeden")
.HasForeignKey("SewerID");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.HasOne("KanSan.Base.Models.Baustelle", "Baustelle")
@@ -190,6 +326,21 @@ namespace KanSan.Base.Migrations
.WithMany()
.HasForeignKey("PunktUntenID");
});
modelBuilder.Entity("KanSan.Base.Models.Taetigkeiten", b =>
{
b.HasOne("KanSan.Base.Models.Fahrzeug", "Fahrzeug")
.WithMany()
.HasForeignKey("FahrzeugID");
b.HasOne("KanSan.Base.Models.LeitungsverzeichnisPosition", "LeitungsverzeichnisPosition")
.WithMany()
.HasForeignKey("LeitungsverzeichnisPositionID");
b.HasOne("KanSan.Base.Models.Sanierungskonzept", "Sanierungskonzept")
.WithMany("Taetigkeiten")
.HasForeignKey("SanierungskonzeptID");
});
#pragma warning restore 612, 618
}
}