332 lines
11 KiB
C#
332 lines
11 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using SquirrelDatabase;
|
|
|
|
#nullable disable
|
|
|
|
namespace SquirrelDatabase.Migrations
|
|
{
|
|
[DbContext(typeof(SquirrelDbContext))]
|
|
partial class SquirrelDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.3")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.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("SquirrelDatabase.Models.Cocktail", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("BaseAlcohol")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("CocktailName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CocktailName")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Cocktails");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.CocktailHistory", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("ChangeDate")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("CocktailId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("OldPrice")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CocktailId");
|
|
|
|
b.ToTable("CocktailHistories");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.Employee", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("BirthDate")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<DateTime?>("DateOfDelete")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("EmploymentDate")
|
|
.HasColumnType("timestamp without 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("SquirrelDatabase.Models.Post", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("ChangeDate")
|
|
.HasColumnType("timestamp without time zone");
|
|
|
|
b.Property<string>("Configuration")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
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.HasKey("Id");
|
|
|
|
b.HasIndex("PostId", "IsActual")
|
|
.IsUnique()
|
|
.HasFilter("\"IsActual\" = TRUE");
|
|
|
|
b.HasIndex("PostName", "IsActual")
|
|
.IsUnique()
|
|
.HasFilter("\"IsActual\" = TRUE");
|
|
|
|
b.ToTable("Posts");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.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 without time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("EmployeeId");
|
|
|
|
b.ToTable("Salaries");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.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 without time zone");
|
|
|
|
b.Property<double>("Sum")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ClientId");
|
|
|
|
b.HasIndex("EmployeeId");
|
|
|
|
b.ToTable("Sales");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.SaleCocktail", b =>
|
|
{
|
|
b.Property<string>("SaleId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("CocktailId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("SaleId", "CocktailId");
|
|
|
|
b.HasIndex("CocktailId");
|
|
|
|
b.ToTable("SaleCocktails");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.CocktailHistory", b =>
|
|
{
|
|
b.HasOne("SquirrelDatabase.Models.Cocktail", "Cocktail")
|
|
.WithMany("CocktailHistories")
|
|
.HasForeignKey("CocktailId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Cocktail");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.Salary", b =>
|
|
{
|
|
b.HasOne("SquirrelDatabase.Models.Employee", "Employee")
|
|
.WithMany("Salaries")
|
|
.HasForeignKey("EmployeeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Employee");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.Sale", b =>
|
|
{
|
|
b.HasOne("SquirrelDatabase.Models.Client", "Client")
|
|
.WithMany("Sales")
|
|
.HasForeignKey("ClientId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("SquirrelDatabase.Models.Employee", "Employee")
|
|
.WithMany("Sales")
|
|
.HasForeignKey("EmployeeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Client");
|
|
|
|
b.Navigation("Employee");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.SaleCocktail", b =>
|
|
{
|
|
b.HasOne("SquirrelDatabase.Models.Cocktail", "Cocktail")
|
|
.WithMany("SaleCocktails")
|
|
.HasForeignKey("CocktailId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("SquirrelDatabase.Models.Sale", "Sale")
|
|
.WithMany("SaleCocktails")
|
|
.HasForeignKey("SaleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Cocktail");
|
|
|
|
b.Navigation("Sale");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.Client", b =>
|
|
{
|
|
b.Navigation("Sales");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.Cocktail", b =>
|
|
{
|
|
b.Navigation("CocktailHistories");
|
|
|
|
b.Navigation("SaleCocktails");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.Employee", b =>
|
|
{
|
|
b.Navigation("Salaries");
|
|
|
|
b.Navigation("Sales");
|
|
});
|
|
|
|
modelBuilder.Entity("SquirrelDatabase.Models.Sale", b =>
|
|
{
|
|
b.Navigation("SaleCocktails");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|