using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LY.MicroService.AuthServer.Migrations { public partial class AddOpenIddictModule : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpClaimTypes", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Required = table.Column(type: "tinyint(1)", nullable: false), IsStatic = table.Column(type: "tinyint(1)", nullable: false), Regex = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), RegexDescription = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ValueType = table.Column(type: "int", nullable: false), 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") }, constraints: table => { table.PrimaryKey("PK_AbpClaimTypes", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpLinkUsers", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), SourceUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), SourceTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), TargetUserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TargetTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpLinkUsers", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpOrganizationUnits", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Code = table.Column(type: "varchar(95)", maxLength: 95, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), DisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) .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_AbpOrganizationUnits", x => x.Id); table.ForeignKey( name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId", column: x => x.ParentId, principalTable: "AbpOrganizationUnits", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpRoles", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), IsDefault = table.Column(type: "tinyint(1)", nullable: false), IsStatic = table.Column(type: "tinyint(1)", nullable: false), IsPublic = table.Column(type: "tinyint(1)", nullable: false), 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") }, constraints: table => { table.PrimaryKey("PK_AbpRoles", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpSecurityLogs", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ApplicationName = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Identity = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Action = table.Column(type: "varchar(96)", maxLength: 96, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClientId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CorrelationId = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationTime = table.Column(type: "datetime(6)", nullable: false), 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") }, constraints: table => { table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUsers", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Surname = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), EmailConfirmed = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), PasswordHash = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), SecurityStamp = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), IsExternal = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), PhoneNumber = table.Column(type: "varchar(16)", maxLength: 16, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), IsActive = table.Column(type: "tinyint(1)", nullable: false), TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), LockoutEnd = table.Column(type: "datetime(6)", nullable: true), LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), AccessFailedCount = table.Column(type: "int", nullable: false, defaultValue: 0), 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_AbpUsers", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); 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: "AbpOrganizationUnitRoles", columns: table => new { RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), OrganizationUnitId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId }); table.ForeignKey( name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUn~", column: x => x.OrganizationUnitId, principalTable: "AbpOrganizationUnits", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId", column: x => x.RoleId, principalTable: "AbpRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpRoleClaims", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ClaimValue = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpRoleClaims", x => x.Id); table.ForeignKey( name: "FK_AbpRoleClaims_AbpRoles_RoleId", column: x => x.RoleId, principalTable: "AbpRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserClaims", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ClaimType = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ClaimValue = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpUserClaims", x => x.Id); table.ForeignKey( name: "FK_AbpUserClaims_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserLogins", columns: table => new { UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ProviderKey = table.Column(type: "varchar(196)", maxLength: 196, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ProviderDisplayName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider }); table.ForeignKey( name: "FK_AbpUserLogins_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserOrganizationUnits", columns: table => new { UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), OrganizationUnitId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreationTime = table.Column(type: "datetime(6)", nullable: false), CreatorId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId }); table.ForeignKey( name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUn~", column: x => x.OrganizationUnitId, principalTable: "AbpOrganizationUnits", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserRoles", columns: table => new { UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId }); table.ForeignKey( name: "FK_AbpUserRoles_AbpRoles_RoleId", column: x => x.RoleId, principalTable: "AbpRoles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AbpUserRoles_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "AbpUserTokens", columns: table => new { UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), LoginProvider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Value = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.ForeignKey( name: "FK_AbpUserTokens_AbpUsers_UserId", column: x => x.UserId, principalTable: "AbpUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .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_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Target~", table: "AbpLinkUsers", columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" }, unique: true); migrationBuilder.CreateIndex( name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId", table: "AbpOrganizationUnitRoles", columns: new[] { "RoleId", "OrganizationUnitId" }); migrationBuilder.CreateIndex( name: "IX_AbpOrganizationUnits_Code", table: "AbpOrganizationUnits", column: "Code"); migrationBuilder.CreateIndex( name: "IX_AbpOrganizationUnits_ParentId", table: "AbpOrganizationUnits", column: "ParentId"); migrationBuilder.CreateIndex( name: "IX_AbpRoleClaims_RoleId", table: "AbpRoleClaims", column: "RoleId"); migrationBuilder.CreateIndex( name: "IX_AbpRoles_NormalizedName", table: "AbpRoles", column: "NormalizedName"); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_Action", table: "AbpSecurityLogs", columns: new[] { "TenantId", "Action" }); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_ApplicationName", table: "AbpSecurityLogs", columns: new[] { "TenantId", "ApplicationName" }); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_Identity", table: "AbpSecurityLogs", columns: new[] { "TenantId", "Identity" }); migrationBuilder.CreateIndex( name: "IX_AbpSecurityLogs_TenantId_UserId", table: "AbpSecurityLogs", columns: new[] { "TenantId", "UserId" }); migrationBuilder.CreateIndex( name: "IX_AbpUserClaims_UserId", table: "AbpUserClaims", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AbpUserLogins_LoginProvider_ProviderKey", table: "AbpUserLogins", columns: new[] { "LoginProvider", "ProviderKey" }); migrationBuilder.CreateIndex( name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId", table: "AbpUserOrganizationUnits", columns: new[] { "UserId", "OrganizationUnitId" }); migrationBuilder.CreateIndex( name: "IX_AbpUserRoles_RoleId_UserId", table: "AbpUserRoles", columns: new[] { "RoleId", "UserId" }); migrationBuilder.CreateIndex( name: "IX_AbpUsers_Email", table: "AbpUsers", column: "Email"); migrationBuilder.CreateIndex( name: "IX_AbpUsers_NormalizedEmail", table: "AbpUsers", column: "NormalizedEmail"); migrationBuilder.CreateIndex( name: "IX_AbpUsers_NormalizedUserName", table: "AbpUsers", column: "NormalizedUserName"); migrationBuilder.CreateIndex( name: "IX_AbpUsers_UserName", table: "AbpUsers", column: "UserName"); 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: "AbpClaimTypes"); migrationBuilder.DropTable( name: "AbpLinkUsers"); migrationBuilder.DropTable( name: "AbpOrganizationUnitRoles"); migrationBuilder.DropTable( name: "AbpRoleClaims"); migrationBuilder.DropTable( name: "AbpSecurityLogs"); migrationBuilder.DropTable( name: "AbpUserClaims"); migrationBuilder.DropTable( name: "AbpUserLogins"); migrationBuilder.DropTable( name: "AbpUserOrganizationUnits"); migrationBuilder.DropTable( name: "AbpUserRoles"); migrationBuilder.DropTable( name: "AbpUserTokens"); migrationBuilder.DropTable( name: "OpenIddictScopes"); migrationBuilder.DropTable( name: "OpenIddictTokens"); migrationBuilder.DropTable( name: "AbpOrganizationUnits"); migrationBuilder.DropTable( name: "AbpRoles"); migrationBuilder.DropTable( name: "AbpUsers"); migrationBuilder.DropTable( name: "OpenIddictAuthorizations"); migrationBuilder.DropTable( name: "OpenIddictApplications"); } } }