169 lines
5.8 KiB
C#
169 lines
5.8 KiB
C#
// <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("20240424073031_InitialCreate")]
|
|
partial class InitialCreate
|
|
{
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "6.0.0")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
|
|
|
modelBuilder.Entity("ShipyardDatabaseImplement.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("ShipyardDatabaseImplement.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>("ShipId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<double>("Sum")
|
|
.HasColumnType("float");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ShipId");
|
|
|
|
b.ToTable("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("ShipyardDatabaseImplement.Models.Ship", 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>("ShipName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Ships");
|
|
});
|
|
|
|
modelBuilder.Entity("ShipyardDatabaseImplement.Models.ShipComponent", 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>("ShipId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ComponentId");
|
|
|
|
b.HasIndex("ShipId");
|
|
|
|
b.ToTable("ShipComponents");
|
|
});
|
|
|
|
modelBuilder.Entity("ShipyardDatabaseImplement.Models.Order", b =>
|
|
{
|
|
b.HasOne("ShipyardDatabaseImplement.Models.Ship", null)
|
|
.WithMany("Orders")
|
|
.HasForeignKey("ShipId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("ShipyardDatabaseImplement.Models.ShipComponent", b =>
|
|
{
|
|
b.HasOne("ShipyardDatabaseImplement.Models.Component", "Component")
|
|
.WithMany("ShipComponents")
|
|
.HasForeignKey("ComponentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ShipyardDatabaseImplement.Models.Ship", "Ship")
|
|
.WithMany("Components")
|
|
.HasForeignKey("ShipId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Component");
|
|
|
|
b.Navigation("Ship");
|
|
});
|
|
|
|
modelBuilder.Entity("ShipyardDatabaseImplement.Models.Component", b =>
|
|
{
|
|
b.Navigation("ShipComponents");
|
|
});
|
|
|
|
modelBuilder.Entity("ShipyardDatabaseImplement.Models.Ship", b =>
|
|
{
|
|
b.Navigation("Components");
|
|
|
|
b.Navigation("Orders");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|