Daten können hinzugefügt

This commit is contained in:
Husky
2020-02-20 21:32:36 +01:00
parent 10ea0783e7
commit 954ffb4bc8
34 changed files with 861 additions and 715 deletions

View File

@@ -0,0 +1,87 @@
// <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

@@ -0,0 +1,66 @@
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,85 @@
// <auto-generated />
using System;
using KanSan.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace KanSan.Base.Migrations
{
[DbContext(typeof(KanSanContext))]
partial class KanSanContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(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
}
}
}