aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
diff options
context:
space:
mode:
authorDanail Dimitrov <danaildimitrov321@gmail.com>2021-02-05 16:36:47 +0200
committerDanail Dimitrov <danaildimitrov321@gmail.com>2021-02-05 16:36:47 +0200
commit60ed435203f0c60d4c6fabe77aa4e87656aaf8c1 (patch)
treef20f5a64142612a5da582afee039b5d0f650776f /src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
parenta82c21a79772217fd22e4b9e2b36a655804186c8 (diff)
downloadDevHive-60ed435203f0c60d4c6fabe77aa4e87656aaf8c1.tar
DevHive-60ed435203f0c60d4c6fabe77aa4e87656aaf8c1.tar.gz
DevHive-60ed435203f0c60d4c6fabe77aa4e87656aaf8c1.zip
Adding some metods to Rate repo
Diffstat (limited to 'src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs')
-rw-r--r--src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
index 0450670..d675914 100644
--- a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
+++ b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
@@ -112,11 +112,17 @@ namespace DevHive.Data.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
+ b.Property<Guid>("PostId")
+ .HasColumnType("uuid");
+
b.Property<int>("Rate")
.HasColumnType("integer");
b.HasKey("Id");
+ b.HasIndex("PostId")
+ .IsUnique();
+
b.ToTable("Rating");
});
@@ -271,14 +277,19 @@ namespace DevHive.Data.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
- b.Property<bool>("Rate")
+ b.Property<bool>("Liked")
.HasColumnType("boolean");
+ b.Property<Guid?>("PostId")
+ .HasColumnType("uuid");
+
b.Property<Guid?>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
+ b.HasIndex("PostId");
+
b.HasIndex("UserId");
b.ToTable("UserRates");
@@ -465,6 +476,17 @@ namespace DevHive.Data.Migrations
b.Navigation("User");
});
+ modelBuilder.Entity("DevHive.Data.Models.Rating", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Post", "Post")
+ .WithOne("Rating")
+ .HasForeignKey("DevHive.Data.Models.Rating", "PostId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Post");
+ });
+
modelBuilder.Entity("DevHive.Data.RelationModels.RatedPost", b =>
{
b.HasOne("DevHive.Data.Models.Post", "Post")
@@ -474,7 +496,7 @@ namespace DevHive.Data.Migrations
.IsRequired();
b.HasOne("DevHive.Data.Models.User", "User")
- .WithMany()
+ .WithMany("RatedPosts")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -505,10 +527,16 @@ namespace DevHive.Data.Migrations
modelBuilder.Entity("DevHive.Data.RelationModels.UserRate", b =>
{
+ b.HasOne("DevHive.Data.Models.Post", "Post")
+ .WithMany()
+ .HasForeignKey("PostId");
+
b.HasOne("DevHive.Data.Models.User", "User")
.WithMany()
.HasForeignKey("UserId");
+ b.Navigation("Post");
+
b.Navigation("User");
});
@@ -611,6 +639,8 @@ namespace DevHive.Data.Migrations
modelBuilder.Entity("DevHive.Data.Models.Post", b =>
{
b.Navigation("Comments");
+
+ b.Navigation("Rating");
});
modelBuilder.Entity("DevHive.Data.Models.User", b =>
@@ -624,6 +654,8 @@ namespace DevHive.Data.Migrations
b.Navigation("Posts");
b.Navigation("ProfilePicture");
+
+ b.Navigation("RatedPosts");
});
#pragma warning restore 612, 618
}