aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-01-19 20:26:14 +0200
committertranstrike <transtrike@gmail.com>2021-01-19 20:26:14 +0200
commitc96a880768d8dee9449aa4f69e14bddc8e0d92f9 (patch)
tree2b7ecdb1232048ce129fbd4c23b1d65c6102634e /src/DevHive.Data
parentf9d6e76049aad823aaa8cb500520c7d3a7ad67e2 (diff)
downloadDevHive-c96a880768d8dee9449aa4f69e14bddc8e0d92f9.tar
DevHive-c96a880768d8dee9449aa4f69e14bddc8e0d92f9.tar.gz
DevHive-c96a880768d8dee9449aa4f69e14bddc8e0d92f9.zip
Lang&Tech Many-To-Many added; Migration added
Diffstat (limited to 'src/DevHive.Data')
-rw-r--r--src/DevHive.Data/Interfaces/Models/ILanguage.cs5
-rw-r--r--src/DevHive.Data/Interfaces/Models/ITechnology.cs4
-rw-r--r--src/DevHive.Data/Migrations/20201219141035_DbContext_Moved.Designer.cs548
-rw-r--r--src/DevHive.Data/Migrations/20201230154737_CommentMigration.Designer.cs576
-rw-r--r--src/DevHive.Data/Migrations/20210112111416_User_Implements_Languages.Designer.cs624
-rw-r--r--src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.Designer.cs474
-rw-r--r--src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.cs188
-rw-r--r--src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs691
-rw-r--r--src/DevHive.Data/Models/Language.cs2
-rw-r--r--src/DevHive.Data/Models/Technology.cs2
10 files changed, 1929 insertions, 1185 deletions
diff --git a/src/DevHive.Data/Interfaces/Models/ILanguage.cs b/src/DevHive.Data/Interfaces/Models/ILanguage.cs
index f757a3f..9549777 100644
--- a/src/DevHive.Data/Interfaces/Models/ILanguage.cs
+++ b/src/DevHive.Data/Interfaces/Models/ILanguage.cs
@@ -1,7 +1,12 @@
+using System.Collections.Generic;
+using DevHive.Data.Models;
+
namespace DevHive.Data.Interfaces.Models
{
public interface ILanguage : IModel
{
string Name { get; set; }
+ List<User> Users { get; set; }
+
}
}
diff --git a/src/DevHive.Data/Interfaces/Models/ITechnology.cs b/src/DevHive.Data/Interfaces/Models/ITechnology.cs
index 9bd97f9..159a21a 100644
--- a/src/DevHive.Data/Interfaces/Models/ITechnology.cs
+++ b/src/DevHive.Data/Interfaces/Models/ITechnology.cs
@@ -1,7 +1,11 @@
+using System.Collections.Generic;
+using DevHive.Data.Models;
+
namespace DevHive.Data.Interfaces.Models
{
public interface ITechnology : IModel
{
string Name { get; set; }
+ List<User> Users { get; set; }
}
}
diff --git a/src/DevHive.Data/Migrations/20201219141035_DbContext_Moved.Designer.cs b/src/DevHive.Data/Migrations/20201219141035_DbContext_Moved.Designer.cs
index dd0e8c7..26daaab 100644
--- a/src/DevHive.Data/Migrations/20201219141035_DbContext_Moved.Designer.cs
+++ b/src/DevHive.Data/Migrations/20201219141035_DbContext_Moved.Designer.cs
@@ -9,349 +9,349 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DevHive.Data.Migrations
{
- [DbContext(typeof(DevHiveContext))]
- [Migration("20201219141035_DbContext_Moved")]
- partial class DbContext_Moved
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
+ [DbContext(typeof(DevHiveContext))]
+ [Migration("20201219141035_DbContext_Moved")]
+ partial class DbContext_Moved
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
#pragma warning disable 612, 618
- modelBuilder
- .UseIdentityByDefaultColumns()
- .HasAnnotation("Relational:MaxIdentifierLength", 63)
- .HasAnnotation("ProductVersion", "5.0.1");
+ modelBuilder
+ .UseIdentityByDefaultColumns()
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.1");
- modelBuilder.Entity("DevHive.Data.Models.Language", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Language", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Languages");
- });
+ b.ToTable("Languages");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Role", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Role", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
- b.ToTable("AspNetRoles");
- });
+ b.ToTable("AspNetRoles");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Technologies");
- });
+ b.ToTable("Technologies");
+ });
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<int>("AccessFailedCount")
- .HasColumnType("integer");
+ b.Property<int>("AccessFailedCount")
+ .HasColumnType("integer");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("boolean");
+ b.Property<bool>("EmailConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("FirstName")
- .HasColumnType("text");
+ b.Property<string>("FirstName")
+ .HasColumnType("text");
- b.Property<string>("LastName")
- .HasColumnType("text");
+ b.Property<string>("LastName")
+ .HasColumnType("text");
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("boolean");
+ b.Property<bool>("LockoutEnabled")
+ .HasColumnType("boolean");
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("timestamp with time zone");
+ b.Property<DateTimeOffset?>("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("PasswordHash")
- .HasColumnType("text");
+ b.Property<string>("PasswordHash")
+ .HasColumnType("text");
- b.Property<string>("PhoneNumber")
- .HasColumnType("text");
+ b.Property<string>("PhoneNumber")
+ .HasColumnType("text");
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("boolean");
+ b.Property<bool>("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("ProfilePicture")
- .HasColumnType("text");
+ b.Property<string>("ProfilePicture")
+ .HasColumnType("text");
- b.Property<string>("SecurityStamp")
- .HasColumnType("text");
+ b.Property<string>("SecurityStamp")
+ .HasColumnType("text");
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("boolean");
+ b.Property<bool>("TwoFactorEnabled")
+ .HasColumnType("boolean");
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.HasIndex("UserName")
- .IsUnique();
+ b.HasIndex("UserName")
+ .IsUnique();
- b.ToTable("AspNetUsers");
- });
+ b.ToTable("AspNetUsers");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("RoleId");
+ b.HasIndex("RoleId");
- b.ToTable("AspNetRoleClaims");
- });
+ b.ToTable("AspNetRoleClaims");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("AspNetUserClaims");
- });
+ b.ToTable("AspNetUserClaims");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
- b.Property<string>("ProviderKey")
- .HasColumnType("text");
+ b.Property<string>("ProviderKey")
+ .HasColumnType("text");
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("text");
+ b.Property<string>("ProviderDisplayName")
+ .HasColumnType("text");
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("LoginProvider", "ProviderKey");
+ b.HasKey("LoginProvider", "ProviderKey");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("AspNetUserLogins");
- });
+ b.ToTable("AspNetUserLogins");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
- b.HasKey("UserId", "RoleId");
+ b.HasKey("UserId", "RoleId");
- b.HasIndex("RoleId");
+ b.HasIndex("RoleId");
- b.ToTable("AspNetUserRoles");
- });
+ b.ToTable("AspNetUserRoles");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens");
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.Property<Guid>("RolesId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("UsersId")
- .HasColumnType("uuid");
-
- b.HasKey("RolesId", "UsersId");
-
- b.HasIndex("UsersId");
-
- b.ToTable("RoleUser");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Friends")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RolesId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UsersId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Navigation("Friends");
- });
+ b.Property<string>("Name")
+ .HasColumnType("text");
+
+ b.Property<string>("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens");
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.Property<Guid>("RolesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("RolesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("RoleUser");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany("Friends")
+ .HasForeignKey("UserId");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RolesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Navigation("Friends");
+ });
#pragma warning restore 612, 618
- }
- }
+ }
+ }
}
diff --git a/src/DevHive.Data/Migrations/20201230154737_CommentMigration.Designer.cs b/src/DevHive.Data/Migrations/20201230154737_CommentMigration.Designer.cs
index 0df3199..21f494d 100644
--- a/src/DevHive.Data/Migrations/20201230154737_CommentMigration.Designer.cs
+++ b/src/DevHive.Data/Migrations/20201230154737_CommentMigration.Designer.cs
@@ -9,369 +9,369 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DevHive.Data.Migrations
{
- [DbContext(typeof(DevHiveContext))]
- [Migration("20201230154737_CommentMigration")]
- partial class CommentMigration
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
+ [DbContext(typeof(DevHiveContext))]
+ [Migration("20201230154737_CommentMigration")]
+ partial class CommentMigration
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
#pragma warning disable 612, 618
- modelBuilder
- .UseIdentityByDefaultColumns()
- .HasAnnotation("Relational:MaxIdentifierLength", 63)
- .HasAnnotation("ProductVersion", "5.0.1");
+ modelBuilder
+ .UseIdentityByDefaultColumns()
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.1");
- modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<DateTime>("Date")
- .HasColumnType("timestamp without time zone");
+ b.Property<DateTime>("Date")
+ .HasColumnType("timestamp without time zone");
- b.Property<string>("Message")
- .HasColumnType("text");
+ b.Property<string>("Message")
+ .HasColumnType("text");
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Comments");
- });
+ b.ToTable("Comments");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Language", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Language", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Languages");
- });
+ b.ToTable("Languages");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Role", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Role", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
- b.ToTable("AspNetRoles");
- });
+ b.ToTable("AspNetRoles");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Technologies");
- });
+ b.ToTable("Technologies");
+ });
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<int>("AccessFailedCount")
- .HasColumnType("integer");
+ b.Property<int>("AccessFailedCount")
+ .HasColumnType("integer");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("boolean");
+ b.Property<bool>("EmailConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("FirstName")
- .HasColumnType("text");
+ b.Property<string>("FirstName")
+ .HasColumnType("text");
- b.Property<string>("LastName")
- .HasColumnType("text");
+ b.Property<string>("LastName")
+ .HasColumnType("text");
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("boolean");
+ b.Property<bool>("LockoutEnabled")
+ .HasColumnType("boolean");
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("timestamp with time zone");
+ b.Property<DateTimeOffset?>("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("PasswordHash")
- .HasColumnType("text");
+ b.Property<string>("PasswordHash")
+ .HasColumnType("text");
- b.Property<string>("PhoneNumber")
- .HasColumnType("text");
+ b.Property<string>("PhoneNumber")
+ .HasColumnType("text");
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("boolean");
+ b.Property<bool>("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("ProfilePicture")
- .HasColumnType("text");
+ b.Property<string>("ProfilePicture")
+ .HasColumnType("text");
- b.Property<string>("SecurityStamp")
- .HasColumnType("text");
+ b.Property<string>("SecurityStamp")
+ .HasColumnType("text");
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("boolean");
+ b.Property<bool>("TwoFactorEnabled")
+ .HasColumnType("boolean");
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.HasIndex("UserName")
- .IsUnique();
+ b.HasIndex("UserName")
+ .IsUnique();
- b.ToTable("AspNetUsers");
- });
+ b.ToTable("AspNetUsers");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("RoleId");
+ b.HasIndex("RoleId");
- b.ToTable("AspNetRoleClaims");
- });
+ b.ToTable("AspNetRoleClaims");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("AspNetUserClaims");
- });
+ b.ToTable("AspNetUserClaims");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
- b.Property<string>("ProviderKey")
- .HasColumnType("text");
+ b.Property<string>("ProviderKey")
+ .HasColumnType("text");
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("text");
+ b.Property<string>("ProviderDisplayName")
+ .HasColumnType("text");
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("LoginProvider", "ProviderKey");
+ b.HasKey("LoginProvider", "ProviderKey");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("AspNetUserLogins");
- });
+ b.ToTable("AspNetUserLogins");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
- b.HasKey("UserId", "RoleId");
+ b.HasKey("UserId", "RoleId");
- b.HasIndex("RoleId");
+ b.HasIndex("RoleId");
- b.ToTable("AspNetUserRoles");
- });
+ b.ToTable("AspNetUserRoles");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens");
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.Property<Guid>("RolesId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("UsersId")
- .HasColumnType("uuid");
-
- b.HasKey("RolesId", "UsersId");
-
- b.HasIndex("UsersId");
-
- b.ToTable("RoleUser");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Friends")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RolesId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UsersId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Navigation("Friends");
- });
+ b.Property<string>("Name")
+ .HasColumnType("text");
+
+ b.Property<string>("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens");
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.Property<Guid>("RolesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("RolesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("RoleUser");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany("Friends")
+ .HasForeignKey("UserId");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RolesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Navigation("Friends");
+ });
#pragma warning restore 612, 618
- }
- }
+ }
+ }
}
diff --git a/src/DevHive.Data/Migrations/20210112111416_User_Implements_Languages.Designer.cs b/src/DevHive.Data/Migrations/20210112111416_User_Implements_Languages.Designer.cs
index 1605b5b..40a6036 100644
--- a/src/DevHive.Data/Migrations/20210112111416_User_Implements_Languages.Designer.cs
+++ b/src/DevHive.Data/Migrations/20210112111416_User_Implements_Languages.Designer.cs
@@ -9,397 +9,397 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DevHive.Data.Migrations
{
- [DbContext(typeof(DevHiveContext))]
- [Migration("20210112111416_User_Implements_Languages")]
- partial class User_Implements_Languages
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
+ [DbContext(typeof(DevHiveContext))]
+ [Migration("20210112111416_User_Implements_Languages")]
+ partial class User_Implements_Languages
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
#pragma warning disable 612, 618
- modelBuilder
- .UseIdentityByDefaultColumns()
- .HasAnnotation("Relational:MaxIdentifierLength", 63)
- .HasAnnotation("ProductVersion", "5.0.1");
+ modelBuilder
+ .UseIdentityByDefaultColumns()
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.1");
- modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<Guid>("IssuerId")
- .HasColumnType("uuid");
+ b.Property<Guid>("IssuerId")
+ .HasColumnType("uuid");
- b.Property<string>("Message")
- .HasColumnType("text");
+ b.Property<string>("Message")
+ .HasColumnType("text");
- b.Property<DateTime>("TimeCreated")
- .HasColumnType("timestamp without time zone");
+ b.Property<DateTime>("TimeCreated")
+ .HasColumnType("timestamp without time zone");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.ToTable("Comments");
- });
+ b.ToTable("Comments");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Language", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Language", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("Languages");
- });
+ b.ToTable("Languages");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Role", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Role", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
- b.ToTable("AspNetRoles");
- });
+ b.ToTable("AspNetRoles");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("Technologies");
- });
+ b.ToTable("Technologies");
+ });
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<int>("AccessFailedCount")
- .HasColumnType("integer");
+ b.Property<int>("AccessFailedCount")
+ .HasColumnType("integer");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("boolean");
+ b.Property<bool>("EmailConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("FirstName")
- .HasColumnType("text");
+ b.Property<string>("FirstName")
+ .HasColumnType("text");
- b.Property<string>("LastName")
- .HasColumnType("text");
+ b.Property<string>("LastName")
+ .HasColumnType("text");
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("boolean");
+ b.Property<bool>("LockoutEnabled")
+ .HasColumnType("boolean");
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("timestamp with time zone");
+ b.Property<DateTimeOffset?>("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("PasswordHash")
- .HasColumnType("text");
+ b.Property<string>("PasswordHash")
+ .HasColumnType("text");
- b.Property<string>("PhoneNumber")
- .HasColumnType("text");
+ b.Property<string>("PhoneNumber")
+ .HasColumnType("text");
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("boolean");
+ b.Property<bool>("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("ProfilePictureUrl")
- .HasColumnType("text");
+ b.Property<string>("ProfilePictureUrl")
+ .HasColumnType("text");
- b.Property<string>("SecurityStamp")
- .HasColumnType("text");
+ b.Property<string>("SecurityStamp")
+ .HasColumnType("text");
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("boolean");
+ b.Property<bool>("TwoFactorEnabled")
+ .HasColumnType("boolean");
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.HasIndex("UserName")
- .IsUnique();
+ b.HasIndex("UserName")
+ .IsUnique();
- b.ToTable("AspNetUsers");
- });
+ b.ToTable("AspNetUsers");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("RoleId");
+ b.HasIndex("RoleId");
- b.ToTable("AspNetRoleClaims");
- });
+ b.ToTable("AspNetRoleClaims");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("AspNetUserClaims");
- });
+ b.ToTable("AspNetUserClaims");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
- b.Property<string>("ProviderKey")
- .HasColumnType("text");
+ b.Property<string>("ProviderKey")
+ .HasColumnType("text");
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("text");
+ b.Property<string>("ProviderDisplayName")
+ .HasColumnType("text");
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.HasKey("LoginProvider", "ProviderKey");
+ b.HasKey("LoginProvider", "ProviderKey");
- b.HasIndex("UserId");
+ b.HasIndex("UserId");
- b.ToTable("AspNetUserLogins");
- });
+ b.ToTable("AspNetUserLogins");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
- b.HasKey("UserId", "RoleId");
+ b.HasKey("UserId", "RoleId");
- b.HasIndex("RoleId");
+ b.HasIndex("RoleId");
- b.ToTable("AspNetUserRoles");
- });
+ b.ToTable("AspNetUserRoles");
+ });
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens");
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.Property<Guid>("RolesId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("UsersId")
- .HasColumnType("uuid");
-
- b.HasKey("RolesId", "UsersId");
-
- b.HasIndex("UsersId");
-
- b.ToTable("RoleUser");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.Language", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Languages")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Technologies")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Friends")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RolesId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UsersId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Navigation("Friends");
-
- b.Navigation("Languages");
-
- b.Navigation("Technologies");
- });
+ b.Property<string>("Name")
+ .HasColumnType("text");
+
+ b.Property<string>("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens");
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.Property<Guid>("RolesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("RolesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("RoleUser");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Language", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany("Languages")
+ .HasForeignKey("UserId");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany("Technologies")
+ .HasForeignKey("UserId");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany("Friends")
+ .HasForeignKey("UserId");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RolesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Navigation("Friends");
+
+ b.Navigation("Languages");
+
+ b.Navigation("Technologies");
+ });
#pragma warning restore 612, 618
- }
- }
+ }
+ }
}
diff --git a/src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.Designer.cs b/src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.Designer.cs
new file mode 100644
index 0000000..652b58f
--- /dev/null
+++ b/src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.Designer.cs
@@ -0,0 +1,474 @@
+// <auto-generated />
+using System;
+using DevHive.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+namespace DevHive.Data.Migrations
+{
+ [DbContext(typeof(DevHiveContext))]
+ [Migration("20210119182404_LangAndUser-ManyToMany")]
+ partial class LangAndUserManyToMany
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .UseIdentityByDefaultColumns()
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.1");
+
+ modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("IssuerId")
+ .HasColumnType("uuid");
+
+ b.Property<string>("Message")
+ .HasColumnType("text");
+
+ b.Property<Guid?>("PostId")
+ .HasColumnType("uuid");
+
+ b.Property<DateTime>("TimeCreated")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.HasIndex("PostId");
+
+ b.ToTable("Comments");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Language", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property<string>("Name")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Languages");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Post", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("IssuerId")
+ .HasColumnType("uuid");
+
+ b.Property<string>("Message")
+ .HasColumnType("text");
+
+ b.Property<DateTime>("TimeCreated")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("Id");
+
+ b.ToTable("Posts");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Role", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property<string>("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property<string>("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property<string>("Name")
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.ToTable("Technologies");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
+
+ b.Property<int>("AccessFailedCount")
+ .HasColumnType("integer");
+
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property<string>("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property<bool>("EmailConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property<string>("FirstName")
+ .HasColumnType("text");
+
+ b.Property<string>("LastName")
+ .HasColumnType("text");
+
+ b.Property<bool>("LockoutEnabled")
+ .HasColumnType("boolean");
+
+ b.Property<DateTimeOffset?>("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property<string>("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property<string>("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property<string>("PasswordHash")
+ .HasColumnType("text");
+
+ b.Property<string>("PhoneNumber")
+ .HasColumnType("text");
+
+ b.Property<bool>("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property<string>("ProfilePictureUrl")
+ .HasColumnType("text");
+
+ b.Property<string>("SecurityStamp")
+ .HasColumnType("text");
+
+ b.Property<bool>("TwoFactorEnabled")
+ .HasColumnType("boolean");
+
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
+
+ b.Property<string>("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.HasIndex("UserId");
+
+ b.HasIndex("UserName")
+ .IsUnique();
+
+ b.ToTable("AspNetUsers");
+ });
+
+ modelBuilder.Entity("LanguageUser", b =>
+ {
+ b.Property<Guid>("LanguagesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("LanguagesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("LanguageUser");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
+
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
+
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property<string>("ProviderKey")
+ .HasColumnType("text");
+
+ b.Property<string>("ProviderDisplayName")
+ .HasColumnType("text");
+
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
+
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property<string>("Name")
+ .HasColumnType("text");
+
+ b.Property<string>("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens");
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.Property<Guid>("RolesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("RolesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("RoleUser");
+ });
+
+ modelBuilder.Entity("TechnologyUser", b =>
+ {
+ b.Property<Guid>("TechnologiesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("TechnologiesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("TechnologyUser");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Post", null)
+ .WithMany("Comments")
+ .HasForeignKey("PostId");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany("Friends")
+ .HasForeignKey("UserId");
+ });
+
+ modelBuilder.Entity("LanguageUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Language", null)
+ .WithMany()
+ .HasForeignKey("LanguagesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RolesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("TechnologyUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Technology", null)
+ .WithMany()
+ .HasForeignKey("TechnologiesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Post", b =>
+ {
+ b.Navigation("Comments");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Navigation("Friends");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.cs b/src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.cs
new file mode 100644
index 0000000..097465f
--- /dev/null
+++ b/src/DevHive.Data/Migrations/20210119182404_LangAndUser-ManyToMany.cs
@@ -0,0 +1,188 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace DevHive.Data.Migrations
+{
+ public partial class LangAndUserManyToMany : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_Languages_AspNetUsers_UserId",
+ table: "Languages");
+
+ migrationBuilder.DropForeignKey(
+ name: "FK_Technologies_AspNetUsers_UserId",
+ table: "Technologies");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Technologies_UserId",
+ table: "Technologies");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Languages_UserId",
+ table: "Languages");
+
+ migrationBuilder.DropColumn(
+ name: "UserId",
+ table: "Technologies");
+
+ migrationBuilder.DropColumn(
+ name: "UserId",
+ table: "Languages");
+
+ migrationBuilder.AddColumn<Guid>(
+ name: "PostId",
+ table: "Comments",
+ type: "uuid",
+ nullable: true);
+
+ migrationBuilder.CreateTable(
+ name: "LanguageUser",
+ columns: table => new
+ {
+ LanguagesId = table.Column<Guid>(type: "uuid", nullable: false),
+ UsersId = table.Column<Guid>(type: "uuid", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_LanguageUser", x => new { x.LanguagesId, x.UsersId });
+ table.ForeignKey(
+ name: "FK_LanguageUser_AspNetUsers_UsersId",
+ column: x => x.UsersId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_LanguageUser_Languages_LanguagesId",
+ column: x => x.LanguagesId,
+ principalTable: "Languages",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Posts",
+ columns: table => new
+ {
+ Id = table.Column<Guid>(type: "uuid", nullable: false),
+ IssuerId = table.Column<Guid>(type: "uuid", nullable: false),
+ TimeCreated = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
+ Message = table.Column<string>(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Posts", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "TechnologyUser",
+ columns: table => new
+ {
+ TechnologiesId = table.Column<Guid>(type: "uuid", nullable: false),
+ UsersId = table.Column<Guid>(type: "uuid", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_TechnologyUser", x => new { x.TechnologiesId, x.UsersId });
+ table.ForeignKey(
+ name: "FK_TechnologyUser_AspNetUsers_UsersId",
+ column: x => x.UsersId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_TechnologyUser_Technologies_TechnologiesId",
+ column: x => x.TechnologiesId,
+ principalTable: "Technologies",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Comments_PostId",
+ table: "Comments",
+ column: "PostId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_LanguageUser_UsersId",
+ table: "LanguageUser",
+ column: "UsersId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_TechnologyUser_UsersId",
+ table: "TechnologyUser",
+ column: "UsersId");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Comments_Posts_PostId",
+ table: "Comments",
+ column: "PostId",
+ principalTable: "Posts",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_Comments_Posts_PostId",
+ table: "Comments");
+
+ migrationBuilder.DropTable(
+ name: "LanguageUser");
+
+ migrationBuilder.DropTable(
+ name: "Posts");
+
+ migrationBuilder.DropTable(
+ name: "TechnologyUser");
+
+ migrationBuilder.DropIndex(
+ name: "IX_Comments_PostId",
+ table: "Comments");
+
+ migrationBuilder.DropColumn(
+ name: "PostId",
+ table: "Comments");
+
+ migrationBuilder.AddColumn<Guid>(
+ name: "UserId",
+ table: "Technologies",
+ type: "uuid",
+ nullable: true);
+
+ migrationBuilder.AddColumn<Guid>(
+ name: "UserId",
+ table: "Languages",
+ type: "uuid",
+ nullable: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Technologies_UserId",
+ table: "Technologies",
+ column: "UserId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Languages_UserId",
+ table: "Languages",
+ column: "UserId");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Languages_AspNetUsers_UserId",
+ table: "Languages",
+ column: "UserId",
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_Technologies_AspNetUsers_UserId",
+ table: "Technologies",
+ column: "UserId",
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ }
+ }
+}
diff --git a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
index 7197c81..82b96cd 100644
--- a/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
+++ b/src/DevHive.Data/Migrations/DevHiveContextModelSnapshot.cs
@@ -8,396 +8,465 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DevHive.Data.Migrations
{
- [DbContext(typeof(DevHiveContext))]
- partial class DevHiveContextModelSnapshot : ModelSnapshot
- {
- protected override void BuildModel(ModelBuilder modelBuilder)
- {
+ [DbContext(typeof(DevHiveContext))]
+ partial class DevHiveContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
#pragma warning disable 612, 618
- modelBuilder
- .UseIdentityByDefaultColumns()
- .HasAnnotation("Relational:MaxIdentifierLength", 63)
- .HasAnnotation("ProductVersion", "5.0.1");
+ modelBuilder
+ .UseIdentityByDefaultColumns()
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.1");
- modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<Guid>("IssuerId")
- .HasColumnType("uuid");
+ b.Property<Guid>("IssuerId")
+ .HasColumnType("uuid");
- b.Property<string>("Message")
- .HasColumnType("text");
+ b.Property<string>("Message")
+ .HasColumnType("text");
- b.Property<DateTime>("TimeCreated")
- .HasColumnType("timestamp without time zone");
+ b.Property<Guid?>("PostId")
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.Property<DateTime>("TimeCreated")
+ .HasColumnType("timestamp without time zone");
- b.ToTable("Comments");
- });
+ b.HasKey("Id");
- modelBuilder.Entity("DevHive.Data.Models.Language", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ b.HasIndex("PostId");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.ToTable("Comments");
+ });
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Language", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.HasKey("Id");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.HasIndex("UserId");
+ b.HasKey("Id");
- b.ToTable("Languages");
- });
+ b.ToTable("Languages");
+ });
- modelBuilder.Entity("DevHive.Data.Models.Role", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Post", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.Property<Guid>("IssuerId")
+ .HasColumnType("uuid");
- b.Property<string>("Name")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("Message")
+ .HasColumnType("text");
- b.Property<string>("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<DateTime>("TimeCreated")
+ .HasColumnType("timestamp without time zone");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
+ b.ToTable("Posts");
+ });
- b.ToTable("AspNetRoles");
- });
+ modelBuilder.Entity("DevHive.Data.Models.Role", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<string>("Name")
- .HasColumnType("text");
+ b.Property<string>("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ b.Property<string>("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasKey("Id");
+ b.HasKey("Id");
- b.HasIndex("UserId");
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
- b.ToTable("Technologies");
- });
+ b.ToTable("AspNetRoles");
+ });
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Property<Guid>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("uuid");
+ modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<int>("AccessFailedCount")
- .HasColumnType("integer");
+ b.Property<string>("Name")
+ .HasColumnType("text");
- b.Property<string>("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text");
+ b.HasKey("Id");
- b.Property<string>("Email")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.ToTable("Technologies");
+ });
- b.Property<bool>("EmailConfirmed")
- .HasColumnType("boolean");
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Property<Guid>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uuid");
- b.Property<string>("FirstName")
- .HasColumnType("text");
+ b.Property<int>("AccessFailedCount")
+ .HasColumnType("integer");
- b.Property<string>("LastName")
- .HasColumnType("text");
+ b.Property<string>("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
- b.Property<bool>("LockoutEnabled")
- .HasColumnType("boolean");
+ b.Property<string>("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<DateTimeOffset?>("LockoutEnd")
- .HasColumnType("timestamp with time zone");
+ b.Property<bool>("EmailConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("FirstName")
+ .HasColumnType("text");
- b.Property<string>("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("LastName")
+ .HasColumnType("text");
- b.Property<string>("PasswordHash")
- .HasColumnType("text");
+ b.Property<bool>("LockoutEnabled")
+ .HasColumnType("boolean");
- b.Property<string>("PhoneNumber")
- .HasColumnType("text");
+ b.Property<DateTimeOffset?>("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
- b.Property<bool>("PhoneNumberConfirmed")
- .HasColumnType("boolean");
+ b.Property<string>("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("ProfilePictureUrl")
- .HasColumnType("text");
+ b.Property<string>("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.Property<string>("SecurityStamp")
- .HasColumnType("text");
+ b.Property<string>("PasswordHash")
+ .HasColumnType("text");
- b.Property<bool>("TwoFactorEnabled")
- .HasColumnType("boolean");
+ b.Property<string>("PhoneNumber")
+ .HasColumnType("text");
- b.Property<Guid?>("UserId")
- .HasColumnType("uuid");
+ b.Property<bool>("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
- b.Property<string>("UserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)");
+ b.Property<string>("ProfilePictureUrl")
+ .HasColumnType("text");
- b.HasKey("Id");
+ b.Property<string>("SecurityStamp")
+ .HasColumnType("text");
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
+ b.Property<bool>("TwoFactorEnabled")
+ .HasColumnType("boolean");
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
+ b.Property<Guid?>("UserId")
+ .HasColumnType("uuid");
- b.HasIndex("UserId");
+ b.Property<string>("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
- b.HasIndex("UserName")
- .IsUnique();
+ b.HasKey("Id");
- b.ToTable("AspNetUsers");
- });
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.HasIndex("UserId");
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ b.HasIndex("UserName")
+ .IsUnique();
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.ToTable("AspNetUsers");
+ });
- b.HasKey("Id");
+ modelBuilder.Entity("LanguageUser", b =>
+ {
+ b.Property<Guid>("LanguagesId")
+ .HasColumnType("uuid");
- b.HasIndex("RoleId");
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
- b.ToTable("AspNetRoleClaims");
- });
+ b.HasKey("LanguagesId", "UsersId");
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.Property<int>("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("integer")
- .UseIdentityByDefaultColumn();
+ b.HasIndex("UsersId");
- b.Property<string>("ClaimType")
- .HasColumnType("text");
+ b.ToTable("LanguageUser");
+ });
- b.Property<string>("ClaimValue")
- .HasColumnType("text");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.HasKey("Id");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.HasIndex("UserId");
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
- b.ToTable("AspNetUserClaims");
- });
+ b.HasKey("Id");
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ b.HasIndex("RoleId");
- b.Property<string>("ProviderKey")
- .HasColumnType("text");
+ b.ToTable("AspNetRoleClaims");
+ });
- b.Property<string>("ProviderDisplayName")
- .HasColumnType("text");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.Property<int>("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<string>("ClaimType")
+ .HasColumnType("text");
- b.HasKey("LoginProvider", "ProviderKey");
+ b.Property<string>("ClaimValue")
+ .HasColumnType("text");
- b.HasIndex("UserId");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.ToTable("AspNetUserLogins");
- });
+ b.HasKey("Id");
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.HasIndex("UserId");
- b.Property<Guid>("RoleId")
- .HasColumnType("uuid");
+ b.ToTable("AspNetUserClaims");
+ });
- b.HasKey("UserId", "RoleId");
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
- b.HasIndex("RoleId");
+ b.Property<string>("ProviderKey")
+ .HasColumnType("text");
- b.ToTable("AspNetUserRoles");
- });
+ b.Property<string>("ProviderDisplayName")
+ .HasColumnType("text");
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.Property<Guid>("UserId")
- .HasColumnType("uuid");
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
- b.Property<string>("LoginProvider")
- .HasColumnType("text");
+ b.HasKey("LoginProvider", "ProviderKey");
- b.Property<string>("Name")
- .HasColumnType("text");
-
- b.Property<string>("Value")
- .HasColumnType("text");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens");
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.Property<Guid>("RolesId")
- .HasColumnType("uuid");
-
- b.Property<Guid>("UsersId")
- .HasColumnType("uuid");
-
- b.HasKey("RolesId", "UsersId");
-
- b.HasIndex("UsersId");
-
- b.ToTable("RoleUser");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.Language", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Languages")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.Technology", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Technologies")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany("Friends")
- .HasForeignKey("UserId");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
- {
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("RoleUser", b =>
- {
- b.HasOne("DevHive.Data.Models.Role", null)
- .WithMany()
- .HasForeignKey("RolesId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("DevHive.Data.Models.User", null)
- .WithMany()
- .HasForeignKey("UsersId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("DevHive.Data.Models.User", b =>
- {
- b.Navigation("Friends");
-
- b.Navigation("Languages");
-
- b.Navigation("Technologies");
- });
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("RoleId")
+ .HasColumnType("uuid");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.Property<Guid>("UserId")
+ .HasColumnType("uuid");
+
+ b.Property<string>("LoginProvider")
+ .HasColumnType("text");
+
+ b.Property<string>("Name")
+ .HasColumnType("text");
+
+ b.Property<string>("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens");
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.Property<Guid>("RolesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("RolesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("RoleUser");
+ });
+
+ modelBuilder.Entity("TechnologyUser", b =>
+ {
+ b.Property<Guid>("TechnologiesId")
+ .HasColumnType("uuid");
+
+ b.Property<Guid>("UsersId")
+ .HasColumnType("uuid");
+
+ b.HasKey("TechnologiesId", "UsersId");
+
+ b.HasIndex("UsersId");
+
+ b.ToTable("TechnologyUser");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Comment", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Post", null)
+ .WithMany("Comments")
+ .HasForeignKey("PostId");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany("Friends")
+ .HasForeignKey("UserId");
+ });
+
+ modelBuilder.Entity("LanguageUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Language", null)
+ .WithMany()
+ .HasForeignKey("LanguagesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
+ {
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("RoleUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Role", null)
+ .WithMany()
+ .HasForeignKey("RolesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("TechnologyUser", b =>
+ {
+ b.HasOne("DevHive.Data.Models.Technology", null)
+ .WithMany()
+ .HasForeignKey("TechnologiesId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("DevHive.Data.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UsersId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.Post", b =>
+ {
+ b.Navigation("Comments");
+ });
+
+ modelBuilder.Entity("DevHive.Data.Models.User", b =>
+ {
+ b.Navigation("Friends");
+ });
#pragma warning restore 612, 618
- }
- }
+ }
+ }
}
diff --git a/src/DevHive.Data/Models/Language.cs b/src/DevHive.Data/Models/Language.cs
index 2983107..0db8cb6 100644
--- a/src/DevHive.Data/Models/Language.cs
+++ b/src/DevHive.Data/Models/Language.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using DevHive.Data.Interfaces.Models;
namespace DevHive.Data.Models
@@ -7,5 +8,6 @@ namespace DevHive.Data.Models
{
public Guid Id { get; set; }
public string Name { get; set; }
+ public List<User> Users { get; set; }
}
}
diff --git a/src/DevHive.Data/Models/Technology.cs b/src/DevHive.Data/Models/Technology.cs
index 36cec32..9096cbe 100644
--- a/src/DevHive.Data/Models/Technology.cs
+++ b/src/DevHive.Data/Models/Technology.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using DevHive.Data.Interfaces.Models;
namespace DevHive.Data.Models
@@ -7,5 +8,6 @@ namespace DevHive.Data.Models
{
public Guid Id { get; set; }
public string Name { get; set; }
+ public List<User> Users { get; set; }
}
}