//
using System;
using EmployeeManagmentDataBaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace EmployeeManagmentDataBaseImplement.Migrations
{
[DbContext(typeof(EmployeeManagementDbContext))]
[Migration("20241126175607_Init")]
partial class Init
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.Employee", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Bid")
.HasColumnType("real");
b.Property("EndJob")
.HasColumnType("timestamp with time zone");
b.Property("NameJob")
.IsRequired()
.HasColumnType("text");
b.Property("PartTimeJob")
.HasColumnType("text");
b.Property("PhisicalPersonsId")
.HasColumnType("integer");
b.Property("StartJob")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("PhisicalPersonsId");
b.ToTable("Employees");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.PhisicalPerson", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("Address")
.IsRequired()
.HasColumnType("text");
b.Property("Birthday")
.HasColumnType("timestamp with time zone");
b.Property("Gender")
.IsRequired()
.HasColumnType("text");
b.Property("Name")
.IsRequired()
.HasColumnType("text");
b.Property("Patronymic")
.HasColumnType("text");
b.Property("Surname")
.IsRequired()
.HasColumnType("text");
b.Property("Telephone")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("PhysicalPersons");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.Salary", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("CountHours")
.HasColumnType("integer");
b.Property("Data")
.HasColumnType("timestamp with time zone");
b.Property("EmployeesId")
.HasColumnType("integer");
b.Property("Passed")
.HasColumnType("boolean");
b.Property("Premium")
.HasColumnType("real");
b.Property("PriceHour")
.HasColumnType("real");
b.HasKey("Id");
b.HasIndex("EmployeesId");
b.ToTable("Salaries");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.Vacation", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
b.Property("EmployeesId")
.HasColumnType("integer");
b.Property("EndData")
.HasColumnType("timestamp with time zone");
b.Property("Passed")
.HasColumnType("boolean");
b.Property("StartData")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("EmployeesId");
b.ToTable("Vacations");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.Employee", b =>
{
b.HasOne("EmployeeManagmentDataBaseImplement.Models.PhisicalPerson", "PhisicalPerson")
.WithMany("Employees")
.HasForeignKey("PhisicalPersonsId");
b.Navigation("PhisicalPerson");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.Salary", b =>
{
b.HasOne("EmployeeManagmentDataBaseImplement.Models.Employee", "Employee")
.WithMany("Salaries")
.HasForeignKey("EmployeesId");
b.Navigation("Employee");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.Vacation", b =>
{
b.HasOne("EmployeeManagmentDataBaseImplement.Models.Employee", "Employee")
.WithMany("Vacations")
.HasForeignKey("EmployeesId");
b.Navigation("Employee");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.Employee", b =>
{
b.Navigation("Salaries");
b.Navigation("Vacations");
});
modelBuilder.Entity("EmployeeManagmentDataBaseImplement.Models.PhisicalPerson", b =>
{
b.Navigation("Employees");
});
#pragma warning restore 612, 618
}
}
}