миграция

This commit is contained in:
Андрей Байгулов 2024-06-02 20:09:01 +04:00
parent e14cb5037c
commit d90c029f57
4 changed files with 72 additions and 72 deletions

View File

@ -12,7 +12,7 @@ using SushiBarDatabaseImplement;
namespace SushiBarDatabaseImplement.Migrations namespace SushiBarDatabaseImplement.Migrations
{ {
[DbContext(typeof(SushiBarDatabase))] [DbContext(typeof(SushiBarDatabase))]
[Migration("20240601121133_Initial")] [Migration("20240601134444_Initial")]
partial class Initial partial class Initial
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -25,32 +25,7 @@ namespace SushiBarDatabaseImplement.Migrations
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("SushiBarDatabaseImplement.Client", b => modelBuilder.Entity("SushiBarDataModels.Models.Implementer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -77,6 +52,31 @@ namespace SushiBarDatabaseImplement.Migrations
b.ToTable("Implementers"); b.ToTable("Implementers");
}); });
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -218,7 +218,7 @@ namespace SushiBarDatabaseImplement.Migrations
modelBuilder.Entity("SushiBarDatabaseImplement.Models.MessageInfo", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.MessageInfo", b =>
{ {
b.HasOne("SushiBarDatabaseImplement.Client", "Client") b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client")
.WithMany("ClientMessages") .WithMany("ClientMessages")
.HasForeignKey("ClientId"); .HasForeignKey("ClientId");
@ -227,13 +227,13 @@ namespace SushiBarDatabaseImplement.Migrations
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Order", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.Order", b =>
{ {
b.HasOne("SushiBarDatabaseImplement.Client", "Client") b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client")
.WithMany("ClientOrders") .WithMany("ClientOrders")
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.HasOne("SushiBarDatabaseImplement.Implementer", "Implementer") b.HasOne("SushiBarDataModels.Models.Implementer", "Implementer")
.WithMany("Order") .WithMany("Order")
.HasForeignKey("ImplementerId"); .HasForeignKey("ImplementerId");
@ -269,18 +269,18 @@ namespace SushiBarDatabaseImplement.Migrations
b.Navigation("Sushi"); 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("ClientMessages");
b.Navigation("ClientOrders"); b.Navigation("ClientOrders");
}); });
modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b =>
{
b.Navigation("Order");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b =>
{ {
b.Navigation("SushiComponents"); b.Navigation("SushiComponents");

View File

@ -22,32 +22,7 @@ namespace SushiBarDatabaseImplement.Migrations
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("SushiBarDatabaseImplement.Client", b => modelBuilder.Entity("SushiBarDataModels.Models.Implementer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -74,6 +49,31 @@ namespace SushiBarDatabaseImplement.Migrations
b.ToTable("Implementers"); b.ToTable("Implementers");
}); });
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -215,7 +215,7 @@ namespace SushiBarDatabaseImplement.Migrations
modelBuilder.Entity("SushiBarDatabaseImplement.Models.MessageInfo", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.MessageInfo", b =>
{ {
b.HasOne("SushiBarDatabaseImplement.Client", "Client") b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client")
.WithMany("ClientMessages") .WithMany("ClientMessages")
.HasForeignKey("ClientId"); .HasForeignKey("ClientId");
@ -224,13 +224,13 @@ namespace SushiBarDatabaseImplement.Migrations
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Order", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.Order", b =>
{ {
b.HasOne("SushiBarDatabaseImplement.Client", "Client") b.HasOne("SushiBarDatabaseImplement.Models.Client", "Client")
.WithMany("ClientOrders") .WithMany("ClientOrders")
.HasForeignKey("ClientId") .HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.HasOne("SushiBarDatabaseImplement.Implementer", "Implementer") b.HasOne("SushiBarDataModels.Models.Implementer", "Implementer")
.WithMany("Order") .WithMany("Order")
.HasForeignKey("ImplementerId"); .HasForeignKey("ImplementerId");
@ -266,18 +266,18 @@ namespace SushiBarDatabaseImplement.Migrations
b.Navigation("Sushi"); 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("ClientMessages");
b.Navigation("ClientOrders"); b.Navigation("ClientOrders");
}); });
modelBuilder.Entity("SushiBarDatabaseImplement.Implementer", b =>
{
b.Navigation("Order");
});
modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b => modelBuilder.Entity("SushiBarDatabaseImplement.Models.Component", b =>
{ {
b.Navigation("SushiComponents"); b.Navigation("SushiComponents");

View File

@ -15,7 +15,7 @@ namespace SushiBarDatabaseImplement
{ {
if (OptionsBuilder.IsConfigured == false) 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); base.OnConfiguring(OptionsBuilder);