253 lines
8.7 KiB
C#
253 lines
8.7 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using PlumbingRepairDataBaseImplement;
|
|
|
|
#nullable disable
|
|
|
|
namespace PlumbingRepairDataBaseImplement.Migrations
|
|
{
|
|
[DbContext(typeof(PlumbingRepairDataBase))]
|
|
[Migration("20240506071751_InitialCreate")]
|
|
partial class InitialCreate
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.17")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Component", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ComponentName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("Cost")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Components");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Order", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime?>("DateImplement")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<double>("Sum")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<int>("WorkId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("WorkName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("WorkId");
|
|
|
|
b.ToTable("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Store", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("OpeningDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("StoreAdress")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("StoreName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("WorkMaxCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Stores");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.StoreWork", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("StoreId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("WorkId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("StoreId");
|
|
|
|
b.HasIndex("WorkId");
|
|
|
|
b.ToTable("StoreWorks");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Work", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<string>("WorkName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Works");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.WorkComponent", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("ComponentId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Count")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("WorkId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ComponentId");
|
|
|
|
b.HasIndex("WorkId");
|
|
|
|
b.ToTable("WorkComponents");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Order", b =>
|
|
{
|
|
b.HasOne("PlumbingRepairDataBaseImplement.Models.Work", "Work")
|
|
.WithMany("Orders")
|
|
.HasForeignKey("WorkId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Work");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.StoreWork", b =>
|
|
{
|
|
b.HasOne("PlumbingRepairDataBaseImplement.Models.Store", "Store")
|
|
.WithMany("Works")
|
|
.HasForeignKey("StoreId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PlumbingRepairDataBaseImplement.Models.Work", "Work")
|
|
.WithMany()
|
|
.HasForeignKey("WorkId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Store");
|
|
|
|
b.Navigation("Work");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.WorkComponent", b =>
|
|
{
|
|
b.HasOne("PlumbingRepairDataBaseImplement.Models.Component", "Component")
|
|
.WithMany("WorkComponents")
|
|
.HasForeignKey("ComponentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("PlumbingRepairDataBaseImplement.Models.Work", "Work")
|
|
.WithMany("Components")
|
|
.HasForeignKey("WorkId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Component");
|
|
|
|
b.Navigation("Work");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Component", b =>
|
|
{
|
|
b.Navigation("WorkComponents");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Store", b =>
|
|
{
|
|
b.Navigation("Works");
|
|
});
|
|
|
|
modelBuilder.Entity("PlumbingRepairDataBaseImplement.Models.Work", b =>
|
|
{
|
|
b.Navigation("Components");
|
|
|
|
b.Navigation("Orders");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|