mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 21:20:06 +01:00
fix: db model fixes and quote mapping
This commit is contained in:
@@ -69,7 +69,7 @@ namespace QuotifyBE.Migrations
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("ImageId")
|
||||
b.Property<int?>("ImageId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("LastUpdatedAt")
|
||||
@@ -84,6 +84,8 @@ namespace QuotifyBE.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ImageId");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Quotes");
|
||||
@@ -101,7 +103,7 @@ namespace QuotifyBE.Migrations
|
||||
|
||||
b.HasIndex("CategoryId");
|
||||
|
||||
b.ToTable("QuoteCategory");
|
||||
b.ToTable("QuoteCategories");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuotifyBE.Entities.User", b =>
|
||||
@@ -131,12 +133,18 @@ namespace QuotifyBE.Migrations
|
||||
|
||||
modelBuilder.Entity("QuotifyBE.Entities.Quote", b =>
|
||||
{
|
||||
b.HasOne("QuotifyBE.Entities.Image", "Image")
|
||||
.WithMany()
|
||||
.HasForeignKey("ImageId");
|
||||
|
||||
b.HasOne("QuotifyBE.Entities.User", "User")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Image");
|
||||
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
@@ -149,7 +157,7 @@ namespace QuotifyBE.Migrations
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("QuotifyBE.Entities.Quote", "Quote")
|
||||
.WithMany()
|
||||
.WithMany("QuoteCategories")
|
||||
.HasForeignKey("QuoteId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
@@ -158,6 +166,11 @@ namespace QuotifyBE.Migrations
|
||||
|
||||
b.Navigation("Quote");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("QuotifyBE.Entities.Quote", b =>
|
||||
{
|
||||
b.Navigation("QuoteCategories");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user