2024-03-23 21:01:40 +04:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
using PlumbingRepairDatabaseImplement;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace PlumbingRepairDatabaseImplement.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(PlumbingRepairDatabase))]
|
2024-04-19 18:36:30 +04:00
|
|
|
|
[Migration("20240410163831_InitialCreate")]
|
2024-03-23 21:01:40 +04:00
|
|
|
|
partial class InitialCreate
|
|
|
|
|
{
|
|
|
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
|
|
|
|
.HasAnnotation("ProductVersion", "6.0.27")
|
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
|
|
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Component", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ComponentName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Cost")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Components");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Order", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime?>("DateImplement")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Status")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Sum")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("WorkId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("WorkId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Orders");
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-19 18:36:30 +04:00
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Shop", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Address")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DateOpening")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ShopName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("maxCountWorks")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Shops");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.ShopWork", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ShopId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("WorkId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ShopId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("WorkId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("ShopWorks");
|
|
|
|
|
});
|
|
|
|
|
|
2024-03-23 21:01:40 +04:00
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Work", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Price")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("WorkName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Works");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.WorkComponent", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ComponentId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("WorkId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ComponentId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("WorkId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("WorkComponents");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Order", b =>
|
|
|
|
|
{
|
2024-04-19 18:36:30 +04:00
|
|
|
|
b.HasOne("PlumbingRepairDatabaseImplement.Models.Work", "Work")
|
|
|
|
|
.WithMany("Orders")
|
|
|
|
|
.HasForeignKey("WorkId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Work");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.ShopWork", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("PlumbingRepairDatabaseImplement.Models.Shop", "Shop")
|
|
|
|
|
.WithMany("Works")
|
|
|
|
|
.HasForeignKey("ShopId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2024-03-23 21:01:40 +04:00
|
|
|
|
b.HasOne("PlumbingRepairDatabaseImplement.Models.Work", "Work")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("WorkId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2024-04-19 18:36:30 +04:00
|
|
|
|
b.Navigation("Shop");
|
|
|
|
|
|
2024-03-23 21:01:40 +04:00
|
|
|
|
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");
|
|
|
|
|
});
|
|
|
|
|
|
2024-04-19 18:36:30 +04:00
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Shop", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Works");
|
|
|
|
|
});
|
|
|
|
|
|
2024-03-23 21:01:40 +04:00
|
|
|
|
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Work", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Components");
|
2024-04-19 18:36:30 +04:00
|
|
|
|
|
|
|
|
|
b.Navigation("Orders");
|
2024-03-23 21:01:40 +04:00
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|