| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace AuthServer.Host.Migrations
- {
- public partial class inint : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterDatabase()
- .Annotation("MySql:CharSet", "utf8mb4");
- migrationBuilder.CreateTable(
- name: "IdentityServerApiResources",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
- AllowedAccessTokenSigningAlgorithms = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false),
- ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
- CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
- LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
- DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- DeletionTime = table.Column<DateTime>(type: "datetime", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityServerApiResources", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
- migrationBuilder.CreateTable(
- name: "IdentityServerApiScopes",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
- Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Required = table.Column<bool>(type: "tinyint(1)", nullable: false),
- Emphasize = table.Column<bool>(type: "tinyint(1)", nullable: false),
- ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false),
- ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
- CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
- LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
- DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- DeletionTime = table.Column<DateTime>(type: "datetime", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityServerApiScopes", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
- migrationBuilder.CreateTable(
- name: "IdentityServerClients",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClientName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClientUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- LogoUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
- ProtocolType = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- RequireClientSecret = table.Column<bool>(type: "tinyint(1)", nullable: false),
- RequireConsent = table.Column<bool>(type: "tinyint(1)", nullable: false),
- AllowRememberConsent = table.Column<bool>(type: "tinyint(1)", nullable: false),
- AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(type: "tinyint(1)", nullable: false),
- RequirePkce = table.Column<bool>(type: "tinyint(1)", nullable: false),
- AllowPlainTextPkce = table.Column<bool>(type: "tinyint(1)", nullable: false),
- RequireRequestObject = table.Column<bool>(type: "tinyint(1)", nullable: false),
- AllowAccessTokensViaBrowser = table.Column<bool>(type: "tinyint(1)", nullable: false),
- FrontChannelLogoutUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- FrontChannelLogoutSessionRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
- BackChannelLogoutUri = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- BackChannelLogoutSessionRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
- AllowOfflineAccess = table.Column<bool>(type: "tinyint(1)", nullable: false),
- IdentityTokenLifetime = table.Column<int>(type: "int", nullable: false),
- AllowedIdentityTokenSigningAlgorithms = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- AccessTokenLifetime = table.Column<int>(type: "int", nullable: false),
- AuthorizationCodeLifetime = table.Column<int>(type: "int", nullable: false),
- ConsentLifetime = table.Column<int>(type: "int", nullable: true),
- AbsoluteRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
- SlidingRefreshTokenLifetime = table.Column<int>(type: "int", nullable: false),
- RefreshTokenUsage = table.Column<int>(type: "int", nullable: false),
- UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(type: "tinyint(1)", nullable: false),
- RefreshTokenExpiration = table.Column<int>(type: "int", nullable: false),
- AccessTokenType = table.Column<int>(type: "int", nullable: false),
- EnableLocalLogin = table.Column<bool>(type: "tinyint(1)", nullable: false),
- IncludeJwtId = table.Column<bool>(type: "tinyint(1)", nullable: false),
- AlwaysSendClientClaims = table.Column<bool>(type: "tinyint(1)", nullable: false),
- ClientClaimsPrefix = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- PairWiseSubjectSalt = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- UserSsoLifetime = table.Column<int>(type: "int", nullable: true),
- UserCodeType = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DeviceCodeLifetime = table.Column<int>(type: "int", nullable: false),
- ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
- CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
- LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
- DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- DeletionTime = table.Column<DateTime>(type: "datetime", 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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- DeviceCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- UserCode = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- SubjectId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- SessionId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Expiration = table.Column<DateTime>(type: "datetime", nullable: false),
- Data = table.Column<string>(type: "varchar(10000)", maxLength: 10000, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
- CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityServerDeviceFlowCodes", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
- migrationBuilder.CreateTable(
- name: "IdentityServerIdentityResources",
- columns: table => new
- {
- Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Name = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- DisplayName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Enabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
- Required = table.Column<bool>(type: "tinyint(1)", nullable: false),
- Emphasize = table.Column<bool>(type: "tinyint(1)", nullable: false),
- ShowInDiscoveryDocument = table.Column<bool>(type: "tinyint(1)", nullable: false),
- ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
- CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- LastModificationTime = table.Column<DateTime>(type: "datetime", nullable: true),
- LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
- DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
- DeletionTime = table.Column<DateTime>(type: "datetime", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityServerIdentityResources", x => x.Id);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
- migrationBuilder.CreateTable(
- name: "IdentityServerPersistedGrants",
- columns: table => new
- {
- Key = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Type = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- SubjectId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- SessionId = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClientId = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Description = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- CreationTime = table.Column<DateTime>(type: "datetime", nullable: false),
- Expiration = table.Column<DateTime>(type: "datetime", nullable: true),
- ConsumedTime = table.Column<DateTime>(type: "datetime", nullable: true),
- Data = table.Column<string>(type: "varchar(10000)", maxLength: 10000, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
- })
- .Annotation("MySql:CharSet", "utf8mb4");
- migrationBuilder.CreateTable(
- name: "IdentityServerApiResourceClaims",
- columns: table => new
- {
- Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
- },
- 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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Scope = table.Column<string>(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
- {
- Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ApiResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Description = table.Column<string>(type: "varchar(1000)", maxLength: 1000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Expiration = table.Column<DateTime>(type: "datetime", 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
- {
- Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ApiScopeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
- },
- 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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Origin = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- GrantType = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Provider = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- PostLogoutRedirectUri = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- RedirectUri = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Scope = table.Column<string>(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
- {
- Type = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column<string>(type: "varchar(300)", maxLength: 300, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- ClientId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Description = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: true)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Expiration = table.Column<DateTime>(type: "datetime", 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
- {
- Type = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- IdentityResourceId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
- },
- 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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
- Key = table.Column<string>(type: "varchar(250)", maxLength: 250, nullable: false)
- .Annotation("MySql:CharSet", "utf8mb4"),
- Value = table.Column<string>(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" });
- }
- protected override void Down(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");
- }
- }
- }
|