diff options
| author | transtrike <transtrike@gmail.com> | 2020-12-12 16:12:23 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2020-12-12 16:12:23 +0200 |
| commit | 64e02c270d2911e85ea82b601e2aa251400fbcd0 (patch) | |
| tree | e8163494fe55a1051c7d488b928aa8a243e982a3 | |
| parent | 9fe564d452af7d5023cc410cd26761ba05730dc3 (diff) | |
| download | DevHive-64e02c270d2911e85ea82b601e2aa251400fbcd0.tar DevHive-64e02c270d2911e85ea82b601e2aa251400fbcd0.tar.gz DevHive-64e02c270d2911e85ea82b601e2aa251400fbcd0.zip | |
Merge with authorization-dev completed
| -rw-r--r-- | API/Migrations/20201211193121_UserRole.cs | 17 | ||||
| -rw-r--r-- | API/Migrations/20201212135453_JWT_Authorization_Added.Designer.cs | 314 | ||||
| -rw-r--r-- | API/Migrations/20201212135453_JWT_Authorization_Added.cs | 17 | ||||
| -rw-r--r-- | API/Migrations/20201212140557_Authorization_Added.Designer.cs (renamed from API/Migrations/20201211193121_UserRole.Designer.cs) | 4 | ||||
| -rw-r--r-- | API/Migrations/20201212140557_Authorization_Added.cs | 33 | ||||
| -rw-r--r-- | Data/Models/Classes/User.cs | 2 |
6 files changed, 36 insertions, 351 deletions
diff --git a/API/Migrations/20201211193121_UserRole.cs b/API/Migrations/20201211193121_UserRole.cs deleted file mode 100644 index d934cc1..0000000 --- a/API/Migrations/20201211193121_UserRole.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace API.Migrations -{ - public partial class UserRole : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/API/Migrations/20201212135453_JWT_Authorization_Added.Designer.cs b/API/Migrations/20201212135453_JWT_Authorization_Added.Designer.cs deleted file mode 100644 index aa90eb2..0000000 --- a/API/Migrations/20201212135453_JWT_Authorization_Added.Designer.cs +++ /dev/null @@ -1,314 +0,0 @@ -// <auto-generated /> -using System; -using API.Database; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -namespace API.Migrations -{ - [DbContext(typeof(DevHiveContext))] - [Migration("20201212135453_JWT_Authorization_Added")] - partial class JWT_Authorization_Added - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityByDefaultColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 63) - .HasAnnotation("ProductVersion", "5.0.1"); - - modelBuilder.Entity("Data.Models.Classes.Language", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.HasKey("Id"); - - b.ToTable("Languages"); - }); - - modelBuilder.Entity("Data.Models.Classes.Technology", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.HasKey("Id"); - - b.ToTable("Technologies"); - }); - - modelBuilder.Entity("Data.Models.Classes.User", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - 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") - .IsRequired() - .HasColumnType("text"); - - b.Property<string>("LastName") - .IsRequired() - .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>("ProfilePicture") - .HasColumnType("text"); - - b.Property<string>("Role") - .HasColumnType("text"); - - b.Property<string>("SecurityStamp") - .HasColumnType("text"); - - b.Property<bool>("TwoFactorEnabled") - .HasColumnType("boolean"); - - b.Property<string>("UserName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex"); - - b.HasIndex("UserName") - .IsUnique(); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Data.Models.Classes.UserRoles", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - 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("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property<string>("ClaimType") - .HasColumnType("text"); - - b.Property<string>("ClaimValue") - .HasColumnType("text"); - - b.Property<int>("RoleId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .UseIdentityByDefaultColumn(); - - b.Property<string>("ClaimType") - .HasColumnType("text"); - - b.Property<string>("ClaimValue") - .HasColumnType("text"); - - b.Property<int>("UserId") - .HasColumnType("integer"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b => - { - b.Property<string>("LoginProvider") - .HasColumnType("text"); - - b.Property<string>("ProviderKey") - .HasColumnType("text"); - - b.Property<string>("ProviderDisplayName") - .HasColumnType("text"); - - b.Property<int>("UserId") - .HasColumnType("integer"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b => - { - b.Property<int>("UserId") - .HasColumnType("integer"); - - b.Property<int>("RoleId") - .HasColumnType("integer"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b => - { - b.Property<int>("UserId") - .HasColumnType("integer"); - - 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("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b => - { - b.HasOne("Data.Models.Classes.UserRoles", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b => - { - b.HasOne("Data.Models.Classes.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b => - { - b.HasOne("Data.Models.Classes.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b => - { - b.HasOne("Data.Models.Classes.UserRoles", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Data.Models.Classes.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b => - { - b.HasOne("Data.Models.Classes.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/API/Migrations/20201212135453_JWT_Authorization_Added.cs b/API/Migrations/20201212135453_JWT_Authorization_Added.cs deleted file mode 100644 index b55418a..0000000 --- a/API/Migrations/20201212135453_JWT_Authorization_Added.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace API.Migrations -{ - public partial class JWT_Authorization_Added : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - - } - } -} diff --git a/API/Migrations/20201211193121_UserRole.Designer.cs b/API/Migrations/20201212140557_Authorization_Added.Designer.cs index eb5dead..fc50835 100644 --- a/API/Migrations/20201211193121_UserRole.Designer.cs +++ b/API/Migrations/20201212140557_Authorization_Added.Designer.cs @@ -10,8 +10,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace API.Migrations { [DbContext(typeof(DevHiveContext))] - [Migration("20201211193121_UserRole")] - partial class UserRole + [Migration("20201212140557_Authorization_Added")] + partial class Authorization_Added { protected override void BuildTargetModel(ModelBuilder modelBuilder) { diff --git a/API/Migrations/20201212140557_Authorization_Added.cs b/API/Migrations/20201212140557_Authorization_Added.cs new file mode 100644 index 0000000..4ed508e --- /dev/null +++ b/API/Migrations/20201212140557_Authorization_Added.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace API.Migrations +{ + public partial class Authorization_Added : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn<string>( + name: "Role", + table: "AspNetUsers", + type: "text", + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUsers_UserName", + table: "AspNetUsers", + column: "UserName", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_AspNetUsers_UserName", + table: "AspNetUsers"); + + migrationBuilder.DropColumn( + name: "Role", + table: "AspNetUsers"); + } + } +} diff --git a/Data/Models/Classes/User.cs b/Data/Models/Classes/User.cs index 44d2a60..50ceb1e 100644 --- a/Data/Models/Classes/User.cs +++ b/Data/Models/Classes/User.cs @@ -60,7 +60,7 @@ namespace Data.Models.Classes } } - public Roles Role { get; set; } + public string Role { get; set; } // public List<User> Friends { get; set; } |
