diff --git a/SushiBar/SushiBarDatabaseImplement/Migrations/20240601121133_Initial.Designer.cs b/SushiBar/SushiBarDatabaseImplement/Migrations/20240601134444_Initial.Designer.cs similarity index 94% rename from SushiBar/SushiBarDatabaseImplement/Migrations/20240601121133_Initial.Designer.cs rename to SushiBar/SushiBarDatabaseImplement/Migrations/20240601134444_Initial.Designer.cs index d0712bb..d08de31 100644 --- a/SushiBar/SushiBarDatabaseImplement/Migrations/20240601121133_Initial.Designer.cs +++ b/SushiBar/SushiBarDatabaseImplement/Migrations/20240601134444_Initial.Designer.cs @@ -12,7 +12,7 @@ using SushiBarDatabaseImplement; namespace SushiBarDatabaseImplement.Migrations { [DbContext(typeof(SushiBarDatabase))] - [Migration("20240601121133_Initial")] + [Migration("20240601134444_Initial")] partial class Initial { /// @@ -25,32 +25,7 @@ namespace SushiBarDatabaseImplement.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("SushiBarDatabaseImplement.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("text"); - - b.Property("Email") - .IsRequired() - .HasColumnType("text"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b => + modelBuilder.Entity("SushiBarDataModels.Models.Implementer", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -77,6 +52,31 @@ namespace SushiBarDatabaseImplement.Migrations b.ToTable("Implementers"); }); + modelBuilder.Entity("SushiBarDatabaseImplement.Models.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientFIO") + .IsRequired() + .HasColumnType("text"); + + b.Property("Email") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Clients"); + }); + modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => { b.Property("Id") @@ -218,7 +218,7 @@ namespace SushiBarDatabaseImplement.Migrations modelBuilder.Entity("SushiBarDatabaseImplement.Models.MessageInfo", b => { - b.HasOne("SushiBarDatabaseImplement.Client", "Client") + b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client") .WithMany("ClientMessages") .HasForeignKey("ClientId"); @@ -227,13 +227,13 @@ namespace SushiBarDatabaseImplement.Migrations modelBuilder.Entity("SushiBarDatabaseImplement.Models.Order", b => { - b.HasOne("SushiBarDatabaseImplement.Client", "Client") + b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client") .WithMany("ClientOrders") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("SushiBarDatabaseImplement.Implementer", "Implementer") + b.HasOne("SushiBarDataModels.Models.Implementer", "Implementer") .WithMany("Order") .HasForeignKey("ImplementerId"); @@ -269,18 +269,18 @@ namespace SushiBarDatabaseImplement.Migrations b.Navigation("Sushi"); }); - modelBuilder.Entity("SushiBarDatabaseImplement.Client", b => + modelBuilder.Entity("SushiBarDataModels.Models.Implementer", b => + { + b.Navigation("Order"); + }); + + modelBuilder.Entity("SushiBarDatabaseImplement.Models.Client", b => { b.Navigation("ClientMessages"); b.Navigation("ClientOrders"); }); - modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b => - { - b.Navigation("Order"); - }); - modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => { b.Navigation("SushiComponents"); diff --git a/SushiBar/SushiBarDatabaseImplement/Migrations/20240601121133_Initial.cs b/SushiBar/SushiBarDatabaseImplement/Migrations/20240601134444_Initial.cs similarity index 100% rename from SushiBar/SushiBarDatabaseImplement/Migrations/20240601121133_Initial.cs rename to SushiBar/SushiBarDatabaseImplement/Migrations/20240601134444_Initial.cs diff --git a/SushiBar/SushiBarDatabaseImplement/Migrations/SushiBarDatabaseModelSnapshot.cs b/SushiBar/SushiBarDatabaseImplement/Migrations/SushiBarDatabaseModelSnapshot.cs index 2de7ba7..8de030d 100644 --- a/SushiBar/SushiBarDatabaseImplement/Migrations/SushiBarDatabaseModelSnapshot.cs +++ b/SushiBar/SushiBarDatabaseImplement/Migrations/SushiBarDatabaseModelSnapshot.cs @@ -22,32 +22,7 @@ namespace SushiBarDatabaseImplement.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("SushiBarDatabaseImplement.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ClientFIO") - .IsRequired() - .HasColumnType("text"); - - b.Property("Email") - .IsRequired() - .HasColumnType("text"); - - b.Property("Password") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("Id"); - - b.ToTable("Clients"); - }); - - modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b => + modelBuilder.Entity("SushiBarDataModels.Models.Implementer", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -74,6 +49,31 @@ namespace SushiBarDatabaseImplement.Migrations b.ToTable("Implementers"); }); + modelBuilder.Entity("SushiBarDatabaseImplement.Models.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientFIO") + .IsRequired() + .HasColumnType("text"); + + b.Property("Email") + .IsRequired() + .HasColumnType("text"); + + b.Property("Password") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Clients"); + }); + modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => { b.Property("Id") @@ -215,7 +215,7 @@ namespace SushiBarDatabaseImplement.Migrations modelBuilder.Entity("SushiBarDatabaseImplement.Models.MessageInfo", b => { - b.HasOne("SushiBarDatabaseImplement.Client", "Client") + b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client") .WithMany("ClientMessages") .HasForeignKey("ClientId"); @@ -224,13 +224,13 @@ namespace SushiBarDatabaseImplement.Migrations modelBuilder.Entity("SushiBarDatabaseImplement.Models.Order", b => { - b.HasOne("SushiBarDatabaseImplement.Client", "Client") + b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client") .WithMany("ClientOrders") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("SushiBarDatabaseImplement.Implementer", "Implementer") + b.HasOne("SushiBarDataModels.Models.Implementer", "Implementer") .WithMany("Order") .HasForeignKey("ImplementerId"); @@ -266,18 +266,18 @@ namespace SushiBarDatabaseImplement.Migrations b.Navigation("Sushi"); }); - modelBuilder.Entity("SushiBarDatabaseImplement.Client", b => + modelBuilder.Entity("SushiBarDataModels.Models.Implementer", b => + { + b.Navigation("Order"); + }); + + modelBuilder.Entity("SushiBarDatabaseImplement.Models.Client", b => { b.Navigation("ClientMessages"); b.Navigation("ClientOrders"); }); - modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b => - { - b.Navigation("Order"); - }); - modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => { b.Navigation("SushiComponents"); diff --git a/SushiBar/SushiBarDatabaseImplement/SushiBarDatabase.cs b/SushiBar/SushiBarDatabaseImplement/SushiBarDatabase.cs index a8b920a..d58bfb9 100644 --- a/SushiBar/SushiBarDatabaseImplement/SushiBarDatabase.cs +++ b/SushiBar/SushiBarDatabaseImplement/SushiBarDatabase.cs @@ -15,7 +15,7 @@ namespace SushiBarDatabaseImplement { if (OptionsBuilder.IsConfigured == false) { - OptionsBuilder.UseNpgsql(@"Host=localhost;Database=SushiBarFull7;Username=postgres;Password=postgres"); + OptionsBuilder.UseNpgsql(@"Host=localhost;Database=SushiBarFull8;Username=postgres;Password=postgres"); } base.OnConfiguring(OptionsBuilder);