using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LY.MicroService.AuthServer.Migrations { public partial class SwitchIdentityServertotheOpenIddict : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "IdentityServerApiResourceClaims"); migrationBuilder.DropTable( name: "IdentityServerApiResourceProperties"); migrationBuilder.DropTable( name: "IdentityServerApiResourceScopes"); migrationBuilder.DropTable( name: "IdentityServerApiResourceSecrets"); migrationBuilder.DropTable( name: "IdentityServerApiScopeClaims"); migrationBuilder.DropTable( name: "IdentityServerApiScopeProperties"); migrationBuilder.DropTable( name: "IdentityServerClientClaims"); migrationBuilder.DropTable( name: "IdentityServerClientCorsOrigins"); migrationBuilder.DropTable( name: "IdentityServerClientGrantTypes"); migrationBuilder.DropTable( name: "IdentityServerClientIdPRestrictions"); migrationBuilder.DropTable( name: "IdentityServerClientPostLogoutRedirectUris"); migrationBuilder.DropTable( name: "IdentityServerClientProperties"); migrationBuilder.DropTable( name: "IdentityServerClientRedirectUris"); migrationBuilder.DropTable( name: "IdentityServerClientScopes"); migrationBuilder.DropTable( name: "IdentityServerClientSecrets"); migrationBuilder.DropTable( name: "IdentityServerDeviceFlowCodes"); migrationBuilder.DropTable( name: "IdentityServerIdentityResourceClaims"); migrationBuilder.DropTable( name: "IdentityServerIdentityResourceProperties"); migrationBuilder.DropTable( name: "IdentityServerPersistedGrants"); migrationBuilder.DropTable( name: "IdentityServerApiResources"); migrationBuilder.DropTable( name: "IdentityServerApiScopes"); migrationBuilder.DropTable( name: "IdentityServerClients"); migrationBuilder.DropTable( name: "IdentityServerIdentityResources"); migrationBuilder.CreateTable( name: "OpenIddictApplications", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ClientId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClientSecret = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConsentType = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DisplayName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DisplayNames = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Permissions = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PostLogoutRedirectUris = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Properties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), RedirectUris = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Requirements = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClientUri = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), LogoUri = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_OpenIddictApplications", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "OpenIddictScopes", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Descriptions = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DisplayName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DisplayNames = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Properties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Resources = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_OpenIddictScopes", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "OpenIddictAuthorizations", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ApplicationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreationDate = table.Column(type: "datetime(6)", nullable: true), Properties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Scopes = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Subject = table.Column(type: "varchar(400)", maxLength: 400, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id); table.ForeignKey( name: "FK_OpenIddictAuthorizations_OpenIddictApplications_ApplicationId", column: x => x.ApplicationId, principalTable: "OpenIddictApplications", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "OpenIddictTokens", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ApplicationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), AuthorizationId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreationDate = table.Column(type: "datetime(6)", nullable: true), ExpirationDate = table.Column(type: "datetime(6)", nullable: true), Payload = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Properties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), RedemptionDate = table.Column(type: "datetime(6)", nullable: true), ReferenceId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Status = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Subject = table.Column(type: "varchar(400)", maxLength: 400, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_OpenIddictTokens", x => x.Id); table.ForeignKey( name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId", column: x => x.ApplicationId, principalTable: "OpenIddictApplications", principalColumn: "Id"); table.ForeignKey( name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId", column: x => x.AuthorizationId, principalTable: "OpenIddictAuthorizations", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_OpenIddictApplications_ClientId", table: "OpenIddictApplications", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type", table: "OpenIddictAuthorizations", columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); migrationBuilder.CreateIndex( name: "IX_OpenIddictScopes_Name", table: "OpenIddictScopes", column: "Name"); migrationBuilder.CreateIndex( name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type", table: "OpenIddictTokens", columns: new[] { "ApplicationId", "Status", "Subject", "Type" }); migrationBuilder.CreateIndex( name: "IX_OpenIddictTokens_AuthorizationId", table: "OpenIddictTokens", column: "AuthorizationId"); migrationBuilder.CreateIndex( name: "IX_OpenIddictTokens_ReferenceId", table: "OpenIddictTokens", column: "ReferenceId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "OpenIddictScopes"); migrationBuilder.DropTable( name: "OpenIddictTokens"); migrationBuilder.DropTable( name: "OpenIddictAuthorizations"); migrationBuilder.DropTable( name: "OpenIddictApplications"); migrationBuilder.CreateTable( name: "IdentityServerApiResources", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), AllowedAccessTokenSigningAlgorithms = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Enabled = table.Column(type: "tinyint(1)", nullable: false), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerApiScopes", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Emphasize = table.Column(type: "tinyint(1)", nullable: false), Enabled = table.Column(type: "tinyint(1)", nullable: false), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Required = table.Column(type: "tinyint(1)", nullable: false), ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClients", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), AbsoluteRefreshTokenLifetime = table.Column(type: "int", nullable: false), AccessTokenLifetime = table.Column(type: "int", nullable: false), AccessTokenType = table.Column(type: "int", nullable: false), AllowAccessTokensViaBrowser = table.Column(type: "tinyint(1)", nullable: false), AllowOfflineAccess = table.Column(type: "tinyint(1)", nullable: false), AllowPlainTextPkce = table.Column(type: "tinyint(1)", nullable: false), AllowRememberConsent = table.Column(type: "tinyint(1)", nullable: false), AllowedIdentityTokenSigningAlgorithms = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), AlwaysIncludeUserClaimsInIdToken = table.Column(type: "tinyint(1)", nullable: false), AlwaysSendClientClaims = table.Column(type: "tinyint(1)", nullable: false), AuthorizationCodeLifetime = table.Column(type: "int", nullable: false), BackChannelLogoutSessionRequired = table.Column(type: "tinyint(1)", nullable: false), BackChannelLogoutUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClientClaimsPrefix = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ClientName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClientUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConsentLifetime = table.Column(type: "int", nullable: true), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DeviceCodeLifetime = table.Column(type: "int", nullable: false), EnableLocalLogin = table.Column(type: "tinyint(1)", nullable: false), Enabled = table.Column(type: "tinyint(1)", nullable: false), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), FrontChannelLogoutSessionRequired = table.Column(type: "tinyint(1)", nullable: false), FrontChannelLogoutUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IdentityTokenLifetime = table.Column(type: "int", nullable: false), IncludeJwtId = table.Column(type: "tinyint(1)", nullable: false), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LogoUri = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PairWiseSubjectSalt = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ProtocolType = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), RefreshTokenExpiration = table.Column(type: "int", nullable: false), RefreshTokenUsage = table.Column(type: "int", nullable: false), RequireClientSecret = table.Column(type: "tinyint(1)", nullable: false), RequireConsent = table.Column(type: "tinyint(1)", nullable: false), RequirePkce = table.Column(type: "tinyint(1)", nullable: false), RequireRequestObject = table.Column(type: "tinyint(1)", nullable: false), SlidingRefreshTokenLifetime = table.Column(type: "int", nullable: false), UpdateAccessTokenClaimsOnRefresh = table.Column(type: "tinyint(1)", nullable: false), UserCodeType = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), UserSsoLifetime = table.Column(type: "int", nullable: true) }, constraints: table => { table.PrimaryKey("PK_IdentityServerClients", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerDeviceFlowCodes", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Data = table.Column(type: "varchar(10000)", maxLength: 10000, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DeviceCode = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Expiration = table.Column(type: "datetime(6)", nullable: false), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), SessionId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), SubjectId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), UserCode = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerIdentityResources", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeleterId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), DeletionTime = table.Column(type: "datetime(6)", nullable: true), Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DisplayName = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Emphasize = table.Column(type: "tinyint(1)", nullable: false), Enabled = table.Column(type: "tinyint(1)", nullable: false), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), LastModificationTime = table.Column(type: "datetime(6)", nullable: true), LastModifierId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Required = table.Column(type: "tinyint(1)", nullable: false), ShowInDiscoveryDocument = table.Column(type: "tinyint(1)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerPersistedGrants", columns: table => new { Key = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ClientId = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConsumedTime = table.Column(type: "datetime(6)", nullable: true), CreationTime = table.Column(type: "datetime(6)", nullable: false), Data = table.Column(type: "varchar(10000)", maxLength: 10000, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Expiration = table.Column(type: "datetime(6)", nullable: true), ExtraProperties = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), SessionId = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), SubjectId = table.Column(type: "varchar(200)", maxLength: 200, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "varchar(50)", maxLength: 50, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerApiResourceClaims", columns: table => new { ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiResourceClaims", x => new { x.ApiResourceId, x.Type }); table.ForeignKey( name: "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_A~", column: x => x.ApiResourceId, principalTable: "IdentityServerApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerApiResourceProperties", columns: table => new { ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiResourceProperties", x => new { x.ApiResourceId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerApiResourceProperties_IdentityServerApiResourc~", column: x => x.ApiResourceId, principalTable: "IdentityServerApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerApiResourceScopes", columns: table => new { ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Scope = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiResourceScopes", x => new { x.ApiResourceId, x.Scope }); table.ForeignKey( name: "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_A~", column: x => x.ApiResourceId, principalTable: "IdentityServerApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerApiResourceSecrets", columns: table => new { ApiResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Expiration = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiResourceSecrets", x => new { x.ApiResourceId, x.Type, x.Value }); table.ForeignKey( name: "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_~", column: x => x.ApiResourceId, principalTable: "IdentityServerApiResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerApiScopeClaims", columns: table => new { ApiScopeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiScopeClaims", x => new { x.ApiScopeId, x.Type }); table.ForeignKey( name: "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScop~", column: x => x.ApiScopeId, principalTable: "IdentityServerApiScopes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerApiScopeProperties", columns: table => new { ApiScopeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerApiScopeProperties", x => new { x.ApiScopeId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Api~", column: x => x.ApiScopeId, principalTable: "IdentityServerApiScopes", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientClaims", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value }); table.ForeignKey( name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientCorsOrigins", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Origin = table.Column(type: "varchar(150)", maxLength: 150, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientCorsOrigins", x => new { x.ClientId, x.Origin }); table.ForeignKey( name: "FK_IdentityServerClientCorsOrigins_IdentityServerClients_Client~", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientGrantTypes", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GrantType = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientGrantTypes", x => new { x.ClientId, x.GrantType }); table.ForeignKey( name: "FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientIdPRestrictions", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Provider = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientIdPRestrictions", x => new { x.ClientId, x.Provider }); table.ForeignKey( name: "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_Cl~", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientPostLogoutRedirectUris", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PostLogoutRedirectUri = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientPostLogoutRedirectUris", x => new { x.ClientId, x.PostLogoutRedirectUri }); table.ForeignKey( name: "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerCli~", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientProperties", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientProperties", x => new { x.ClientId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerClientProperties_IdentityServerClients_ClientId", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientRedirectUris", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), RedirectUri = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientRedirectUris", x => new { x.ClientId, x.RedirectUri }); table.ForeignKey( name: "FK_IdentityServerClientRedirectUris_IdentityServerClients_Clien~", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientScopes", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Scope = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientScopes", x => new { x.ClientId, x.Scope }); table.ForeignKey( name: "FK_IdentityServerClientScopes_IdentityServerClients_ClientId", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerClientSecrets", columns: table => new { ClientId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Expiration = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_IdentityServerClientSecrets", x => new { x.ClientId, x.Type, x.Value }); table.ForeignKey( name: "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId", column: x => x.ClientId, principalTable: "IdentityServerClients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerIdentityResourceClaims", columns: table => new { IdentityResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "varchar(200)", maxLength: 200, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerIdentityResourceClaims", x => new { x.IdentityResourceId, x.Type }); table.ForeignKey( name: "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityR~", column: x => x.IdentityResourceId, principalTable: "IdentityServerIdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "IdentityServerIdentityResourceProperties", columns: table => new { IdentityResourceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Key = table.Column(type: "varchar(250)", maxLength: 250, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(300)", maxLength: 300, nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_IdentityServerIdentityResourceProperties", x => new { x.IdentityResourceId, x.Key, x.Value }); table.ForeignKey( name: "FK_IdentityServerIdentityResourceProperties_IdentityServerIdent~", column: x => x.IdentityResourceId, principalTable: "IdentityServerIdentityResources", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_IdentityServerClients_ClientId", table: "IdentityServerClients", column: "ClientId"); migrationBuilder.CreateIndex( name: "IX_IdentityServerDeviceFlowCodes_DeviceCode", table: "IdentityServerDeviceFlowCodes", column: "DeviceCode", unique: true); migrationBuilder.CreateIndex( name: "IX_IdentityServerDeviceFlowCodes_Expiration", table: "IdentityServerDeviceFlowCodes", column: "Expiration"); migrationBuilder.CreateIndex( name: "IX_IdentityServerDeviceFlowCodes_UserCode", table: "IdentityServerDeviceFlowCodes", column: "UserCode"); migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_Expiration", table: "IdentityServerPersistedGrants", column: "Expiration"); migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type", table: "IdentityServerPersistedGrants", columns: new[] { "SubjectId", "ClientId", "Type" }); migrationBuilder.CreateIndex( name: "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type", table: "IdentityServerPersistedGrants", columns: new[] { "SubjectId", "SessionId", "Type" }); } } }