forked from slavaxom9k/PIBD-23_Fomichev_V.S._MagicCarpet
334 lines
11 KiB
C#
334 lines
11 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using MagicCarpetDatabase;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace MagicCarpetDatabase.Migrations
|
|
{
|
|
[DbContext(typeof(MagicCarpetDbContext))]
|
|
[Migration("20250408110058_FirstMigration")]
|
|
partial class FirstMigration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.3")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Client", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("DiscountSize")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<string>("FIO")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PhoneNumber")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Clients");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Employee", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("BirthDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("EmploymentDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("FIO")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("PostId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Employees");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Post", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("ChangeDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("IsActual")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("PostId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PostName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("PostType")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<double>("Salary")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PostId", "IsActual")
|
|
.IsUnique()
|
|
.HasFilter("\"IsActual\" = TRUE");
|
|
|
|
b.HasIndex("PostName", "IsActual")
|
|
.IsUnique()
|
|
.HasFilter("\"IsActual\" = TRUE");
|
|
|
|
b.ToTable("Posts");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Salary", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("EmployeeId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("EmployeeSalary")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<DateTime>("SalaryDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("EmployeeId");
|
|
|
|
b.ToTable("Salaries");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Sale", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ClientId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("Discount")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<int>("DiscountType")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("EmployeeId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsCancel")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateTime>("SaleDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<double>("Sum")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ClientId");
|
|
|
|
b.HasIndex("EmployeeId");
|
|
|
|
b.ToTable("Sales");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.SaleTour", b =>
|
|
{
|
|
b.Property<string>("SaleId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("TourId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("SaleId", "TourId");
|
|
|
|
b.HasIndex("TourId");
|
|
|
|
b.ToTable("SaleTours");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Tour", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<string>("TourCountry")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("TourName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("TourType")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TourName")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Tours");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.TourHistory", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("ChangeDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<double>("OldPrice")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<string>("TourId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TourId");
|
|
|
|
b.ToTable("TourHistories");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Salary", b =>
|
|
{
|
|
b.HasOne("MagicCarpetDatabase.Models.Employee", "Employee")
|
|
.WithMany("Salaries")
|
|
.HasForeignKey("EmployeeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Employee");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Sale", b =>
|
|
{
|
|
b.HasOne("MagicCarpetDatabase.Models.Client", "Client")
|
|
.WithMany("Sales")
|
|
.HasForeignKey("ClientId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("MagicCarpetDatabase.Models.Employee", "Employee")
|
|
.WithMany("Sales")
|
|
.HasForeignKey("EmployeeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Client");
|
|
|
|
b.Navigation("Employee");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.SaleTour", b =>
|
|
{
|
|
b.HasOne("MagicCarpetDatabase.Models.Sale", "Sale")
|
|
.WithMany("SaleTours")
|
|
.HasForeignKey("SaleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("MagicCarpetDatabase.Models.Tour", "Tour")
|
|
.WithMany("SaleTours")
|
|
.HasForeignKey("TourId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Sale");
|
|
|
|
b.Navigation("Tour");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.TourHistory", b =>
|
|
{
|
|
b.HasOne("MagicCarpetDatabase.Models.Tour", "Tour")
|
|
.WithMany("TourHistories")
|
|
.HasForeignKey("TourId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Tour");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Client", b =>
|
|
{
|
|
b.Navigation("Sales");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Employee", b =>
|
|
{
|
|
b.Navigation("Salaries");
|
|
|
|
b.Navigation("Sales");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Sale", b =>
|
|
{
|
|
b.Navigation("SaleTours");
|
|
});
|
|
|
|
modelBuilder.Entity("MagicCarpetDatabase.Models.Tour", b =>
|
|
{
|
|
b.Navigation("SaleTours");
|
|
|
|
b.Navigation("TourHistories");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|