// using System; using FurnitureAssemblyDatabaseImplement; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace FurnitureAssemblyDatabaseImplement.Migrations { [DbContext(typeof(FurnitureAssemblyDatabase))] [Migration("20240401175259_init")] partial class init { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.7") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Furniture", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("FurnitureName") .IsRequired() .HasColumnType("text"); b.Property("Price") .HasColumnType("double precision"); b.HasKey("Id"); b.ToTable("Furnitures"); }); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.FurnitureWorkpiece", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Count") .HasColumnType("integer"); b.Property("FurnitureId") .HasColumnType("integer"); b.Property("WorkpieceId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("FurnitureId"); b.HasIndex("WorkpieceId"); b.ToTable("FurnitureWorkpieces"); }); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Order", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Count") .HasColumnType("integer"); b.Property("DateCreate") .HasColumnType("timestamp with time zone"); b.Property("DateImplement") .HasColumnType("timestamp with time zone"); b.Property("FurnitureId") .HasColumnType("integer"); b.Property("Status") .HasColumnType("integer"); b.Property("Sum") .HasColumnType("double precision"); b.HasKey("Id"); b.HasIndex("FurnitureId"); b.ToTable("Orders"); }); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Workpiece", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Cost") .HasColumnType("double precision"); b.Property("WorkpieceName") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Workpieces"); }); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.FurnitureWorkpiece", b => { b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Furniture", "Furniture") .WithMany("Workpieces") .HasForeignKey("FurnitureId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Workpiece", "Workpiece") .WithMany("FurnitureWorkpieces") .HasForeignKey("WorkpieceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Furniture"); b.Navigation("Workpiece"); }); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Order", b => { b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Furniture", "Furniture") .WithMany("Orders") .HasForeignKey("FurnitureId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Furniture"); }); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Furniture", b => { b.Navigation("Orders"); b.Navigation("Workpieces"); }); modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Workpiece", b => { b.Navigation("FurnitureWorkpieces"); }); #pragma warning restore 612, 618 } } }