aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs')
-rw-r--r--src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs80
1 files changed, 60 insertions, 20 deletions
diff --git a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
index 064fb26..435adb4 100644
--- a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
+++ b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
@@ -76,9 +76,6 @@ namespace DevHive.Data.Migrations
b.Property<string>("Message")
.HasColumnType("text");
- b.Property<Guid>("RatingId")
- .HasColumnType("uuid");
-
b.Property<DateTime>("TimeCreated")
.HasColumnType("timestamp without time zone");
@@ -86,9 +83,6 @@ namespace DevHive.Data.Migrations
b.HasIndex("CreatorId");
- b.HasIndex("RatingId")
- .IsUnique();
-
b.ToTable("Posts");
});
@@ -98,10 +92,7 @@ namespace DevHive.Data.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
- b.Property<int>("Dislikes")
- .HasColumnType("integer");
-
- b.Property<int>("Likes")
+ b.Property<int>("Rate")
.HasColumnType("integer");
b.HasKey("Id");
@@ -227,6 +218,21 @@ namespace DevHive.Data.Migrations
b.ToTable("AspNetUsers");
});
+ modelBuilder.Entity("DevHive.Data.RelationModels.RatedPost", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("PostId")
+ .HasColumnType("uuid");
+
+ b.HasKey("UserId", "PostId");
+
+ b.HasIndex("PostId");
+
+ b.ToTable("RatedPosts");
+ });
+
modelBuilder.Entity("DevHive.Data.RelationModels.UserFriends", b =>
{
b.Property<Guid>("UserId")
@@ -242,6 +248,25 @@ namespace DevHive.Data.Migrations
b.ToTable("UserFriends");
});
+ modelBuilder.Entity("DevHive.Data.RelationModels.UserRate", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property<bool>("Rate")
+ .HasColumnType("boolean");
+
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("UserRates");
+ });
+
modelBuilder.Entity("LanguageUser", b =>
{
b.Property<Guid>("LanguagesId")
@@ -409,15 +434,26 @@ namespace DevHive.Data.Migrations
.WithMany("Posts")
.HasForeignKey("CreatorId");
- b.HasOne("DevHive.Data.Models.Rating", "Rating")
- .WithOne("Post")
- .HasForeignKey("DevHive.Data.Models.Post", "RatingId")
+ b.Navigation("Creator");
+ });
+
+ modelBuilder.Entity("DevHive.Data.RelationModels.RatedPost", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Post", "Post")
+ .WithMany()
+ .HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
- b.Navigation("Creator");
+ b.HasOne("DevHive.Data.Models.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
- b.Navigation("Rating");
+ b.Navigation("Post");
+
+ b.Navigation("User");
});
modelBuilder.Entity("DevHive.Data.RelationModels.UserFriends", b =>
@@ -439,6 +475,15 @@ namespace DevHive.Data.Migrations
b.Navigation("User");
});
+ modelBuilder.Entity("DevHive.Data.RelationModels.UserRate", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", "User")
+ .WithMany()
+ .HasForeignKey("UserId");
+
+ b.Navigation("User");
+ });
+
modelBuilder.Entity("LanguageUser", b =>
{
b.HasOne("DevHive.Data.Models.Language", null)
@@ -540,11 +585,6 @@ namespace DevHive.Data.Migrations
b.Navigation("Comments");
});
- modelBuilder.Entity("DevHive.Data.Models.Rating", b =>
- {
- b.Navigation("Post");
- });
-
modelBuilder.Entity("DevHive.Data.Models.User", b =>
{
b.Navigation("Comments");