387 lines
13 KiB
C#
387 lines
13 KiB
C#
|
// <auto-generated />
|
|||
|
using System;
|
|||
|
using CarServiceDatabase;
|
|||
|
using Microsoft.EntityFrameworkCore;
|
|||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|||
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace CarServiceDatabase.Migrations
|
|||
|
{
|
|||
|
[DbContext(typeof(CarServiceDbContext))]
|
|||
|
[Migration("20230402115927_InitMigration")]
|
|||
|
partial class InitMigration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|||
|
{
|
|||
|
#pragma warning disable 612, 618
|
|||
|
modelBuilder
|
|||
|
.HasAnnotation("ProductVersion", "7.0.4")
|
|||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|||
|
|
|||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Customer", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<string>("Login")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("Password")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("Surname")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.ToTable("Customers");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Item", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<int>("Count")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<decimal>("Price")
|
|||
|
.HasColumnType("decimal (10,2)");
|
|||
|
|
|||
|
b.Property<int>("WorkerId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.HasIndex("WorkerId");
|
|||
|
|
|||
|
b.ToTable("Items");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.ItemForRepair", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<int>("Count")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.Property<int>("ItemId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.Property<int>("RepairRequestId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.HasIndex("ItemId");
|
|||
|
|
|||
|
b.HasIndex("RepairRequestId");
|
|||
|
|
|||
|
b.ToTable("ItemsForRepair");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.RepairRequest", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<DateTime>("DateCreated")
|
|||
|
.HasColumnType("datetime2");
|
|||
|
|
|||
|
b.Property<int>("VehicleId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.HasIndex("VehicleId");
|
|||
|
|
|||
|
b.ToTable("RepairRequests");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Vehicle", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<int>("CustomerId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("Plate")
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("VIN")
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.HasIndex("CustomerId");
|
|||
|
|
|||
|
b.ToTable("Vehicles");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Work", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<decimal>("Duration")
|
|||
|
.HasColumnType("decimal (3,1)");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<decimal>("Price")
|
|||
|
.HasColumnType("decimal (10,2)");
|
|||
|
|
|||
|
b.Property<int>("WorkerId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.HasIndex("WorkerId");
|
|||
|
|
|||
|
b.ToTable("Works");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.WorkInRequest", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<decimal>("Cost")
|
|||
|
.HasColumnType("decimal (10,2)");
|
|||
|
|
|||
|
b.Property<int>("Count")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.Property<int>("RepairRequestId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.Property<int>("WorkId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.HasIndex("RepairRequestId");
|
|||
|
|
|||
|
b.HasIndex("WorkId");
|
|||
|
|
|||
|
b.ToTable("WorksInRequest");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.WorkPayment", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<DateTime>("DatePayment")
|
|||
|
.HasColumnType("datetime2");
|
|||
|
|
|||
|
b.Property<decimal>("Sum")
|
|||
|
.HasColumnType("decimal (10,2)");
|
|||
|
|
|||
|
b.Property<int>("WorkInRequestId")
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.HasIndex("WorkInRequestId");
|
|||
|
|
|||
|
b.ToTable("WorkPayments");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Worker", b =>
|
|||
|
{
|
|||
|
b.Property<int>("Id")
|
|||
|
.ValueGeneratedOnAdd()
|
|||
|
.HasColumnType("int");
|
|||
|
|
|||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|||
|
|
|||
|
b.Property<string>("Login")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("Name")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("Password")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.Property<string>("Surname")
|
|||
|
.IsRequired()
|
|||
|
.HasColumnType("nvarchar(max)");
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.ToTable("Workers");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Item", b =>
|
|||
|
{
|
|||
|
b.HasOne("CarServiceDatabase.Models.Worker", null)
|
|||
|
.WithMany("Items")
|
|||
|
.HasForeignKey("WorkerId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.ItemForRepair", b =>
|
|||
|
{
|
|||
|
b.HasOne("CarServiceDatabase.Models.Item", null)
|
|||
|
.WithMany("ItemsForRepair")
|
|||
|
.HasForeignKey("ItemId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
|
|||
|
b.HasOne("CarServiceDatabase.Models.RepairRequest", null)
|
|||
|
.WithMany("ItemsForRepair")
|
|||
|
.HasForeignKey("RepairRequestId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.RepairRequest", b =>
|
|||
|
{
|
|||
|
b.HasOne("CarServiceDatabase.Models.Vehicle", null)
|
|||
|
.WithMany("RepairRequests")
|
|||
|
.HasForeignKey("VehicleId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Vehicle", b =>
|
|||
|
{
|
|||
|
b.HasOne("CarServiceDatabase.Models.Customer", null)
|
|||
|
.WithMany("Vehicles")
|
|||
|
.HasForeignKey("CustomerId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Work", b =>
|
|||
|
{
|
|||
|
b.HasOne("CarServiceDatabase.Models.Worker", null)
|
|||
|
.WithMany("Works")
|
|||
|
.HasForeignKey("WorkerId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.WorkInRequest", b =>
|
|||
|
{
|
|||
|
b.HasOne("CarServiceDatabase.Models.RepairRequest", null)
|
|||
|
.WithMany("WorksInRequest")
|
|||
|
.HasForeignKey("RepairRequestId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
|
|||
|
b.HasOne("CarServiceDatabase.Models.Work", null)
|
|||
|
.WithMany("WorksInRequest")
|
|||
|
.HasForeignKey("WorkId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.WorkPayment", b =>
|
|||
|
{
|
|||
|
b.HasOne("CarServiceDatabase.Models.WorkInRequest", null)
|
|||
|
.WithMany("WorkPayments")
|
|||
|
.HasForeignKey("WorkInRequestId")
|
|||
|
.OnDelete(DeleteBehavior.Cascade)
|
|||
|
.IsRequired();
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Customer", b =>
|
|||
|
{
|
|||
|
b.Navigation("Vehicles");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Item", b =>
|
|||
|
{
|
|||
|
b.Navigation("ItemsForRepair");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.RepairRequest", b =>
|
|||
|
{
|
|||
|
b.Navigation("ItemsForRepair");
|
|||
|
|
|||
|
b.Navigation("WorksInRequest");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Vehicle", b =>
|
|||
|
{
|
|||
|
b.Navigation("RepairRequests");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Work", b =>
|
|||
|
{
|
|||
|
b.Navigation("WorksInRequest");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.WorkInRequest", b =>
|
|||
|
{
|
|||
|
b.Navigation("WorkPayments");
|
|||
|
});
|
|||
|
|
|||
|
modelBuilder.Entity("CarServiceDatabase.Models.Worker", b =>
|
|||
|
{
|
|||
|
b.Navigation("Items");
|
|||
|
|
|||
|
b.Navigation("Works");
|
|||
|
});
|
|||
|
#pragma warning restore 612, 618
|
|||
|
}
|
|||
|
}
|
|||
|
}
|