Klassen erweitert

This commit is contained in:
Husky
2020-02-21 09:50:32 +01:00
parent 5798fc6108
commit fc144554a5
18 changed files with 596 additions and 192 deletions

View File

@@ -1,87 +0,0 @@
// <auto-generated />
using System;
using KanSan.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace KanSan.Base.Migrations
{
[DbContext(typeof(KanSanContext))]
[Migration("20200220200339_InitialCommit")]
partial class InitialCommit
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.1");
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int?>("KundeID")
.HasColumnType("INTEGER");
b.Property<string>("Ort")
.HasColumnType("TEXT");
b.Property<string>("Projektnummer")
.HasColumnType("TEXT");
b.Property<string>("Strasse")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("KundeID");
b.ToTable("Baustellen");
});
modelBuilder.Entity("KanSan.Base.Models.Kunde", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Nachname")
.HasColumnType("TEXT");
b.Property<string>("Ort")
.HasColumnType("TEXT");
b.Property<string>("PLZ")
.HasColumnType("TEXT");
b.Property<string>("Strasse")
.HasColumnType("TEXT");
b.Property<string>("Vorname")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Kunden");
});
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.HasOne("KanSan.Base.Models.Kunde", "Kunde")
.WithMany("Baustellen")
.HasForeignKey("KundeID");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,66 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace KanSan.Base.Migrations
{
public partial class InitialCommit : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Kunden",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
Vorname = table.Column<string>(nullable: true),
Nachname = table.Column<string>(nullable: true),
Strasse = table.Column<string>(nullable: true),
PLZ = table.Column<string>(nullable: true),
Ort = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Kunden", x => x.ID);
});
migrationBuilder.CreateTable(
name: "Baustellen",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
KundeID = table.Column<int>(nullable: true),
Ort = table.Column<string>(nullable: true),
Strasse = table.Column<string>(nullable: true),
Projektnummer = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Baustellen", x => x.ID);
table.ForeignKey(
name: "FK_Baustellen_Kunden_KundeID",
column: x => x.KundeID,
principalTable: "Kunden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_Baustellen_KundeID",
table: "Baustellen",
column: "KundeID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Baustellen");
migrationBuilder.DropTable(
name: "Kunden");
}
}
}

View File

@@ -0,0 +1,198 @@
// <auto-generated />
using System;
using KanSan.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace KanSan.Base.Migrations
{
[DbContext(typeof(KanSanContext))]
[Migration("20200221084801_InitialCommit")]
partial class InitialCommit
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "3.1.1");
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("BaustelleNummer")
.HasColumnType("TEXT");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("OrtTeil")
.HasColumnType("TEXT");
b.Property<int?>("ProjektID")
.HasColumnType("INTEGER");
b.HasKey("ID");
b.HasIndex("ProjektID");
b.ToTable("Baustelle");
});
modelBuilder.Entity("KanSan.Base.Models.Kunde", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Nachname")
.HasColumnType("TEXT");
b.Property<string>("Ort")
.HasColumnType("TEXT");
b.Property<string>("PLZ")
.HasColumnType("TEXT");
b.Property<string>("Strasse")
.HasColumnType("TEXT");
b.Property<string>("Vorname")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("Kunden");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int?>("KundeID")
.HasColumnType("INTEGER");
b.Property<string>("Ort")
.HasColumnType("TEXT");
b.Property<string>("Projektnummer")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("KundeID");
b.ToTable("Projekte");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int?>("BaustelleID")
.HasColumnType("INTEGER");
b.Property<int>("DN")
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int>("Material")
.HasColumnType("INTEGER");
b.Property<string>("ObjektNummer")
.HasColumnType("TEXT");
b.Property<int?>("PunktObenID")
.HasColumnType("INTEGER");
b.Property<int>("PunktTypeOben")
.HasColumnType("INTEGER");
b.Property<int>("PunktTypeUnten")
.HasColumnType("INTEGER");
b.Property<int?>("PunktUntenID")
.HasColumnType("INTEGER");
b.Property<int>("SewerType")
.HasColumnType("INTEGER");
b.Property<string>("StrasseName")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("BaustelleID");
b.HasIndex("PunktObenID");
b.HasIndex("PunktUntenID");
b.ToTable("Kanaele");
});
modelBuilder.Entity("KanSan.Base.Models.SewerPoint", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Objektnummer")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SewerPoints");
});
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.HasOne("KanSan.Base.Models.Projekt", "Projekt")
.WithMany()
.HasForeignKey("ProjektID");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.HasOne("KanSan.Base.Models.Kunde", "Kunde")
.WithMany("Baustellen")
.HasForeignKey("KundeID");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.HasOne("KanSan.Base.Models.Baustelle", "Baustelle")
.WithMany("Kanaele")
.HasForeignKey("BaustelleID");
b.HasOne("KanSan.Base.Models.SewerPoint", "PunktOben")
.WithMany()
.HasForeignKey("PunktObenID");
b.HasOne("KanSan.Base.Models.SewerPoint", "PunktUnten")
.WithMany()
.HasForeignKey("PunktUntenID");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,171 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace KanSan.Base.Migrations
{
public partial class InitialCommit : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Kunden",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
Vorname = table.Column<string>(nullable: true),
Nachname = table.Column<string>(nullable: true),
Strasse = table.Column<string>(nullable: true),
PLZ = table.Column<string>(nullable: true),
Ort = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Kunden", x => x.ID);
});
migrationBuilder.CreateTable(
name: "SewerPoints",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
Objektnummer = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SewerPoints", x => x.ID);
});
migrationBuilder.CreateTable(
name: "Projekte",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
KundeID = table.Column<int>(nullable: true),
Ort = table.Column<string>(nullable: true),
Projektnummer = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Projekte", x => x.ID);
table.ForeignKey(
name: "FK_Projekte_Kunden_KundeID",
column: x => x.KundeID,
principalTable: "Kunden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Baustelle",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
ProjektID = table.Column<int>(nullable: true),
OrtTeil = table.Column<string>(nullable: true),
BaustelleNummer = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Baustelle", x => x.ID);
table.ForeignKey(
name: "FK_Baustelle_Projekte_ProjektID",
column: x => x.ProjektID,
principalTable: "Projekte",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Kanaele",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuidNr = table.Column<Guid>(nullable: false),
BaustelleID = table.Column<int>(nullable: true),
StrasseName = table.Column<string>(nullable: true),
ObjektNummer = table.Column<string>(nullable: true),
SewerType = table.Column<int>(nullable: false),
PunktTypeOben = table.Column<int>(nullable: false),
PunktObenID = table.Column<int>(nullable: true),
PunktTypeUnten = table.Column<int>(nullable: false),
PunktUntenID = table.Column<int>(nullable: true),
DN = table.Column<int>(nullable: false),
Material = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Kanaele", x => x.ID);
table.ForeignKey(
name: "FK_Kanaele_Baustelle_BaustelleID",
column: x => x.BaustelleID,
principalTable: "Baustelle",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Kanaele_SewerPoints_PunktObenID",
column: x => x.PunktObenID,
principalTable: "SewerPoints",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_Kanaele_SewerPoints_PunktUntenID",
column: x => x.PunktUntenID,
principalTable: "SewerPoints",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_Baustelle_ProjektID",
table: "Baustelle",
column: "ProjektID");
migrationBuilder.CreateIndex(
name: "IX_Kanaele_BaustelleID",
table: "Kanaele",
column: "BaustelleID");
migrationBuilder.CreateIndex(
name: "IX_Kanaele_PunktObenID",
table: "Kanaele",
column: "PunktObenID");
migrationBuilder.CreateIndex(
name: "IX_Kanaele_PunktUntenID",
table: "Kanaele",
column: "PunktUntenID");
migrationBuilder.CreateIndex(
name: "IX_Projekte_KundeID",
table: "Projekte",
column: "KundeID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Kanaele");
migrationBuilder.DropTable(
name: "Baustelle");
migrationBuilder.DropTable(
name: "SewerPoints");
migrationBuilder.DropTable(
name: "Projekte");
migrationBuilder.DropTable(
name: "Kunden");
}
}
}

View File

@@ -22,26 +22,23 @@ namespace KanSan.Base.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("BaustelleNummer")
.HasColumnType("TEXT");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int?>("KundeID")
b.Property<string>("OrtTeil")
.HasColumnType("TEXT");
b.Property<int?>("ProjektID")
.HasColumnType("INTEGER");
b.Property<string>("Ort")
.HasColumnType("TEXT");
b.Property<string>("Projektnummer")
.HasColumnType("TEXT");
b.Property<string>("Strasse")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("KundeID");
b.HasIndex("ProjektID");
b.ToTable("Baustellen");
b.ToTable("Baustelle");
});
modelBuilder.Entity("KanSan.Base.Models.Kunde", b =>
@@ -73,12 +70,126 @@ namespace KanSan.Base.Migrations
b.ToTable("Kunden");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int?>("KundeID")
.HasColumnType("INTEGER");
b.Property<string>("Ort")
.HasColumnType("TEXT");
b.Property<string>("Projektnummer")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("KundeID");
b.ToTable("Projekte");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int?>("BaustelleID")
.HasColumnType("INTEGER");
b.Property<int>("DN")
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<int>("Material")
.HasColumnType("INTEGER");
b.Property<string>("ObjektNummer")
.HasColumnType("TEXT");
b.Property<int?>("PunktObenID")
.HasColumnType("INTEGER");
b.Property<int>("PunktTypeOben")
.HasColumnType("INTEGER");
b.Property<int>("PunktTypeUnten")
.HasColumnType("INTEGER");
b.Property<int?>("PunktUntenID")
.HasColumnType("INTEGER");
b.Property<int>("SewerType")
.HasColumnType("INTEGER");
b.Property<string>("StrasseName")
.HasColumnType("TEXT");
b.HasKey("ID");
b.HasIndex("BaustelleID");
b.HasIndex("PunktObenID");
b.HasIndex("PunktUntenID");
b.ToTable("Kanaele");
});
modelBuilder.Entity("KanSan.Base.Models.SewerPoint", b =>
{
b.Property<int>("ID")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<Guid>("GuidNr")
.HasColumnType("TEXT");
b.Property<string>("Objektnummer")
.HasColumnType("TEXT");
b.HasKey("ID");
b.ToTable("SewerPoints");
});
modelBuilder.Entity("KanSan.Base.Models.Baustelle", b =>
{
b.HasOne("KanSan.Base.Models.Projekt", "Projekt")
.WithMany()
.HasForeignKey("ProjektID");
});
modelBuilder.Entity("KanSan.Base.Models.Projekt", b =>
{
b.HasOne("KanSan.Base.Models.Kunde", "Kunde")
.WithMany("Baustellen")
.HasForeignKey("KundeID");
});
modelBuilder.Entity("KanSan.Base.Models.Sewer", b =>
{
b.HasOne("KanSan.Base.Models.Baustelle", "Baustelle")
.WithMany("Kanaele")
.HasForeignKey("BaustelleID");
b.HasOne("KanSan.Base.Models.SewerPoint", "PunktOben")
.WithMany()
.HasForeignKey("PunktObenID");
b.HasOne("KanSan.Base.Models.SewerPoint", "PunktUnten")
.WithMany()
.HasForeignKey("PunktUntenID");
});
#pragma warning restore 612, 618
}
}