From 8b164bf4ac8c307de933b476e858e489a64c0da5 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 30 Jan 2021 11:31:48 +0200 Subject: Added cloud implementation migration --- .../Migrations/DevHiveContextModelSnapshot.cs | 41 ++++++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs') diff --git a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs index cf0a82b..f662af7 100644 --- a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs +++ b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs @@ -1,5 +1,6 @@ // using System; +using System.Collections.Generic; using DevHive.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; @@ -25,13 +26,13 @@ namespace DevHive.Data.Migrations .ValueGeneratedOnAdd() .HasColumnType("uuid"); - b.Property("CreatorId") + b.Property("CreatorId") .HasColumnType("uuid"); b.Property("Message") .HasColumnType("text"); - b.Property("PostId") + b.Property("PostId") .HasColumnType("uuid"); b.Property("TimeCreated") @@ -39,6 +40,8 @@ namespace DevHive.Data.Migrations b.HasKey("Id"); + b.HasIndex("CreatorId"); + b.HasIndex("PostId"); b.ToTable("Comments"); @@ -64,9 +67,12 @@ namespace DevHive.Data.Migrations .ValueGeneratedOnAdd() .HasColumnType("uuid"); - b.Property("CreatorId") + b.Property("CreatorId") .HasColumnType("uuid"); + b.Property>("FileUrls") + .HasColumnType("text[]"); + b.Property("Message") .HasColumnType("text"); @@ -75,6 +81,8 @@ namespace DevHive.Data.Migrations b.HasKey("Id"); + b.HasIndex("CreatorId"); + b.ToTable("Posts"); }); @@ -364,11 +372,26 @@ namespace DevHive.Data.Migrations modelBuilder.Entity("DevHive.Data.Models.Comment", b => { - b.HasOne("DevHive.Data.Models.Post", null) + b.HasOne("DevHive.Data.Models.User", "Creator") .WithMany("Comments") - .HasForeignKey("PostId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + .HasForeignKey("CreatorId"); + + b.HasOne("DevHive.Data.Models.Post", "Post") + .WithMany("Comments") + .HasForeignKey("PostId"); + + b.Navigation("Creator"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("DevHive.Data.Models.Post", b => + { + b.HasOne("DevHive.Data.Models.User", "Creator") + .WithMany("Posts") + .HasForeignKey("CreatorId"); + + b.Navigation("Creator"); }); modelBuilder.Entity("DevHive.Data.Models.User", b => @@ -500,7 +523,11 @@ namespace DevHive.Data.Migrations modelBuilder.Entity("DevHive.Data.Models.User", b => { + b.Navigation("Comments"); + b.Navigation("Friends"); + + b.Navigation("Posts"); }); #pragma warning restore 612, 618 } -- cgit v1.2.3