Database updates
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// This is auto-generated code.
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by Entity Developer tool using EF Core template.
|
||||
// Code is generated on: 24.01.2022 08:57:25
|
||||
// Code is generated on: 01.04.2022 16:25:00
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -60,19 +60,13 @@ namespace FoodsharingSiegen.Server.Data
|
||||
set;
|
||||
}
|
||||
|
||||
public virtual DbSet<InteractionProcess> InteractionProcesses
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public virtual DbSet<Prospect> Prospects
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public virtual DbSet<InteractionDate> InteractionDates
|
||||
public virtual DbSet<Interaction> Interactions
|
||||
{
|
||||
get;
|
||||
set;
|
||||
@@ -85,14 +79,11 @@ namespace FoodsharingSiegen.Server.Data
|
||||
this.UserMapping(modelBuilder);
|
||||
this.CustomizeUserMapping(modelBuilder);
|
||||
|
||||
this.InteractionProcessMapping(modelBuilder);
|
||||
this.CustomizeInteractionProcessMapping(modelBuilder);
|
||||
|
||||
this.ProspectMapping(modelBuilder);
|
||||
this.CustomizeProspectMapping(modelBuilder);
|
||||
|
||||
this.InteractionDateMapping(modelBuilder);
|
||||
this.CustomizeInteractionDateMapping(modelBuilder);
|
||||
this.InteractionMapping(modelBuilder);
|
||||
this.CustomizeInteractionMapping(modelBuilder);
|
||||
|
||||
RelationshipsMapping(modelBuilder);
|
||||
CustomizeMapping(ref modelBuilder);
|
||||
@@ -116,25 +107,6 @@ namespace FoodsharingSiegen.Server.Data
|
||||
|
||||
#endregion
|
||||
|
||||
#region InteractionProcess Mapping
|
||||
|
||||
private void InteractionProcessMapping(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<InteractionProcess>().ToTable(@"InteractionProcesses");
|
||||
modelBuilder.Entity<InteractionProcess>().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd();
|
||||
modelBuilder.Entity<InteractionProcess>().Property(x => x.EinAb1Id).HasColumnName(@"EinAb1Id").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionProcess>().Property(x => x.EinAb2Id).HasColumnName(@"EinAb2Id").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionProcess>().Property(x => x.EinAb3Id).HasColumnName(@"EinAb3Id").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionProcess>().Property(x => x.WelcomeId).HasColumnName(@"WelcomeId").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionProcess>().Property(x => x.VerifyId).HasColumnName(@"VerifyId").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionProcess>().Property(x => x.PassId).HasColumnName(@"PassId").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionProcess>().HasKey(@"Id");
|
||||
}
|
||||
|
||||
partial void CustomizeInteractionProcessMapping(ModelBuilder modelBuilder);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Prospect Mapping
|
||||
|
||||
private void ProspectMapping(ModelBuilder modelBuilder)
|
||||
@@ -151,35 +123,31 @@ namespace FoodsharingSiegen.Server.Data
|
||||
|
||||
#endregion
|
||||
|
||||
#region InteractionDate Mapping
|
||||
#region Interaction Mapping
|
||||
|
||||
private void InteractionDateMapping(ModelBuilder modelBuilder)
|
||||
private void InteractionMapping(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<InteractionDate>().ToTable(@"InteractionDates");
|
||||
modelBuilder.Entity<InteractionDate>().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd();
|
||||
modelBuilder.Entity<InteractionDate>().Property(x => x.Date).HasColumnName(@"Date").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionDate>().Property(x => x.UserId).HasColumnName(@"UserId").ValueGeneratedNever();
|
||||
modelBuilder.Entity<InteractionDate>().HasKey(@"Id");
|
||||
modelBuilder.Entity<Interaction>().ToTable(@"Interactions");
|
||||
modelBuilder.Entity<Interaction>().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedOnAdd();
|
||||
modelBuilder.Entity<Interaction>().Property(x => x.Date).HasColumnName(@"Date").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<Interaction>().Property(x => x.UserId).HasColumnName(@"UserId").ValueGeneratedNever();
|
||||
modelBuilder.Entity<Interaction>().Property(x => x.Type).HasColumnName(@"Type").IsRequired().ValueGeneratedNever();
|
||||
modelBuilder.Entity<Interaction>().Property(x => x.ProspectId).HasColumnName(@"ProspectId").ValueGeneratedNever();
|
||||
modelBuilder.Entity<Interaction>().HasKey(@"Id");
|
||||
}
|
||||
|
||||
partial void CustomizeInteractionDateMapping(ModelBuilder modelBuilder);
|
||||
partial void CustomizeInteractionMapping(ModelBuilder modelBuilder);
|
||||
|
||||
#endregion
|
||||
|
||||
private void RelationshipsMapping(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<User>().HasMany(x => x.InteractionDates).WithOne(op => op.User).HasForeignKey(@"UserId").IsRequired(true);
|
||||
modelBuilder.Entity<User>().HasMany(x => x.Interactions).WithOne(op => op.User).HasForeignKey(@"UserId").IsRequired(true);
|
||||
|
||||
modelBuilder.Entity<InteractionProcess>().HasOne(x => x.EinAb1).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"EinAb1Id").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true);
|
||||
modelBuilder.Entity<InteractionProcess>().HasOne(x => x.EinAb2).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"EinAb2Id").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true);
|
||||
modelBuilder.Entity<InteractionProcess>().HasOne(x => x.EinAb3).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"EinAb3Id").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true);
|
||||
modelBuilder.Entity<InteractionProcess>().HasOne(x => x.Welcome).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"WelcomeId").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true);
|
||||
modelBuilder.Entity<InteractionProcess>().HasOne(x => x.Verify).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"VerifyId").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true);
|
||||
modelBuilder.Entity<InteractionProcess>().HasOne(x => x.Pass).WithOne().HasPrincipalKey(typeof(InteractionProcess), @"PassId").HasForeignKey(typeof(InteractionDate), @"Id").IsRequired(true);
|
||||
modelBuilder.Entity<Prospect>().HasMany(x => x.Interactions).WithOne(op => op.Prospect).HasForeignKey(@"ProspectId").IsRequired(true);
|
||||
|
||||
modelBuilder.Entity<Prospect>().HasOne(x => x.Progress).WithOne().HasPrincipalKey(typeof(Prospect), @"ProgressId").HasForeignKey(typeof(InteractionProcess), @"Id").IsRequired(true);
|
||||
|
||||
modelBuilder.Entity<InteractionDate>().HasOne(x => x.User).WithMany(op => op.InteractionDates).HasForeignKey(@"UserId").IsRequired(true);
|
||||
modelBuilder.Entity<Interaction>().HasOne(x => x.User).WithMany(op => op.Interactions).HasForeignKey(@"UserId").IsRequired(true);
|
||||
modelBuilder.Entity<Interaction>().HasOne(x => x.Prospect).WithMany(op => op.Interactions).HasForeignKey(@"ProspectId").IsRequired(true);
|
||||
}
|
||||
|
||||
partial void CustomizeMapping(ref ModelBuilder modelBuilder);
|
||||
|
||||
@@ -1,234 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FoodsharingSiegen.Server.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FoodsharingSiegen.Server.Migrations
|
||||
{
|
||||
[DbContext(typeof(FsContext))]
|
||||
[Migration("20220124091416_Init")]
|
||||
partial class Init
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionDate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Date");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("InteractionDates", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<Guid>("EinAb1Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("EinAb1Id");
|
||||
|
||||
b.Property<Guid>("EinAb2Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("EinAb2Id");
|
||||
|
||||
b.Property<Guid>("EinAb3Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("EinAb3Id");
|
||||
|
||||
b.Property<Guid>("PassId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("PassId");
|
||||
|
||||
b.Property<Guid>("VerifyId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("VerifyId");
|
||||
|
||||
b.Property<Guid>("WelcomeId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("WelcomeId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("InteractionProcesses", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<int>("FsId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("FsId");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Name");
|
||||
|
||||
b.Property<Guid>("ProgressId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ProgressId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prospects", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Created");
|
||||
|
||||
b.Property<string>("Mail")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Mail");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Name");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("Type");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("Verified");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionDate", b =>
|
||||
{
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("EinAb1")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb1Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("EinAb2")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb2Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id1");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("EinAb3")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb3Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id2");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("Pass")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "PassId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id3");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("Verify")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "VerifyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id4");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("Welcome")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "WelcomeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id5");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User")
|
||||
.WithMany("InteractionDates")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b =>
|
||||
{
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", null)
|
||||
.WithOne("Progress")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.Prospect", "ProgressId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b =>
|
||||
{
|
||||
b.Navigation("EinAb1");
|
||||
|
||||
b.Navigation("EinAb2");
|
||||
|
||||
b.Navigation("EinAb3");
|
||||
|
||||
b.Navigation("Pass");
|
||||
|
||||
b.Navigation("Verify");
|
||||
|
||||
b.Navigation("Welcome");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
{
|
||||
b.Navigation("Progress");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b =>
|
||||
{
|
||||
b.Navigation("InteractionDates");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FoodsharingSiegen.Server.Migrations
|
||||
{
|
||||
public partial class Init : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Prospects",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
FsId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
ProgressId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Prospects", x => x.Id);
|
||||
table.UniqueConstraint("AK_Prospects_ProgressId", x => x.ProgressId);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Mail = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Verified = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Created = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "InteractionProcesses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
EinAb1Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
EinAb2Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
EinAb3Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
WelcomeId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
VerifyId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
PassId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_InteractionProcesses", x => x.Id);
|
||||
table.UniqueConstraint("AK_InteractionProcesses_EinAb1Id", x => x.EinAb1Id);
|
||||
table.UniqueConstraint("AK_InteractionProcesses_EinAb2Id", x => x.EinAb2Id);
|
||||
table.UniqueConstraint("AK_InteractionProcesses_EinAb3Id", x => x.EinAb3Id);
|
||||
table.UniqueConstraint("AK_InteractionProcesses_PassId", x => x.PassId);
|
||||
table.UniqueConstraint("AK_InteractionProcesses_VerifyId", x => x.VerifyId);
|
||||
table.UniqueConstraint("AK_InteractionProcesses_WelcomeId", x => x.WelcomeId);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionProcesses_Prospects_Id",
|
||||
column: x => x.Id,
|
||||
principalTable: "Prospects",
|
||||
principalColumn: "ProgressId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "InteractionDates",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Date = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_InteractionDates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionDates_InteractionProcesses_Id",
|
||||
column: x => x.Id,
|
||||
principalTable: "InteractionProcesses",
|
||||
principalColumn: "EinAb1Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionDates_InteractionProcesses_Id1",
|
||||
column: x => x.Id,
|
||||
principalTable: "InteractionProcesses",
|
||||
principalColumn: "EinAb2Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionDates_InteractionProcesses_Id2",
|
||||
column: x => x.Id,
|
||||
principalTable: "InteractionProcesses",
|
||||
principalColumn: "EinAb3Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionDates_InteractionProcesses_Id3",
|
||||
column: x => x.Id,
|
||||
principalTable: "InteractionProcesses",
|
||||
principalColumn: "PassId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionDates_InteractionProcesses_Id4",
|
||||
column: x => x.Id,
|
||||
principalTable: "InteractionProcesses",
|
||||
principalColumn: "VerifyId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionDates_InteractionProcesses_Id5",
|
||||
column: x => x.Id,
|
||||
principalTable: "InteractionProcesses",
|
||||
principalColumn: "WelcomeId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_InteractionDates_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_InteractionDates_UserId",
|
||||
table: "InteractionDates",
|
||||
column: "UserId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "InteractionDates");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "InteractionProcesses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Prospects");
|
||||
}
|
||||
}
|
||||
}
|
||||
144
FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs
generated
Normal file
144
FoodsharingSiegen.Server/Migrations/20220401142848_Init.Designer.cs
generated
Normal file
@@ -0,0 +1,144 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using FoodsharingSiegen.Server.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FoodsharingSiegen.Server.Migrations
|
||||
{
|
||||
[DbContext(typeof(FsContext))]
|
||||
[Migration("20220401142848_Init")]
|
||||
partial class Init
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<DateTime>("Date")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Date");
|
||||
|
||||
b.Property<Guid>("ProspectId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ProspectId");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("Type");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProspectId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Interactions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<int>("FsId")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("FsId");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Name");
|
||||
|
||||
b.Property<Guid>("ProgressId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ProgressId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prospects", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<DateTime>("Created")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Created");
|
||||
|
||||
b.Property<string>("Mail")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Mail");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Name");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("Type");
|
||||
|
||||
b.Property<bool>("Verified")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("Verified");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Users", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b =>
|
||||
{
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect")
|
||||
.WithMany("Interactions")
|
||||
.HasForeignKey("ProspectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User")
|
||||
.WithMany("Interactions")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Prospect");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
{
|
||||
b.Navigation("Interactions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b =>
|
||||
{
|
||||
b.Navigation("Interactions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
92
FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs
Normal file
92
FoodsharingSiegen.Server/Migrations/20220401142848_Init.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace FoodsharingSiegen.Server.Migrations
|
||||
{
|
||||
public partial class Init : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Prospects",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
FsId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
ProgressId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Prospects", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Mail = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
Verified = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Created = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Interactions",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Date = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||
Type = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
ProspectId = table.Column<Guid>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Interactions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Interactions_Prospects_ProspectId",
|
||||
column: x => x.ProspectId,
|
||||
principalTable: "Prospects",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Interactions_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Interactions_ProspectId",
|
||||
table: "Interactions",
|
||||
column: "ProspectId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Interactions_UserId",
|
||||
table: "Interactions",
|
||||
column: "UserId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Interactions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Prospects");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace FoodsharingSiegen.Server.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "6.0.1");
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionDate", b =>
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -28,51 +28,25 @@ namespace FoodsharingSiegen.Server.Migrations
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Date");
|
||||
|
||||
b.Property<Guid>("ProspectId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("ProspectId");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER")
|
||||
.HasColumnName("Type");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ProspectId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("InteractionDates", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("Id");
|
||||
|
||||
b.Property<Guid>("EinAb1Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("EinAb1Id");
|
||||
|
||||
b.Property<Guid>("EinAb2Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("EinAb2Id");
|
||||
|
||||
b.Property<Guid>("EinAb3Id")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("EinAb3Id");
|
||||
|
||||
b.Property<Guid>("PassId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("PassId");
|
||||
|
||||
b.Property<Guid>("VerifyId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("VerifyId");
|
||||
|
||||
b.Property<Guid>("WelcomeId")
|
||||
.HasColumnType("TEXT")
|
||||
.HasColumnName("WelcomeId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("InteractionProcesses", (string)null);
|
||||
b.ToTable("Interactions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
@@ -134,97 +108,33 @@ namespace FoodsharingSiegen.Server.Migrations
|
||||
b.ToTable("Users", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionDate", b =>
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Interaction", b =>
|
||||
{
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("EinAb1")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb1Id")
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", "Prospect")
|
||||
.WithMany("Interactions")
|
||||
.HasForeignKey("ProspectId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("EinAb2")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb2Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id1");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("EinAb3")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "EinAb3Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id2");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("Pass")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "PassId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id3");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("Verify")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "VerifyId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id4");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.InteractionProcess", null)
|
||||
.WithOne("Welcome")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionDate", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "WelcomeId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("FK_InteractionDates_InteractionProcesses_Id5");
|
||||
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.User", "User")
|
||||
.WithMany("InteractionDates")
|
||||
.WithMany("Interactions")
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Prospect");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b =>
|
||||
{
|
||||
b.HasOne("FoodsharingSiegen.Contracts.Entity.Prospect", null)
|
||||
.WithOne("Progress")
|
||||
.HasForeignKey("FoodsharingSiegen.Contracts.Entity.InteractionProcess", "Id")
|
||||
.HasPrincipalKey("FoodsharingSiegen.Contracts.Entity.Prospect", "ProgressId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.InteractionProcess", b =>
|
||||
{
|
||||
b.Navigation("EinAb1");
|
||||
|
||||
b.Navigation("EinAb2");
|
||||
|
||||
b.Navigation("EinAb3");
|
||||
|
||||
b.Navigation("Pass");
|
||||
|
||||
b.Navigation("Verify");
|
||||
|
||||
b.Navigation("Welcome");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.Prospect", b =>
|
||||
{
|
||||
b.Navigation("Progress");
|
||||
b.Navigation("Interactions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FoodsharingSiegen.Contracts.Entity.User", b =>
|
||||
{
|
||||
b.Navigation("InteractionDates");
|
||||
b.Navigation("Interactions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user