PIbd-21_RazubaevSM_Plumbing.../PlumbingRepair/PlumbingRepairDatabaseImplement/Migrations/20240405092648_InitialCreate.Designer.cs

214 lines
7.2 KiB
C#
Raw Normal View History

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-12 19:30:31 +04:00
[Migration("20240405092648_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);
2024-04-12 19:30:31 +04:00
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
2024-03-23 21:01:40 +04:00
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);
2024-04-12 19:30:31 +04:00
b.Property<int>("ClientId")
.HasColumnType("int");
2024-03-23 21:01:40 +04:00
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");
2024-04-12 19:30:31 +04:00
b.HasIndex("ClientId");
2024-03-23 21:01:40 +04:00
b.HasIndex("WorkId");
b.ToTable("Orders");
});
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-12 19:30:31 +04:00
b.HasOne("PlumbingRepairDatabaseImplement.Models.Client", "Client")
.WithMany("Orders")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
2024-03-23 21:01:40 +04:00
b.HasOne("PlumbingRepairDatabaseImplement.Models.Work", "Work")
2024-04-12 19:30:31 +04:00
.WithMany("Orders")
2024-03-23 21:01:40 +04:00
.HasForeignKey("WorkId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
2024-04-12 19:30:31 +04:00
b.Navigation("Client");
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");
});
2024-04-12 19:30:31 +04:00
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Client", b =>
{
b.Navigation("Orders");
});
2024-03-23 21:01:40 +04:00
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Component", b =>
{
b.Navigation("WorkComponents");
});
modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Work", b =>
{
b.Navigation("Components");
2024-04-12 19:30:31 +04:00
b.Navigation("Orders");
2024-03-23 21:01:40 +04:00
});
#pragma warning restore 612, 618
}
}
}