172 lines
5.3 KiB
C#
Raw Normal View History

2024-03-24 13:58:43 +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 ShipyardDataBaseImplement;
#nullable disable
namespace ShipyardDataBaseImplement.Migrations
{
[DbContext(typeof(ShipyardDataBase))]
[Migration("20240310181644_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.16")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ShipyardDataBaseImplement.Models.Detail", b =>
2024-04-05 13:29:30 +04:00
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<double>("Cost")
.HasColumnType("float");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<string>("DetailName")
.IsRequired()
.HasColumnType("nvarchar(max)");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasKey("Id");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.ToTable("Details");
});
2024-03-24 13:58:43 +04:00
modelBuilder.Entity("ShipyardDataBaseImplement.Models.Order", b =>
2024-04-05 13:29:30 +04:00
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<int>("Count")
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<DateTime>("DateCreate")
.HasColumnType("datetime2");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<DateTime?>("DateImplement")
.HasColumnType("datetime2");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<int>("ShipId")
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<int>("Status")
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<double>("Sum")
.HasColumnType("float");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasKey("Id");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasIndex("ShipId");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.ToTable("Orders");
});
2024-03-24 13:58:43 +04:00
modelBuilder.Entity("ShipyardDataBaseImplement.Models.Ship", b =>
2024-04-05 13:29:30 +04:00
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<double>("Price")
.HasColumnType("float");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<string>("ShipName")
.IsRequired()
.HasColumnType("nvarchar(max)");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasKey("Id");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.ToTable("Ships");
});
2024-03-24 13:58:43 +04:00
modelBuilder.Entity("ShipyardDataBaseImplement.Models.ShipDetail", b =>
2024-04-05 13:29:30 +04:00
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<int>("Count")
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<int>("DetailId")
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Property<int>("ShipId")
.HasColumnType("int");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasKey("Id");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasIndex("DetailId");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasIndex("ShipId");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.ToTable("ShipDetails");
});
2024-03-24 13:58:43 +04:00
modelBuilder.Entity("ShipyardDataBaseImplement.Models.Order", b =>
2024-04-05 13:29:30 +04:00
{
b.HasOne("ShipyardDataBaseImplement.Models.Ship", "Ship")
.WithMany("Orders")
.HasForeignKey("ShipId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Navigation("Ship");
});
2024-03-24 13:58:43 +04:00
modelBuilder.Entity("ShipyardDataBaseImplement.Models.ShipDetail", b =>
2024-04-05 13:29:30 +04:00
{
b.HasOne("ShipyardDataBaseImplement.Models.Detail", "Detail")
.WithMany("ShipDetails")
.HasForeignKey("DetailId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.HasOne("ShipyardDataBaseImplement.Models.Ship", "Ship")
.WithMany("Details")
.HasForeignKey("ShipId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Navigation("Detail");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Navigation("Ship");
});
2024-03-24 13:58:43 +04:00
modelBuilder.Entity("ShipyardDataBaseImplement.Models.Detail", b =>
2024-04-05 13:29:30 +04:00
{
b.Navigation("ShipDetails");
});
2024-03-24 13:58:43 +04:00
modelBuilder.Entity("ShipyardDataBaseImplement.Models.Ship", b =>
2024-04-05 13:29:30 +04:00
{
b.Navigation("Details");
2024-03-24 13:58:43 +04:00
2024-04-05 13:29:30 +04:00
b.Navigation("Orders");
});
2024-03-24 13:58:43 +04:00
#pragma warning restore 612, 618
}
}
}