mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add document people.
This commit is contained in:
7555
Cicm.Database/Migrations/20190616232349_AddDocumentPeople.Designer.cs
generated
Normal file
7555
Cicm.Database/Migrations/20190616232349_AddDocumentPeople.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
42
Cicm.Database/Migrations/20190616232349_AddDocumentPeople.cs
Normal file
42
Cicm.Database/Migrations/20190616232349_AddDocumentPeople.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Cicm.Database.Migrations
|
||||
{
|
||||
public partial class AddDocumentPeople : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>("DocumentPersonId", "People", nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable("DocumentPeople",
|
||||
table => new
|
||||
{
|
||||
Id = table.Column<int>()
|
||||
.Annotation("MySql:ValueGenerationStrategy",
|
||||
MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Name = table.Column<string>(),
|
||||
Surname = table.Column<string>(),
|
||||
PersonId = table.Column<int>(nullable: true)
|
||||
}, constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DocumentPeople", x => x.Id);
|
||||
table.ForeignKey("FK_DocumentPeople_People_PersonId", x => x.PersonId,
|
||||
"People", "Id", onDelete: ReferentialAction.SetNull);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex("IX_DocumentPeople_Name", "DocumentPeople", "Name");
|
||||
|
||||
migrationBuilder.CreateIndex("IX_DocumentPeople_PersonId", "DocumentPeople", "PersonId", unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex("IX_DocumentPeople_Surname", "DocumentPeople", "Surname");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable("DocumentPeople");
|
||||
|
||||
migrationBuilder.DropColumn("DocumentPersonId", "People");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,6 +229,27 @@ namespace Cicm.Database.Migrations
|
||||
b.ToTable("Documents");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cicm.Database.Models.DocumentPerson", b =>
|
||||
{
|
||||
b.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name").IsRequired();
|
||||
|
||||
b.Property<int?>("PersonId");
|
||||
|
||||
b.Property<string>("Surname").IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name");
|
||||
|
||||
b.HasIndex("PersonId").IsUnique();
|
||||
|
||||
b.HasIndex("Surname");
|
||||
|
||||
b.ToTable("DocumentPeople");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cicm.Database.Models.DocumentRole", b =>
|
||||
{
|
||||
b.Property<string>("Id").ValueGeneratedOnAdd().HasColumnType("char(3)");
|
||||
@@ -4577,6 +4598,8 @@ namespace Cicm.Database.Migrations
|
||||
|
||||
b.Property<DateTime?>("DeathDate");
|
||||
|
||||
b.Property<int?>("DocumentPersonId");
|
||||
|
||||
b.Property<string>("Facebook");
|
||||
|
||||
b.Property<string>("Name").IsRequired();
|
||||
@@ -5203,6 +5226,14 @@ namespace Cicm.Database.Migrations
|
||||
.HasForeignKey("CountryId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cicm.Database.Models.DocumentPerson",
|
||||
b =>
|
||||
{
|
||||
b.HasOne("Cicm.Database.Models.Person", "Person").WithOne("DocumentPerson")
|
||||
.HasForeignKey("Cicm.Database.Models.DocumentPerson", "PersonId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Cicm.Database.Models.Gpu",
|
||||
b =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user