PIbd-22_Bondarenko_M.S_SUBD/PersonnelDepartmentView/PersonnelDepartmentDatabaseImplement/Migrations/PersonnelDepartmentDatabaseModelSnapshot.cs

181 lines
6.2 KiB
C#
Raw Normal View History

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using PersonnelDepartmentDatabaseImplement;
#nullable disable
namespace PersonnelDepartmentDatabaseImplement.Migrations
{
[DbContext(typeof(PersonnelDepartmentDatabase))]
partial class PersonnelDepartmentDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("PersonnelDepartmentDatabaseImplement.Models.Deal", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("DateFrom")
.HasColumnType("timestamp with time zone");
b.Property<DateTime>("DateTo")
.HasColumnType("timestamp with time zone");
b.Property<int>("DepartmentId")
.HasColumnType("integer");
b.Property<int>("EmployeeId")
.HasColumnType("integer");
b.Property<int>("PositionId")
.HasColumnType("integer");
b.Property<int>("TypeId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("DepartmentId");
b.HasIndex("EmployeeId");
b.HasIndex("PositionId");
b.HasIndex("TypeId");
b.ToTable("Deals");
});
modelBuilder.Entity("PersonnelDepartmentDatabaseImplement.Models.Department", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<long>("Telephone")
.HasColumnType("bigint");
b.HasKey("Id");
b.ToTable("Departments");
});
modelBuilder.Entity("PersonnelDepartmentDatabaseImplement.Models.Employee", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("FirstName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Patronymic")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Employees");
});
modelBuilder.Entity("PersonnelDepartmentDatabaseImplement.Models.Position", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Positions");
});
modelBuilder.Entity("PersonnelDepartmentDatabaseImplement.Models.Type", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Types");
});
modelBuilder.Entity("PersonnelDepartmentDatabaseImplement.Models.Deal", b =>
{
b.HasOne("PersonnelDepartmentDatabaseImplement.Models.Department", "Department")
.WithMany()
.HasForeignKey("DepartmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PersonnelDepartmentDatabaseImplement.Models.Employee", "Employee")
.WithMany()
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PersonnelDepartmentDatabaseImplement.Models.Position", "Position")
.WithMany()
.HasForeignKey("PositionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PersonnelDepartmentDatabaseImplement.Models.Type", "Type")
.WithMany()
.HasForeignKey("TypeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Department");
b.Navigation("Employee");
b.Navigation("Position");
b.Navigation("Type");
});
#pragma warning restore 612, 618
}
}
}