diff options
Diffstat (limited to 'src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs')
| -rw-r--r-- | src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs index f662af7..064fb26 100644 --- a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs +++ b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs @@ -76,6 +76,9 @@ 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"); @@ -83,9 +86,29 @@ namespace DevHive.Data.Migrations b.HasIndex("CreatorId"); + b.HasIndex("RatingId") + .IsUnique(); + b.ToTable("Posts"); }); + modelBuilder.Entity("DevHive.Data.Models.Rating", b => + { + b.Property<Guid>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property<int>("Dislikes") + .HasColumnType("integer"); + + b.Property<int>("Likes") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Rating"); + }); + modelBuilder.Entity("DevHive.Data.Models.Role", b => { b.Property<Guid>("Id") @@ -185,9 +208,6 @@ namespace DevHive.Data.Migrations b.Property<bool>("TwoFactorEnabled") .HasColumnType("boolean"); - b.Property<Guid?>("UserId") - .HasColumnType("uuid"); - b.Property<string>("UserName") .HasMaxLength(256) .HasColumnType("character varying(256)"); @@ -201,8 +221,6 @@ namespace DevHive.Data.Migrations .IsUnique() .HasDatabaseName("UserNameIndex"); - b.HasIndex("UserId"); - b.HasIndex("UserName") .IsUnique(); @@ -391,14 +409,15 @@ namespace DevHive.Data.Migrations .WithMany("Posts") .HasForeignKey("CreatorId"); + b.HasOne("DevHive.Data.Models.Rating", "Rating") + .WithOne("Post") + .HasForeignKey("DevHive.Data.Models.Post", "RatingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + b.Navigation("Creator"); - }); - modelBuilder.Entity("DevHive.Data.Models.User", b => - { - b.HasOne("DevHive.Data.Models.User", null) - .WithMany("Friends") - .HasForeignKey("UserId"); + b.Navigation("Rating"); }); modelBuilder.Entity("DevHive.Data.RelationModels.UserFriends", b => @@ -410,7 +429,7 @@ namespace DevHive.Data.Migrations .IsRequired(); b.HasOne("DevHive.Data.Models.User", "User") - .WithMany() + .WithMany("Friends") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -521,6 +540,11 @@ 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"); |
