Миграция
This commit is contained in:
parent
2e946e150a
commit
8484941fa6
@ -15,8 +15,8 @@ namespace LawCompanyDatabaseImplement
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
//optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-6GNIALH9\SQLEXPRESS;Initial Catalog=LawCompanyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-7DB3VEN\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
optionsBuilder.UseSqlServer(@"Data Source=LAPTOP-6GNIALH9\SQLEXPRESS;Initial Catalog=LawCompanyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
//optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-H8060U3\SQLEXPRESS;Initial Catalog=LawCompanyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
@ -1,543 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using LawCompanyDatabaseImplement;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LawCompanyDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(LawCompanyDatabase))]
|
||||
[Migration("20240526073959_test")]
|
||||
partial class test
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.17")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Case", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("CaseType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateImplement")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Cases");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.CaseClient", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CaseId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CaseId");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("CaseClients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CaseId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("ConsultationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<double>("Cost")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CaseId");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Consultations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.ConsultationLawyer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ConsultationId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("LawyerId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConsultationId");
|
||||
|
||||
b.HasIndex("LawyerId");
|
||||
|
||||
b.ToTable("ConsultationLawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Executors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Guarantors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Hearing", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("HearingDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Judge")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Hearings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.HearingLawyer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("HearingId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("LawyerId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("HearingId");
|
||||
|
||||
b.HasIndex("LawyerId");
|
||||
|
||||
b.ToTable("HearingLawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Lawyer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Visit", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("HearingId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("VisitDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.HasIndex("HearingId");
|
||||
|
||||
b.ToTable("Visits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.VisitClient", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("VisitId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.HasIndex("VisitId");
|
||||
|
||||
b.ToTable("VisitClients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Case", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
.WithMany("Cases")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.CaseClient", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Case", "Case")
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("CaseId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Client", "Client")
|
||||
.WithMany("CaseClients")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Case");
|
||||
|
||||
b.Navigation("Client");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Case", "Case")
|
||||
.WithMany()
|
||||
.HasForeignKey("CaseId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Guarantor", null)
|
||||
.WithMany("Consultations")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Case");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.ConsultationLawyer", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Consultation", "Consultation")
|
||||
.WithMany("Lawyers")
|
||||
.HasForeignKey("ConsultationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Lawyer", "Lawyer")
|
||||
.WithMany("ConsultationLawyers")
|
||||
.HasForeignKey("LawyerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Consultation");
|
||||
|
||||
b.Navigation("Lawyer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Hearing", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Guarantor", null)
|
||||
.WithMany("Hearings")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.HearingLawyer", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Hearing", "Hearing")
|
||||
.WithMany("Lawyers")
|
||||
.HasForeignKey("HearingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Lawyer", "Lawyer")
|
||||
.WithMany("HearingLawyers")
|
||||
.HasForeignKey("LawyerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Hearing");
|
||||
|
||||
b.Navigation("Lawyer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Lawyer", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Guarantor", null)
|
||||
.WithMany("Lawyers")
|
||||
.HasForeignKey("GuarantorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Visit", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
.WithMany("Visits")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Hearing", "Hearing")
|
||||
.WithMany()
|
||||
.HasForeignKey("HearingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Hearing");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.VisitClient", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Client", "Client")
|
||||
.WithMany("ClientVisits")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Visit", "Visit")
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("VisitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Client");
|
||||
|
||||
b.Navigation("Visit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Case", b =>
|
||||
{
|
||||
b.Navigation("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.Navigation("CaseClients");
|
||||
|
||||
b.Navigation("ClientVisits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
||||
{
|
||||
b.Navigation("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Navigation("Cases");
|
||||
|
||||
b.Navigation("Clients");
|
||||
|
||||
b.Navigation("Visits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Navigation("Consultations");
|
||||
|
||||
b.Navigation("Hearings");
|
||||
|
||||
b.Navigation("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Hearing", b =>
|
||||
{
|
||||
b.Navigation("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Lawyer", b =>
|
||||
{
|
||||
b.Navigation("ConsultationLawyers");
|
||||
|
||||
b.Navigation("HearingLawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Visit", b =>
|
||||
{
|
||||
b.Navigation("Clients");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -1,412 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LawCompanyDatabaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class test : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Executors",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Executors", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Guarantors",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Guarantors", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cases",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
CaseType = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DateImplement = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
ExecutorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Cases", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Cases_Executors_ExecutorId",
|
||||
column: x => x.ExecutorId,
|
||||
principalTable: "Executors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Clients",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ExecutorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Clients", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Clients_Executors_ExecutorId",
|
||||
column: x => x.ExecutorId,
|
||||
principalTable: "Executors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Hearings",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
HearingDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Judge = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
GuarantorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Hearings", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Hearings_Guarantors_GuarantorId",
|
||||
column: x => x.GuarantorId,
|
||||
principalTable: "Guarantors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Lawyers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FIO = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
GuarantorId = table.Column<int>(type: "int", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Lawyers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Lawyers_Guarantors_GuarantorId",
|
||||
column: x => x.GuarantorId,
|
||||
principalTable: "Guarantors",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Consultations",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Cost = table.Column<double>(type: "float", nullable: false),
|
||||
ConsultationDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CaseId = table.Column<int>(type: "int", nullable: false),
|
||||
GuarantorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Consultations", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Consultations_Cases_CaseId",
|
||||
column: x => x.CaseId,
|
||||
principalTable: "Cases",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Consultations_Guarantors_GuarantorId",
|
||||
column: x => x.GuarantorId,
|
||||
principalTable: "Guarantors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CaseClients",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CaseId = table.Column<int>(type: "int", nullable: false),
|
||||
ClientId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CaseClients", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CaseClients_Cases_CaseId",
|
||||
column: x => x.CaseId,
|
||||
principalTable: "Cases",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_CaseClients_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Visits",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
VisitDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
HearingId = table.Column<int>(type: "int", nullable: false),
|
||||
ExecutorId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Visits", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Visits_Executors_ExecutorId",
|
||||
column: x => x.ExecutorId,
|
||||
principalTable: "Executors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_Visits_Hearings_HearingId",
|
||||
column: x => x.HearingId,
|
||||
principalTable: "Hearings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "HearingLawyers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
HearingId = table.Column<int>(type: "int", nullable: false),
|
||||
LawyerId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_HearingLawyers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_HearingLawyers_Hearings_HearingId",
|
||||
column: x => x.HearingId,
|
||||
principalTable: "Hearings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_HearingLawyers_Lawyers_LawyerId",
|
||||
column: x => x.LawyerId,
|
||||
principalTable: "Lawyers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ConsultationLawyers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ConsultationId = table.Column<int>(type: "int", nullable: false),
|
||||
LawyerId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ConsultationLawyers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConsultationLawyers_Consultations_ConsultationId",
|
||||
column: x => x.ConsultationId,
|
||||
principalTable: "Consultations",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_ConsultationLawyers_Lawyers_LawyerId",
|
||||
column: x => x.LawyerId,
|
||||
principalTable: "Lawyers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "VisitClients",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||
VisitId = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_VisitClients", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_VisitClients_Clients_ClientId",
|
||||
column: x => x.ClientId,
|
||||
principalTable: "Clients",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_VisitClients_Visits_VisitId",
|
||||
column: x => x.VisitId,
|
||||
principalTable: "Visits",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CaseClients_CaseId",
|
||||
table: "CaseClients",
|
||||
column: "CaseId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CaseClients_ClientId",
|
||||
table: "CaseClients",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Cases_ExecutorId",
|
||||
table: "Cases",
|
||||
column: "ExecutorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Clients_ExecutorId",
|
||||
table: "Clients",
|
||||
column: "ExecutorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConsultationLawyers_ConsultationId",
|
||||
table: "ConsultationLawyers",
|
||||
column: "ConsultationId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ConsultationLawyers_LawyerId",
|
||||
table: "ConsultationLawyers",
|
||||
column: "LawyerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Consultations_CaseId",
|
||||
table: "Consultations",
|
||||
column: "CaseId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Consultations_GuarantorId",
|
||||
table: "Consultations",
|
||||
column: "GuarantorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_HearingLawyers_HearingId",
|
||||
table: "HearingLawyers",
|
||||
column: "HearingId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_HearingLawyers_LawyerId",
|
||||
table: "HearingLawyers",
|
||||
column: "LawyerId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Hearings_GuarantorId",
|
||||
table: "Hearings",
|
||||
column: "GuarantorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Lawyers_GuarantorId",
|
||||
table: "Lawyers",
|
||||
column: "GuarantorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_VisitClients_ClientId",
|
||||
table: "VisitClients",
|
||||
column: "ClientId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_VisitClients_VisitId",
|
||||
table: "VisitClients",
|
||||
column: "VisitId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Visits_ExecutorId",
|
||||
table: "Visits",
|
||||
column: "ExecutorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Visits_HearingId",
|
||||
table: "Visits",
|
||||
column: "HearingId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CaseClients");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ConsultationLawyers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "HearingLawyers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "VisitClients");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Consultations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Lawyers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Clients");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Visits");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cases");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Hearings");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Executors");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Guarantors");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,541 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using LawCompanyDatabaseImplement;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LawCompanyDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(LawCompanyDatabase))]
|
||||
[Migration("20240526100556_test1")]
|
||||
partial class test1
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.17")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Case", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("CaseType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("DateCreate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateImplement")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Cases");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.CaseClient", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CaseId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CaseId");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.ToTable("CaseClients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.ToTable("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("CaseId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("ConsultationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<double>("Cost")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CaseId");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Consultations");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.ConsultationLawyer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ConsultationId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("LawyerId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ConsultationId");
|
||||
|
||||
b.HasIndex("LawyerId");
|
||||
|
||||
b.ToTable("ConsultationLawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Executors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Guarantors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Hearing", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("HearingDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Judge")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Hearings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.HearingLawyer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("HearingId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("LawyerId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("HearingId");
|
||||
|
||||
b.HasIndex("LawyerId");
|
||||
|
||||
b.ToTable("HearingLawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Lawyer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FIO")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int?>("GuarantorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Phone")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuarantorId");
|
||||
|
||||
b.ToTable("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Visit", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ExecutorId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int?>("HearingId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("VisitDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExecutorId");
|
||||
|
||||
b.HasIndex("HearingId");
|
||||
|
||||
b.ToTable("Visits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.VisitClient", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("ClientId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("VisitId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.HasIndex("VisitId");
|
||||
|
||||
b.ToTable("VisitClients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Case", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
.WithMany("Cases")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.CaseClient", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Case", "Case")
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("CaseId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Client", "Client")
|
||||
.WithMany("CaseClients")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Case");
|
||||
|
||||
b.Navigation("Client");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Case", "Case")
|
||||
.WithMany()
|
||||
.HasForeignKey("CaseId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Guarantor", null)
|
||||
.WithMany("Consultations")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Case");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.ConsultationLawyer", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Consultation", "Consultation")
|
||||
.WithMany("Lawyers")
|
||||
.HasForeignKey("ConsultationId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Lawyer", "Lawyer")
|
||||
.WithMany("ConsultationLawyers")
|
||||
.HasForeignKey("LawyerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Consultation");
|
||||
|
||||
b.Navigation("Lawyer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Hearing", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Guarantor", null)
|
||||
.WithMany("Hearings")
|
||||
.HasForeignKey("GuarantorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.HearingLawyer", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Hearing", "Hearing")
|
||||
.WithMany("Lawyers")
|
||||
.HasForeignKey("HearingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Lawyer", "Lawyer")
|
||||
.WithMany("HearingLawyers")
|
||||
.HasForeignKey("LawyerId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Hearing");
|
||||
|
||||
b.Navigation("Lawyer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Lawyer", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Guarantor", null)
|
||||
.WithMany("Lawyers")
|
||||
.HasForeignKey("GuarantorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Visit", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
.WithMany("Visits")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Hearing", "Hearing")
|
||||
.WithMany()
|
||||
.HasForeignKey("HearingId");
|
||||
|
||||
b.Navigation("Hearing");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.VisitClient", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Client", "Client")
|
||||
.WithMany("ClientVisits")
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Visit", "Visit")
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("VisitId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Client");
|
||||
|
||||
b.Navigation("Visit");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Case", b =>
|
||||
{
|
||||
b.Navigation("Clients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.Navigation("CaseClients");
|
||||
|
||||
b.Navigation("ClientVisits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
||||
{
|
||||
b.Navigation("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Executor", b =>
|
||||
{
|
||||
b.Navigation("Cases");
|
||||
|
||||
b.Navigation("Clients");
|
||||
|
||||
b.Navigation("Visits");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Guarantor", b =>
|
||||
{
|
||||
b.Navigation("Consultations");
|
||||
|
||||
b.Navigation("Hearings");
|
||||
|
||||
b.Navigation("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Hearing", b =>
|
||||
{
|
||||
b.Navigation("Lawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Lawyer", b =>
|
||||
{
|
||||
b.Navigation("ConsultationLawyers");
|
||||
|
||||
b.Navigation("HearingLawyers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Visit", b =>
|
||||
{
|
||||
b.Navigation("Clients");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace LawCompanyDatabaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class test3 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CaseType",
|
||||
table: "Cases");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CaseType",
|
||||
table: "Cases",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
}
|
||||
}
|
@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace LawCompanyDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(LawCompanyDatabase))]
|
||||
[Migration("20240526114610_test3")]
|
||||
partial class test3
|
||||
[Migration("20240526230637_InitialCreate3")]
|
||||
partial class InitialCreate3
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -368,11 +368,13 @@ namespace LawCompanyDatabaseImplement.Migrations
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
@ -5,7 +5,7 @@
|
||||
namespace LawCompanyDatabaseImplement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class test1 : Migration
|
||||
public partial class InitialCreate3 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
@ -14,6 +14,10 @@ namespace LawCompanyDatabaseImplement.Migrations
|
||||
name: "FK_Visits_Hearings_HearingId",
|
||||
table: "Visits");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CaseType",
|
||||
table: "Cases");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "HearingId",
|
||||
table: "Visits",
|
||||
@ -47,6 +51,13 @@ namespace LawCompanyDatabaseImplement.Migrations
|
||||
oldType: "int",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CaseType",
|
||||
table: "Cases",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Visits_Hearings_HearingId",
|
||||
table: "Visits",
|
@ -365,11 +365,13 @@ namespace LawCompanyDatabaseImplement.Migrations
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Client", b =>
|
||||
{
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", null)
|
||||
b.HasOne("LawCompanyDatabaseImplement.Models.Executor", "Executor")
|
||||
.WithMany("Clients")
|
||||
.HasForeignKey("ExecutorId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Executor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("LawCompanyDatabaseImplement.Models.Consultation", b =>
|
||||
|
Loading…
Reference in New Issue
Block a user