Fix migrations for new identity server, fix new program template for dotnetcore2
This commit is contained in:
parent
aed97fdc99
commit
4f8ca3eebb
@ -1,246 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Identity.API.Data;
|
|
||||||
|
|
||||||
namespace WebMVC.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
|
||||||
[Migration("20161020101725_extendProfile")]
|
|
||||||
partial class extendProfile
|
|
||||||
{
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
|
|
||||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id");
|
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
|
||||||
.IsConcurrencyToken();
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("NormalizedName")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("NormalizedName")
|
|
||||||
.HasName("RoleNameIndex");
|
|
||||||
|
|
||||||
b.ToTable("AspNetRoles");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd();
|
|
||||||
|
|
||||||
b.Property<string>("ClaimType");
|
|
||||||
|
|
||||||
b.Property<string>("ClaimValue");
|
|
||||||
|
|
||||||
b.Property<string>("RoleId")
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("RoleId");
|
|
||||||
|
|
||||||
b.ToTable("AspNetRoleClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd();
|
|
||||||
|
|
||||||
b.Property<string>("ClaimType");
|
|
||||||
|
|
||||||
b.Property<string>("ClaimValue");
|
|
||||||
|
|
||||||
b.Property<string>("UserId")
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUserClaims");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("LoginProvider");
|
|
||||||
|
|
||||||
b.Property<string>("ProviderKey");
|
|
||||||
|
|
||||||
b.Property<string>("ProviderDisplayName");
|
|
||||||
|
|
||||||
b.Property<string>("UserId")
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasKey("LoginProvider", "ProviderKey");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUserLogins");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("UserId");
|
|
||||||
|
|
||||||
b.Property<string>("RoleId");
|
|
||||||
|
|
||||||
b.HasKey("UserId", "RoleId");
|
|
||||||
|
|
||||||
b.HasIndex("RoleId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUserRoles");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("UserId");
|
|
||||||
|
|
||||||
b.Property<string>("LoginProvider");
|
|
||||||
|
|
||||||
b.Property<string>("Name");
|
|
||||||
|
|
||||||
b.Property<string>("Value");
|
|
||||||
|
|
||||||
b.HasKey("UserId", "LoginProvider", "Name");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUserTokens");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser", b =>
|
|
||||||
{
|
|
||||||
b.Property<string>("Id");
|
|
||||||
|
|
||||||
b.Property<int>("AccessFailedCount");
|
|
||||||
|
|
||||||
b.Property<string>("CardHolderName");
|
|
||||||
|
|
||||||
b.Property<string>("CardNumber");
|
|
||||||
|
|
||||||
b.Property<int>("CardType");
|
|
||||||
|
|
||||||
b.Property<string>("City");
|
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
|
||||||
.IsConcurrencyToken();
|
|
||||||
|
|
||||||
b.Property<string>("Country");
|
|
||||||
|
|
||||||
b.Property<string>("CountryCode");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<bool>("EmailConfirmed");
|
|
||||||
|
|
||||||
b.Property<string>("Expiration");
|
|
||||||
|
|
||||||
b.Property<string>("LastName");
|
|
||||||
|
|
||||||
b.Property<double>("Latitude");
|
|
||||||
|
|
||||||
b.Property<bool>("LockoutEnabled");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
|
||||||
|
|
||||||
b.Property<double>("Longitude");
|
|
||||||
|
|
||||||
b.Property<string>("Name");
|
|
||||||
|
|
||||||
b.Property<string>("NormalizedEmail")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("NormalizedUserName")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash");
|
|
||||||
|
|
||||||
b.Property<string>("PhoneNumber");
|
|
||||||
|
|
||||||
b.Property<bool>("PhoneNumberConfirmed");
|
|
||||||
|
|
||||||
b.Property<string>("SecurityNumber");
|
|
||||||
|
|
||||||
b.Property<string>("SecurityStamp");
|
|
||||||
|
|
||||||
b.Property<string>("State");
|
|
||||||
|
|
||||||
b.Property<string>("StateCode");
|
|
||||||
|
|
||||||
b.Property<string>("Street");
|
|
||||||
|
|
||||||
b.Property<bool>("TwoFactorEnabled");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("ZipCode");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("NormalizedEmail")
|
|
||||||
.HasName("EmailIndex");
|
|
||||||
|
|
||||||
b.HasIndex("NormalizedUserName")
|
|
||||||
.IsUnique()
|
|
||||||
.HasName("UserNameIndex");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUsers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
|
|
||||||
.WithMany("Claims")
|
|
||||||
.HasForeignKey("RoleId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
|
||||||
.WithMany("Claims")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
|
||||||
.WithMany("Logins")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
|
|
||||||
.WithMany("Users")
|
|
||||||
.HasForeignKey("RoleId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
|
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
|
||||||
.WithMany("Roles")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace WebMVC.Migrations
|
|
||||||
{
|
|
||||||
public partial class extendProfile : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "LastName",
|
|
||||||
table: "AspNetUsers",
|
|
||||||
nullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "Name",
|
|
||||||
table: "AspNetUsers",
|
|
||||||
nullable: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "LastName",
|
|
||||||
table: "AspNetUsers");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Name",
|
|
||||||
table: "AspNetUsers");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace Identity.API.Migrations
|
|
||||||
{
|
|
||||||
public partial class Initpersistedgrant : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "PersistedGrants",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Key = table.Column<string>(maxLength: 200, nullable: false),
|
|
||||||
ClientId = table.Column<string>(maxLength: 200, nullable: false),
|
|
||||||
CreationTime = table.Column<DateTime>(nullable: false),
|
|
||||||
Data = table.Column<string>(maxLength: 50000, nullable: false),
|
|
||||||
Expiration = table.Column<DateTime>(nullable: true),
|
|
||||||
SubjectId = table.Column<string>(maxLength: 200, nullable: true),
|
|
||||||
Type = table.Column<string>(maxLength: 50, nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_PersistedGrants", x => x.Key);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_PersistedGrants_SubjectId_ClientId_Type",
|
|
||||||
table: "PersistedGrants",
|
|
||||||
columns: new[] { "SubjectId", "ClientId", "Type" });
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "PersistedGrants");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +1,137 @@
|
|||||||
using System;
|
// <auto-generated />
|
||||||
|
using Identity.API.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Identity.API.Data;
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace WebMVC.Migrations
|
namespace Identity.API.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
[Migration("20161019122215_Init_Scheme")]
|
[Migration("20170912114036_Initial")]
|
||||||
partial class Init_Scheme
|
partial class Initial
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
|
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
|
||||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
|
modelBuilder.Entity("Identity.API.Models.ApplicationUser", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Id");
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount");
|
||||||
|
|
||||||
|
b.Property<string>("CardHolderName")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("CardNumber")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<int>("CardType");
|
||||||
|
|
||||||
|
b.Property<string>("City")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken();
|
||||||
|
|
||||||
|
b.Property<string>("Country")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed");
|
||||||
|
|
||||||
|
b.Property<string>("Expiration")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("LastName")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityNumber")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp");
|
||||||
|
|
||||||
|
b.Property<string>("State")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("Street")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<string>("ZipCode")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasName("UserNameIndex")
|
||||||
|
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUsers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
b.Property<string>("ConcurrencyStamp")
|
||||||
.IsConcurrencyToken();
|
.IsConcurrencyToken();
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasAnnotation("MaxLength", 256);
|
.HasMaxLength(256);
|
||||||
|
|
||||||
b.Property<string>("NormalizedName")
|
b.Property<string>("NormalizedName")
|
||||||
.HasAnnotation("MaxLength", 256);
|
.HasMaxLength(256);
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("NormalizedName")
|
b.HasIndex("NormalizedName")
|
||||||
.HasName("RoleNameIndex");
|
.IsUnique()
|
||||||
|
.HasName("RoleNameIndex")
|
||||||
|
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||||
|
|
||||||
b.ToTable("AspNetRoles");
|
b.ToTable("AspNetRoles");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
@ -57,7 +150,7 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetRoleClaims");
|
b.ToTable("AspNetRoleClaims");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
@ -76,7 +169,7 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetUserClaims");
|
b.ToTable("AspNetUserClaims");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("LoginProvider");
|
b.Property<string>("LoginProvider");
|
||||||
|
|
||||||
@ -94,7 +187,7 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetUserLogins");
|
b.ToTable("AspNetUserLogins");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("UserId");
|
b.Property<string>("UserId");
|
||||||
|
|
||||||
@ -104,12 +197,10 @@ namespace WebMVC.Migrations
|
|||||||
|
|
||||||
b.HasIndex("RoleId");
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUserRoles");
|
b.ToTable("AspNetUserRoles");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("UserId");
|
b.Property<string>("UserId");
|
||||||
|
|
||||||
@ -124,119 +215,51 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetUserTokens");
|
b.ToTable("AspNetUserTokens");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Id");
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
|
||||||
|
.WithMany()
|
||||||
b.Property<int>("AccessFailedCount");
|
|
||||||
|
|
||||||
b.Property<string>("CardHolderName");
|
|
||||||
|
|
||||||
b.Property<string>("CardNumber");
|
|
||||||
|
|
||||||
b.Property<int>("CardType");
|
|
||||||
|
|
||||||
b.Property<string>("City");
|
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
|
||||||
.IsConcurrencyToken();
|
|
||||||
|
|
||||||
b.Property<string>("Country");
|
|
||||||
|
|
||||||
b.Property<string>("CountryCode");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<bool>("EmailConfirmed");
|
|
||||||
|
|
||||||
b.Property<string>("Expiration");
|
|
||||||
|
|
||||||
b.Property<double>("Latitude");
|
|
||||||
|
|
||||||
b.Property<bool>("LockoutEnabled");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
|
||||||
|
|
||||||
b.Property<double>("Longitude");
|
|
||||||
|
|
||||||
b.Property<string>("NormalizedEmail")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("NormalizedUserName")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash");
|
|
||||||
|
|
||||||
b.Property<string>("PhoneNumber");
|
|
||||||
|
|
||||||
b.Property<bool>("PhoneNumberConfirmed");
|
|
||||||
|
|
||||||
b.Property<string>("SecurityNumber");
|
|
||||||
|
|
||||||
b.Property<string>("SecurityStamp");
|
|
||||||
|
|
||||||
b.Property<string>("State");
|
|
||||||
|
|
||||||
b.Property<string>("StateCode");
|
|
||||||
|
|
||||||
b.Property<string>("Street");
|
|
||||||
|
|
||||||
b.Property<bool>("TwoFactorEnabled");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("ZipCode");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("NormalizedEmail")
|
|
||||||
.HasName("EmailIndex");
|
|
||||||
|
|
||||||
b.HasIndex("NormalizedUserName")
|
|
||||||
.IsUnique()
|
|
||||||
.HasName("UserNameIndex");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUsers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
|
|
||||||
.WithMany("Claims")
|
|
||||||
.HasForeignKey("RoleId")
|
.HasForeignKey("RoleId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
.WithMany("Claims")
|
.WithMany()
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
.WithMany("Logins")
|
.WithMany()
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
|
||||||
.WithMany("Users")
|
.WithMany()
|
||||||
.HasForeignKey("RoleId")
|
.HasForeignKey("RoleId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
.WithMany("Roles")
|
.WithMany()
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,11 +1,11 @@
|
|||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace WebMVC.Migrations
|
namespace Identity.API.Migrations
|
||||||
{
|
{
|
||||||
public partial class Init_Scheme : Migration
|
public partial class Initial : Migration
|
||||||
{
|
{
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
@ -13,59 +13,47 @@ namespace WebMVC.Migrations
|
|||||||
name: "AspNetRoles",
|
name: "AspNetRoles",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<string>(nullable: false),
|
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
ConcurrencyStamp = table.Column<string>(nullable: true),
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
Name = table.Column<string>(maxLength: 256, nullable: true),
|
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
NormalizedName = table.Column<string>(maxLength: 256, nullable: true)
|
NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
|
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "AspNetUserTokens",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
UserId = table.Column<string>(nullable: false),
|
|
||||||
LoginProvider = table.Column<string>(nullable: false),
|
|
||||||
Name = table.Column<string>(nullable: false),
|
|
||||||
Value = table.Column<string>(nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "AspNetUsers",
|
name: "AspNetUsers",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<string>(nullable: false),
|
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
AccessFailedCount = table.Column<int>(nullable: false),
|
AccessFailedCount = table.Column<int>(type: "int", nullable: false),
|
||||||
CardHolderName = table.Column<string>(nullable: true),
|
CardHolderName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
CardNumber = table.Column<string>(nullable: true),
|
CardNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
CardType = table.Column<int>(nullable: false),
|
CardType = table.Column<int>(type: "int", nullable: false),
|
||||||
City = table.Column<string>(nullable: true),
|
City = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
ConcurrencyStamp = table.Column<string>(nullable: true),
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
Country = table.Column<string>(nullable: true),
|
Country = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
Email = table.Column<string>(maxLength: 256, nullable: true),
|
Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
EmailConfirmed = table.Column<bool>(nullable: false),
|
EmailConfirmed = table.Column<bool>(type: "bit", nullable: false),
|
||||||
Expiration = table.Column<string>(nullable: true),
|
Expiration = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
LockoutEnabled = table.Column<bool>(nullable: false),
|
LastName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
|
LockoutEnabled = table.Column<bool>(type: "bit", nullable: false),
|
||||||
NormalizedEmail = table.Column<string>(maxLength: 256, nullable: true),
|
LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
|
||||||
NormalizedUserName = table.Column<string>(maxLength: 256, nullable: true),
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
PasswordHash = table.Column<string>(nullable: true),
|
NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
PhoneNumber = table.Column<string>(nullable: true),
|
NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
PhoneNumberConfirmed = table.Column<bool>(nullable: false),
|
PasswordHash = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
SecurityNumber = table.Column<string>(nullable: true),
|
PhoneNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
SecurityStamp = table.Column<string>(nullable: true),
|
PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false),
|
||||||
State = table.Column<string>(nullable: true),
|
SecurityNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
Street = table.Column<string>(nullable: true),
|
SecurityStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
TwoFactorEnabled = table.Column<bool>(nullable: false),
|
State = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
UserName = table.Column<string>(maxLength: 256, nullable: true),
|
Street = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
ZipCode = table.Column<string>(nullable: true)
|
TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
||||||
|
ZipCode = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -76,11 +64,11 @@ namespace WebMVC.Migrations
|
|||||||
name: "AspNetRoleClaims",
|
name: "AspNetRoleClaims",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClaimType = table.Column<string>(nullable: true),
|
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
ClaimValue = table.Column<string>(nullable: true),
|
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
RoleId = table.Column<string>(nullable: false)
|
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -97,11 +85,11 @@ namespace WebMVC.Migrations
|
|||||||
name: "AspNetUserClaims",
|
name: "AspNetUserClaims",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClaimType = table.Column<string>(nullable: true),
|
ClaimType = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
ClaimValue = table.Column<string>(nullable: true),
|
ClaimValue = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
UserId = table.Column<string>(nullable: false)
|
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -118,10 +106,10 @@ namespace WebMVC.Migrations
|
|||||||
name: "AspNetUserLogins",
|
name: "AspNetUserLogins",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
LoginProvider = table.Column<string>(nullable: false),
|
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
ProviderKey = table.Column<string>(nullable: false),
|
ProviderKey = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
ProviderDisplayName = table.Column<string>(nullable: true),
|
ProviderDisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
UserId = table.Column<string>(nullable: false)
|
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -138,8 +126,8 @@ namespace WebMVC.Migrations
|
|||||||
name: "AspNetUserRoles",
|
name: "AspNetUserRoles",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
UserId = table.Column<string>(nullable: false),
|
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
RoleId = table.Column<string>(nullable: false)
|
RoleId = table.Column<string>(type: "nvarchar(450)", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -158,16 +146,38 @@ namespace WebMVC.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateTable(
|
||||||
name: "RoleNameIndex",
|
name: "AspNetUserTokens",
|
||||||
table: "AspNetRoles",
|
columns: table => new
|
||||||
column: "NormalizedName");
|
{
|
||||||
|
UserId = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
|
LoginProvider = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||||
|
Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_AspNetRoleClaims_RoleId",
|
name: "IX_AspNetRoleClaims_RoleId",
|
||||||
table: "AspNetRoleClaims",
|
table: "AspNetRoleClaims",
|
||||||
column: "RoleId");
|
column: "RoleId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "RoleNameIndex",
|
||||||
|
table: "AspNetRoles",
|
||||||
|
column: "NormalizedName",
|
||||||
|
unique: true,
|
||||||
|
filter: "[NormalizedName] IS NOT NULL");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_AspNetUserClaims_UserId",
|
name: "IX_AspNetUserClaims_UserId",
|
||||||
table: "AspNetUserClaims",
|
table: "AspNetUserClaims",
|
||||||
@ -183,11 +193,6 @@ namespace WebMVC.Migrations
|
|||||||
table: "AspNetUserRoles",
|
table: "AspNetUserRoles",
|
||||||
column: "RoleId");
|
column: "RoleId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_AspNetUserRoles_UserId",
|
|
||||||
table: "AspNetUserRoles",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "EmailIndex",
|
name: "EmailIndex",
|
||||||
table: "AspNetUsers",
|
table: "AspNetUsers",
|
||||||
@ -197,7 +202,8 @@ namespace WebMVC.Migrations
|
|||||||
name: "UserNameIndex",
|
name: "UserNameIndex",
|
||||||
table: "AspNetUsers",
|
table: "AspNetUsers",
|
||||||
column: "NormalizedUserName",
|
column: "NormalizedUserName",
|
||||||
unique: true);
|
unique: true,
|
||||||
|
filter: "[NormalizedUserName] IS NOT NULL");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
@ -1,42 +1,136 @@
|
|||||||
using System;
|
// <auto-generated />
|
||||||
|
using Identity.API.Data;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Identity.API.Data;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace WebMVC.Migrations
|
namespace Identity.API.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ApplicationDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
|
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
|
||||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole", b =>
|
modelBuilder.Entity("Identity.API.Models.ApplicationUser", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Id");
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount");
|
||||||
|
|
||||||
|
b.Property<string>("CardHolderName")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("CardNumber")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<int>("CardType");
|
||||||
|
|
||||||
|
b.Property<string>("City")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken();
|
||||||
|
|
||||||
|
b.Property<string>("Country")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed");
|
||||||
|
|
||||||
|
b.Property<string>("Expiration")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("LastName")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityNumber")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp");
|
||||||
|
|
||||||
|
b.Property<string>("State")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("Street")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256);
|
||||||
|
|
||||||
|
b.Property<string>("ZipCode")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasName("UserNameIndex")
|
||||||
|
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUsers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
b.Property<string>("ConcurrencyStamp")
|
||||||
.IsConcurrencyToken();
|
.IsConcurrencyToken();
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasAnnotation("MaxLength", 256);
|
.HasMaxLength(256);
|
||||||
|
|
||||||
b.Property<string>("NormalizedName")
|
b.Property<string>("NormalizedName")
|
||||||
.HasAnnotation("MaxLength", 256);
|
.HasMaxLength(256);
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("NormalizedName")
|
b.HasIndex("NormalizedName")
|
||||||
.HasName("RoleNameIndex");
|
.IsUnique()
|
||||||
|
.HasName("RoleNameIndex")
|
||||||
|
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||||
|
|
||||||
b.ToTable("AspNetRoles");
|
b.ToTable("AspNetRoles");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
@ -55,7 +149,7 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetRoleClaims");
|
b.ToTable("AspNetRoleClaims");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
@ -74,7 +168,7 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetUserClaims");
|
b.ToTable("AspNetUserClaims");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("LoginProvider");
|
b.Property<string>("LoginProvider");
|
||||||
|
|
||||||
@ -92,7 +186,7 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetUserLogins");
|
b.ToTable("AspNetUserLogins");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("UserId");
|
b.Property<string>("UserId");
|
||||||
|
|
||||||
@ -102,12 +196,10 @@ namespace WebMVC.Migrations
|
|||||||
|
|
||||||
b.HasIndex("RoleId");
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUserRoles");
|
b.ToTable("AspNetUserRoles");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("UserId");
|
b.Property<string>("UserId");
|
||||||
|
|
||||||
@ -122,123 +214,51 @@ namespace WebMVC.Migrations
|
|||||||
b.ToTable("AspNetUserTokens");
|
b.ToTable("AspNetUserTokens");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Id");
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
|
||||||
|
.WithMany()
|
||||||
b.Property<int>("AccessFailedCount");
|
|
||||||
|
|
||||||
b.Property<string>("CardHolderName");
|
|
||||||
|
|
||||||
b.Property<string>("CardNumber");
|
|
||||||
|
|
||||||
b.Property<int>("CardType");
|
|
||||||
|
|
||||||
b.Property<string>("City");
|
|
||||||
|
|
||||||
b.Property<string>("ConcurrencyStamp")
|
|
||||||
.IsConcurrencyToken();
|
|
||||||
|
|
||||||
b.Property<string>("Country");
|
|
||||||
|
|
||||||
b.Property<string>("CountryCode");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<bool>("EmailConfirmed");
|
|
||||||
|
|
||||||
b.Property<string>("Expiration");
|
|
||||||
|
|
||||||
b.Property<string>("LastName");
|
|
||||||
|
|
||||||
b.Property<double>("Latitude");
|
|
||||||
|
|
||||||
b.Property<bool>("LockoutEnabled");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
|
||||||
|
|
||||||
b.Property<double>("Longitude");
|
|
||||||
|
|
||||||
b.Property<string>("Name");
|
|
||||||
|
|
||||||
b.Property<string>("NormalizedEmail")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("NormalizedUserName")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("PasswordHash");
|
|
||||||
|
|
||||||
b.Property<string>("PhoneNumber");
|
|
||||||
|
|
||||||
b.Property<bool>("PhoneNumberConfirmed");
|
|
||||||
|
|
||||||
b.Property<string>("SecurityNumber");
|
|
||||||
|
|
||||||
b.Property<string>("SecurityStamp");
|
|
||||||
|
|
||||||
b.Property<string>("State");
|
|
||||||
|
|
||||||
b.Property<string>("StateCode");
|
|
||||||
|
|
||||||
b.Property<string>("Street");
|
|
||||||
|
|
||||||
b.Property<bool>("TwoFactorEnabled");
|
|
||||||
|
|
||||||
b.Property<string>("UserName")
|
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<string>("ZipCode");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("NormalizedEmail")
|
|
||||||
.HasName("EmailIndex");
|
|
||||||
|
|
||||||
b.HasIndex("NormalizedUserName")
|
|
||||||
.IsUnique()
|
|
||||||
.HasName("UserNameIndex");
|
|
||||||
|
|
||||||
b.ToTable("AspNetUsers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<string>", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
|
|
||||||
.WithMany("Claims")
|
|
||||||
.HasForeignKey("RoleId")
|
.HasForeignKey("RoleId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
.WithMany("Claims")
|
.WithMany()
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
.WithMany("Logins")
|
.WithMany()
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserRole<string>", b =>
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole")
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
|
||||||
.WithMany("Users")
|
.WithMany()
|
||||||
.HasForeignKey("RoleId")
|
.HasForeignKey("RoleId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
|
||||||
b.HasOne("Microsoft.eShopOnContainers.WebMVC.ViewModels.ApplicationUser")
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
.WithMany("Roles")
|
.WithMany()
|
||||||
.HasForeignKey("UserId")
|
.HasForeignKey("UserId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Identity.API.Models.ApplicationUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,20 +1,24 @@
|
|||||||
using System;
|
// <auto-generated />
|
||||||
|
using IdentityServer4.EntityFramework.DbContexts;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using IdentityServer4.EntityFramework.DbContexts;
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Identity.API.Migrations.ConfigurationDb
|
namespace Identity.API.Migrations.ConfigurationDb
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ConfigurationDbContext))]
|
[DbContext(typeof(ConfigurationDbContext))]
|
||||||
[Migration("20170604151338_Init-configuration")]
|
[Migration("20170912114152_Initial")]
|
||||||
partial class Initconfiguration
|
partial class Initial
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "1.1.2")
|
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
|
||||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
|
||||||
@ -165,6 +169,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
|
|
||||||
b.Property<int>("AuthorizationCodeLifetime");
|
b.Property<int>("AuthorizationCodeLifetime");
|
||||||
|
|
||||||
|
b.Property<bool>("BackChannelLogoutSessionRequired");
|
||||||
|
|
||||||
|
b.Property<string>("BackChannelLogoutUri");
|
||||||
|
|
||||||
b.Property<string>("ClientId")
|
b.Property<string>("ClientId")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(200);
|
.HasMaxLength(200);
|
||||||
@ -175,19 +183,26 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
b.Property<string>("ClientUri")
|
b.Property<string>("ClientUri")
|
||||||
.HasMaxLength(2000);
|
.HasMaxLength(2000);
|
||||||
|
|
||||||
|
b.Property<int?>("ConsentLifetime");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(1000);
|
||||||
|
|
||||||
b.Property<bool>("EnableLocalLogin");
|
b.Property<bool>("EnableLocalLogin");
|
||||||
|
|
||||||
b.Property<bool>("Enabled");
|
b.Property<bool>("Enabled");
|
||||||
|
|
||||||
|
b.Property<bool>("FrontChannelLogoutSessionRequired");
|
||||||
|
|
||||||
|
b.Property<string>("FrontChannelLogoutUri");
|
||||||
|
|
||||||
b.Property<int>("IdentityTokenLifetime");
|
b.Property<int>("IdentityTokenLifetime");
|
||||||
|
|
||||||
b.Property<bool>("IncludeJwtId");
|
b.Property<bool>("IncludeJwtId");
|
||||||
|
|
||||||
b.Property<string>("LogoUri");
|
b.Property<string>("LogoUri");
|
||||||
|
|
||||||
b.Property<bool>("LogoutSessionRequired");
|
b.Property<string>("NormalizedClientId");
|
||||||
|
|
||||||
b.Property<string>("LogoutUri");
|
|
||||||
|
|
||||||
b.Property<bool>("PrefixClientClaims");
|
b.Property<bool>("PrefixClientClaims");
|
||||||
|
|
||||||
@ -316,6 +331,29 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
b.ToTable("ClientPostLogoutRedirectUris");
|
b.ToTable("ClientPostLogoutRedirectUris");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("ClientId")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("Key")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250);
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(2000);
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
|
b.ToTable("ClientProperties");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -503,6 +541,14 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
|
||||||
|
.WithMany("Properties")
|
||||||
|
.HasForeignKey("ClientId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
|
b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
|
||||||
@ -534,6 +580,7 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
.HasForeignKey("IdentityResourceId")
|
.HasForeignKey("IdentityResourceId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,11 +1,11 @@
|
|||||||
using System;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using System.Collections.Generic;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Identity.API.Migrations.ConfigurationDb
|
namespace Identity.API.Migrations.ConfigurationDb
|
||||||
{
|
{
|
||||||
public partial class Initconfiguration : Migration
|
public partial class Initial : Migration
|
||||||
{
|
{
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
@ -13,12 +13,12 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ApiResources",
|
name: "ApiResources",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
|
DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||||
Enabled = table.Column<bool>(nullable: false),
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||||||
Name = table.Column<string>(maxLength: 200, nullable: false)
|
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -29,37 +29,42 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "Clients",
|
name: "Clients",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false),
|
AbsoluteRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
|
||||||
AccessTokenLifetime = table.Column<int>(nullable: false),
|
AccessTokenLifetime = table.Column<int>(type: "int", nullable: false),
|
||||||
AccessTokenType = table.Column<int>(nullable: false),
|
AccessTokenType = table.Column<int>(type: "int", nullable: false),
|
||||||
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
|
AllowAccessTokensViaBrowser = table.Column<bool>(type: "bit", nullable: false),
|
||||||
AllowOfflineAccess = table.Column<bool>(nullable: false),
|
AllowOfflineAccess = table.Column<bool>(type: "bit", nullable: false),
|
||||||
AllowPlainTextPkce = table.Column<bool>(nullable: false),
|
AllowPlainTextPkce = table.Column<bool>(type: "bit", nullable: false),
|
||||||
AllowRememberConsent = table.Column<bool>(nullable: false),
|
AllowRememberConsent = table.Column<bool>(type: "bit", nullable: false),
|
||||||
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
|
AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(type: "bit", nullable: false),
|
||||||
AlwaysSendClientClaims = table.Column<bool>(nullable: false),
|
AlwaysSendClientClaims = table.Column<bool>(type: "bit", nullable: false),
|
||||||
AuthorizationCodeLifetime = table.Column<int>(nullable: false),
|
AuthorizationCodeLifetime = table.Column<int>(type: "int", nullable: false),
|
||||||
ClientId = table.Column<string>(maxLength: 200, nullable: false),
|
BackChannelLogoutSessionRequired = table.Column<bool>(type: "bit", nullable: false),
|
||||||
ClientName = table.Column<string>(maxLength: 200, nullable: true),
|
BackChannelLogoutUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
|
ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||||
EnableLocalLogin = table.Column<bool>(nullable: false),
|
ClientName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||||
Enabled = table.Column<bool>(nullable: false),
|
ClientUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
|
||||||
IdentityTokenLifetime = table.Column<int>(nullable: false),
|
ConsentLifetime = table.Column<int>(type: "int", nullable: true),
|
||||||
IncludeJwtId = table.Column<bool>(nullable: false),
|
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
LogoUri = table.Column<string>(nullable: true),
|
EnableLocalLogin = table.Column<bool>(type: "bit", nullable: false),
|
||||||
LogoutSessionRequired = table.Column<bool>(nullable: false),
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||||||
LogoutUri = table.Column<string>(nullable: true),
|
FrontChannelLogoutSessionRequired = table.Column<bool>(type: "bit", nullable: false),
|
||||||
PrefixClientClaims = table.Column<bool>(nullable: false),
|
FrontChannelLogoutUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
|
IdentityTokenLifetime = table.Column<int>(type: "int", nullable: false),
|
||||||
RefreshTokenExpiration = table.Column<int>(nullable: false),
|
IncludeJwtId = table.Column<bool>(type: "bit", nullable: false),
|
||||||
RefreshTokenUsage = table.Column<int>(nullable: false),
|
LogoUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
RequireClientSecret = table.Column<bool>(nullable: false),
|
NormalizedClientId = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||||
RequireConsent = table.Column<bool>(nullable: false),
|
PrefixClientClaims = table.Column<bool>(type: "bit", nullable: false),
|
||||||
RequirePkce = table.Column<bool>(nullable: false),
|
ProtocolType = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||||
SlidingRefreshTokenLifetime = table.Column<int>(nullable: false),
|
RefreshTokenExpiration = table.Column<int>(type: "int", nullable: false),
|
||||||
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false)
|
RefreshTokenUsage = table.Column<int>(type: "int", nullable: false),
|
||||||
|
RequireClientSecret = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
RequireConsent = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
RequirePkce = table.Column<bool>(type: "bit", nullable: false),
|
||||||
|
SlidingRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
|
||||||
|
UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(type: "bit", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -70,15 +75,15 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "IdentityResources",
|
name: "IdentityResources",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
|
DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||||
Emphasize = table.Column<bool>(nullable: false),
|
Emphasize = table.Column<bool>(type: "bit", nullable: false),
|
||||||
Enabled = table.Column<bool>(nullable: false),
|
Enabled = table.Column<bool>(type: "bit", nullable: false),
|
||||||
Name = table.Column<string>(maxLength: 200, nullable: false),
|
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||||
Required = table.Column<bool>(nullable: false),
|
Required = table.Column<bool>(type: "bit", nullable: false),
|
||||||
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
|
ShowInDiscoveryDocument = table.Column<bool>(type: "bit", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -89,10 +94,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ApiClaims",
|
name: "ApiClaims",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ApiResourceId = table.Column<int>(nullable: false),
|
ApiResourceId = table.Column<int>(type: "int", nullable: false),
|
||||||
Type = table.Column<string>(maxLength: 200, nullable: false)
|
Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -109,15 +114,15 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ApiScopes",
|
name: "ApiScopes",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ApiResourceId = table.Column<int>(nullable: false),
|
ApiResourceId = table.Column<int>(type: "int", nullable: false),
|
||||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
DisplayName = table.Column<string>(maxLength: 200, nullable: true),
|
DisplayName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||||
Emphasize = table.Column<bool>(nullable: false),
|
Emphasize = table.Column<bool>(type: "bit", nullable: false),
|
||||||
Name = table.Column<string>(maxLength: 200, nullable: false),
|
Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||||
Required = table.Column<bool>(nullable: false),
|
Required = table.Column<bool>(type: "bit", nullable: false),
|
||||||
ShowInDiscoveryDocument = table.Column<bool>(nullable: false)
|
ShowInDiscoveryDocument = table.Column<bool>(type: "bit", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -134,13 +139,13 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ApiSecrets",
|
name: "ApiSecrets",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ApiResourceId = table.Column<int>(nullable: false),
|
ApiResourceId = table.Column<int>(type: "int", nullable: false),
|
||||||
Description = table.Column<string>(maxLength: 1000, nullable: true),
|
Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
|
||||||
Expiration = table.Column<DateTime>(nullable: true),
|
Expiration = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
Type = table.Column<string>(maxLength: 250, nullable: true),
|
Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
|
||||||
Value = table.Column<string>(maxLength: 2000, nullable: true)
|
Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -157,11 +162,11 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ClientClaims",
|
name: "ClientClaims",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
Type = table.Column<string>(maxLength: 250, nullable: false),
|
Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
|
||||||
Value = table.Column<string>(maxLength: 250, nullable: false)
|
Value = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -178,10 +183,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ClientCorsOrigins",
|
name: "ClientCorsOrigins",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
Origin = table.Column<string>(maxLength: 150, nullable: false)
|
Origin = table.Column<string>(type: "nvarchar(150)", maxLength: 150, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -198,10 +203,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ClientGrantTypes",
|
name: "ClientGrantTypes",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
GrantType = table.Column<string>(maxLength: 250, nullable: false)
|
GrantType = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -218,10 +223,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ClientIdPRestrictions",
|
name: "ClientIdPRestrictions",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
Provider = table.Column<string>(maxLength: 200, nullable: false)
|
Provider = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -238,10 +243,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ClientPostLogoutRedirectUris",
|
name: "ClientPostLogoutRedirectUris",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
PostLogoutRedirectUri = table.Column<string>(maxLength: 2000, nullable: false)
|
PostLogoutRedirectUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -254,14 +259,35 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ClientProperties",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
|
Key = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
|
||||||
|
Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ClientProperties", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ClientProperties_Clients_ClientId",
|
||||||
|
column: x => x.ClientId,
|
||||||
|
principalTable: "Clients",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "ClientRedirectUris",
|
name: "ClientRedirectUris",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
RedirectUri = table.Column<string>(maxLength: 2000, nullable: false)
|
RedirectUri = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -278,10 +304,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ClientScopes",
|
name: "ClientScopes",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
Scope = table.Column<string>(maxLength: 200, nullable: false)
|
Scope = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -298,13 +324,13 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ClientSecrets",
|
name: "ClientSecrets",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ClientId = table.Column<int>(nullable: false),
|
ClientId = table.Column<int>(type: "int", nullable: false),
|
||||||
Description = table.Column<string>(maxLength: 2000, nullable: true),
|
Description = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
|
||||||
Expiration = table.Column<DateTime>(nullable: true),
|
Expiration = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
Type = table.Column<string>(maxLength: 250, nullable: true),
|
Type = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
|
||||||
Value = table.Column<string>(maxLength: 2000, nullable: false)
|
Value = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -321,10 +347,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "IdentityClaims",
|
name: "IdentityClaims",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
IdentityResourceId = table.Column<int>(nullable: false),
|
IdentityResourceId = table.Column<int>(type: "int", nullable: false),
|
||||||
Type = table.Column<string>(maxLength: 200, nullable: false)
|
Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -341,10 +367,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
name: "ApiScopeClaims",
|
name: "ApiScopeClaims",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
Id = table.Column<int>(nullable: false)
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||||
ApiScopeId = table.Column<int>(nullable: false),
|
ApiScopeId = table.Column<int>(type: "int", nullable: false),
|
||||||
Type = table.Column<string>(maxLength: 200, nullable: false)
|
Type = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -357,6 +383,11 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ApiClaims_ApiResourceId",
|
||||||
|
table: "ApiClaims",
|
||||||
|
column: "ApiResourceId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ApiResources_Name",
|
name: "IX_ApiResources_Name",
|
||||||
table: "ApiResources",
|
table: "ApiResources",
|
||||||
@ -364,9 +395,9 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ApiClaims_ApiResourceId",
|
name: "IX_ApiScopeClaims_ApiScopeId",
|
||||||
table: "ApiClaims",
|
table: "ApiScopeClaims",
|
||||||
column: "ApiResourceId");
|
column: "ApiScopeId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ApiScopes_ApiResourceId",
|
name: "IX_ApiScopes_ApiResourceId",
|
||||||
@ -379,22 +410,11 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
column: "Name",
|
column: "Name",
|
||||||
unique: true);
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_ApiScopeClaims_ApiScopeId",
|
|
||||||
table: "ApiScopeClaims",
|
|
||||||
column: "ApiScopeId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ApiSecrets_ApiResourceId",
|
name: "IX_ApiSecrets_ApiResourceId",
|
||||||
table: "ApiSecrets",
|
table: "ApiSecrets",
|
||||||
column: "ApiResourceId");
|
column: "ApiResourceId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Clients_ClientId",
|
|
||||||
table: "Clients",
|
|
||||||
column: "ClientId",
|
|
||||||
unique: true);
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ClientClaims_ClientId",
|
name: "IX_ClientClaims_ClientId",
|
||||||
table: "ClientClaims",
|
table: "ClientClaims",
|
||||||
@ -420,11 +440,22 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
table: "ClientPostLogoutRedirectUris",
|
table: "ClientPostLogoutRedirectUris",
|
||||||
column: "ClientId");
|
column: "ClientId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ClientProperties_ClientId",
|
||||||
|
table: "ClientProperties",
|
||||||
|
column: "ClientId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ClientRedirectUris_ClientId",
|
name: "IX_ClientRedirectUris_ClientId",
|
||||||
table: "ClientRedirectUris",
|
table: "ClientRedirectUris",
|
||||||
column: "ClientId");
|
column: "ClientId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Clients_ClientId",
|
||||||
|
table: "Clients",
|
||||||
|
column: "ClientId",
|
||||||
|
unique: true);
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_ClientScopes_ClientId",
|
name: "IX_ClientScopes_ClientId",
|
||||||
table: "ClientScopes",
|
table: "ClientScopes",
|
||||||
@ -473,6 +504,9 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "ClientPostLogoutRedirectUris");
|
name: "ClientPostLogoutRedirectUris");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "ClientProperties");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "ClientRedirectUris");
|
name: "ClientRedirectUris");
|
||||||
|
|
@ -1,9 +1,12 @@
|
|||||||
using System;
|
// <auto-generated />
|
||||||
|
using IdentityServer4.EntityFramework.DbContexts;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using IdentityServer4.EntityFramework.DbContexts;
|
using Microsoft.EntityFrameworkCore.Storage;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Identity.API.Migrations.ConfigurationDb
|
namespace Identity.API.Migrations.ConfigurationDb
|
||||||
{
|
{
|
||||||
@ -12,8 +15,9 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "1.1.2")
|
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
|
||||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
|
||||||
@ -164,6 +168,10 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
|
|
||||||
b.Property<int>("AuthorizationCodeLifetime");
|
b.Property<int>("AuthorizationCodeLifetime");
|
||||||
|
|
||||||
|
b.Property<bool>("BackChannelLogoutSessionRequired");
|
||||||
|
|
||||||
|
b.Property<string>("BackChannelLogoutUri");
|
||||||
|
|
||||||
b.Property<string>("ClientId")
|
b.Property<string>("ClientId")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(200);
|
.HasMaxLength(200);
|
||||||
@ -174,19 +182,26 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
b.Property<string>("ClientUri")
|
b.Property<string>("ClientUri")
|
||||||
.HasMaxLength(2000);
|
.HasMaxLength(2000);
|
||||||
|
|
||||||
|
b.Property<int?>("ConsentLifetime");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.HasMaxLength(1000);
|
||||||
|
|
||||||
b.Property<bool>("EnableLocalLogin");
|
b.Property<bool>("EnableLocalLogin");
|
||||||
|
|
||||||
b.Property<bool>("Enabled");
|
b.Property<bool>("Enabled");
|
||||||
|
|
||||||
|
b.Property<bool>("FrontChannelLogoutSessionRequired");
|
||||||
|
|
||||||
|
b.Property<string>("FrontChannelLogoutUri");
|
||||||
|
|
||||||
b.Property<int>("IdentityTokenLifetime");
|
b.Property<int>("IdentityTokenLifetime");
|
||||||
|
|
||||||
b.Property<bool>("IncludeJwtId");
|
b.Property<bool>("IncludeJwtId");
|
||||||
|
|
||||||
b.Property<string>("LogoUri");
|
b.Property<string>("LogoUri");
|
||||||
|
|
||||||
b.Property<bool>("LogoutSessionRequired");
|
b.Property<string>("NormalizedClientId");
|
||||||
|
|
||||||
b.Property<string>("LogoutUri");
|
|
||||||
|
|
||||||
b.Property<bool>("PrefixClientClaims");
|
b.Property<bool>("PrefixClientClaims");
|
||||||
|
|
||||||
@ -315,6 +330,29 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
b.ToTable("ClientPostLogoutRedirectUris");
|
b.ToTable("ClientPostLogoutRedirectUris");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
|
b.Property<int?>("ClientId")
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Property<string>("Key")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(250);
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.IsRequired()
|
||||||
|
.HasMaxLength(2000);
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ClientId");
|
||||||
|
|
||||||
|
b.ToTable("ClientProperties");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
@ -502,6 +540,14 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
|
||||||
|
.WithMany("Properties")
|
||||||
|
.HasForeignKey("ClientId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
|
b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
|
||||||
@ -533,6 +579,7 @@ namespace Identity.API.Migrations.ConfigurationDb
|
|||||||
.HasForeignKey("IdentityResourceId")
|
.HasForeignKey("IdentityResourceId")
|
||||||
.OnDelete(DeleteBehavior.Cascade);
|
.OnDelete(DeleteBehavior.Cascade);
|
||||||
});
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,23 @@
|
|||||||
using System;
|
// <auto-generated />
|
||||||
|
using IdentityServer4.EntityFramework.DbContexts;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using IdentityServer4.EntityFramework.DbContexts;
|
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Identity.API.Migrations
|
namespace Identity.API.Migrations.PersistedGrantDb
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PersistedGrantDbContext))]
|
[DbContext(typeof(PersistedGrantDbContext))]
|
||||||
[Migration("20170604151240_Init-persisted-grant")]
|
[Migration("20170912114120_Initial")]
|
||||||
partial class Initpersistedgrant
|
partial class Initial
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "1.1.2")
|
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
|
||||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
|
||||||
@ -47,6 +50,7 @@ namespace Identity.API.Migrations
|
|||||||
|
|
||||||
b.ToTable("PersistedGrants");
|
b.ToTable("PersistedGrants");
|
||||||
});
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Identity.API.Migrations.PersistedGrantDb
|
||||||
|
{
|
||||||
|
public partial class Initial : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "PersistedGrants",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Key = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||||
|
ClientId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
|
||||||
|
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||||
|
Data = table.Column<string>(type: "nvarchar(max)", maxLength: 50000, nullable: false),
|
||||||
|
Expiration = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||||
|
SubjectId = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||||
|
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_PersistedGrants", x => x.Key);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_PersistedGrants_SubjectId_ClientId_Type",
|
||||||
|
table: "PersistedGrants",
|
||||||
|
columns: new[] { "SubjectId", "ClientId", "Type" });
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "PersistedGrants");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,19 +1,22 @@
|
|||||||
using System;
|
// <auto-generated />
|
||||||
|
using IdentityServer4.EntityFramework.DbContexts;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata;
|
using Microsoft.EntityFrameworkCore.Metadata;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using IdentityServer4.EntityFramework.DbContexts;
|
using Microsoft.EntityFrameworkCore.Storage.Internal;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Identity.API.Migrations
|
namespace Identity.API.Migrations.PersistedGrantDb
|
||||||
{
|
{
|
||||||
[DbContext(typeof(PersistedGrantDbContext))]
|
[DbContext(typeof(PersistedGrantDbContext))]
|
||||||
partial class PersistedGrantDbContextModelSnapshot : ModelSnapshot
|
partial class PersistedGrantDbContextModelSnapshot : ModelSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("ProductVersion", "1.1.2")
|
.HasAnnotation("ProductVersion", "2.0.0-rtm-26452")
|
||||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||||
|
|
||||||
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
|
modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
|
||||||
@ -46,6 +49,7 @@ namespace Identity.API.Migrations
|
|||||||
|
|
||||||
b.ToTable("PersistedGrants");
|
b.ToTable("PersistedGrants");
|
||||||
});
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace eShopOnContainers.Identity
|
namespace eShopOnContainers.Identity
|
||||||
@ -7,15 +9,22 @@ namespace eShopOnContainers.Identity
|
|||||||
{
|
{
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var host = new WebHostBuilder()
|
BuildWebHost(args).Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IWebHost BuildWebHost(string[] args) =>
|
||||||
|
WebHost.CreateDefaultBuilder(args)
|
||||||
.UseKestrel()
|
.UseKestrel()
|
||||||
.UseHealthChecks("/hc")
|
.UseHealthChecks("/hc")
|
||||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
.UseIISIntegration()
|
.UseIISIntegration()
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
|
.ConfigureLogging((hostingContext, builder) =>
|
||||||
|
{
|
||||||
|
builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
|
||||||
|
builder.AddConsole();
|
||||||
|
builder.AddDebug();
|
||||||
|
})
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
host.Run();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,24 +28,12 @@ namespace eShopOnContainers.Identity
|
|||||||
{
|
{
|
||||||
public class Startup
|
public class Startup
|
||||||
{
|
{
|
||||||
public Startup(IHostingEnvironment env)
|
public Startup(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
var builder = new ConfigurationBuilder()
|
Configuration = configuration;
|
||||||
.SetBasePath(env.ContentRootPath)
|
|
||||||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
|
|
||||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
|
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
|
||||||
{
|
|
||||||
// For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
|
|
||||||
builder.AddUserSecrets<Startup>();
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.AddEnvironmentVariables();
|
|
||||||
Configuration = builder.Build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IConfigurationRoot Configuration { get; }
|
public IConfiguration Configuration { get; }
|
||||||
|
|
||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public IServiceProvider ConfigureServices(IServiceCollection services)
|
public IServiceProvider ConfigureServices(IServiceCollection services)
|
||||||
@ -179,7 +167,10 @@ namespace eShopOnContainers.Identity
|
|||||||
|
|
||||||
using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())
|
using (var serviceScope = app.ApplicationServices.GetService<IServiceScopeFactory>().CreateScope())
|
||||||
{
|
{
|
||||||
serviceScope.ServiceProvider.GetRequiredService<PersistedGrantDbContext>().Database.Migrate();
|
serviceScope.ServiceProvider.GetRequiredService<PersistedGrantDbContext>()
|
||||||
|
.Database
|
||||||
|
.Migrate();
|
||||||
|
|
||||||
var context = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
|
var context = serviceScope.ServiceProvider.GetRequiredService<ConfigurationDbContext>();
|
||||||
context.Database.Migrate();
|
context.Database.Migrate();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user