169 lines
5.7 KiB
C#
169 lines
5.7 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using FlowerShopDatabaseImplement;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace FlowerShopDatabaseImplement.Migrations
|
|
{
|
|
[DbContext(typeof(FlowerShopDataBase))]
|
|
[Migration("20240312171524_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("FlowerShopDatabaseImplement.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("FlowerShopDatabaseImplement.Models.Flower", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
|
|
|
b.Property<string>("FlowerName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("float");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Flowers");
|
|
});
|
|
|
|
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.FlowerComponent", 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>("FlowerId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ComponentId");
|
|
|
|
b.HasIndex("FlowerId");
|
|
|
|
b.ToTable("FlowerComponents");
|
|
});
|
|
|
|
modelBuilder.Entity("FlowerShopDatabaseImplement.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>("FlowerId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<double>("Sum")
|
|
.HasColumnType("float");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("FlowerId");
|
|
|
|
b.ToTable("Orders");
|
|
});
|
|
|
|
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.FlowerComponent", b =>
|
|
{
|
|
b.HasOne("FlowerShopDatabaseImplement.Models.Component", "Component")
|
|
.WithMany("FlowerComponents")
|
|
.HasForeignKey("ComponentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("FlowerShopDatabaseImplement.Models.Flower", "Flower")
|
|
.WithMany("Components")
|
|
.HasForeignKey("FlowerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Component");
|
|
|
|
b.Navigation("Flower");
|
|
});
|
|
|
|
modelBuilder.Entity("FlowerShopDatabaseImplement.Order", b =>
|
|
{
|
|
b.HasOne("FlowerShopDatabaseImplement.Models.Flower", null)
|
|
.WithMany("Orders")
|
|
.HasForeignKey("FlowerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Component", b =>
|
|
{
|
|
b.Navigation("FlowerComponents");
|
|
});
|
|
|
|
modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Flower", b =>
|
|
{
|
|
b.Navigation("Components");
|
|
|
|
b.Navigation("Orders");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|