using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace OpenIddict.Demo.Server.Migrations
{
///
public partial class Initial : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
Required = table.Column(type: "bit", nullable: false),
IsStatic = table.Column(type: "bit", nullable: false),
Regex = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true),
RegexDescription = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true),
Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
ValueType = table.Column(type: "int", nullable: false),
CreationTime = table.Column(type: "datetime2", nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpFeatureGroups",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpFeatures",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true),
DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
Description = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
IsVisibleToClients = table.Column(type: "bit", nullable: false),
IsAvailableToHost = table.Column(type: "bit", nullable: false),
AllowedProviders = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
ValueType = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatures", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpFeatureValues",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
Value = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
ProviderName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProviderKey = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpLinkUsers",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
SourceUserId = table.Column(type: "uniqueidentifier", nullable: false),
SourceTenantId = table.Column(type: "uniqueidentifier", nullable: true),
TargetUserId = table.Column(type: "uniqueidentifier", nullable: false),
TargetTenantId = table.Column(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpLinkUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpOrganizationUnits",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
ParentId = table.Column(type: "uniqueidentifier", nullable: true),
Code = table.Column(type: "nvarchar(95)", maxLength: 95, nullable: false),
DisplayName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
EntityVersion = table.Column(type: "int", nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "datetime2", nullable: false),
CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column(type: "datetime2", nullable: true),
LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column(type: "datetime2", 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");
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
ProviderName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
ProviderKey = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGroups",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissions",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
GroupName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
ParentName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true),
DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
IsEnabled = table.Column(type: "bit", nullable: false),
MultiTenancySide = table.Column(type: "tinyint", nullable: false),
Providers = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true),
StateCheckers = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
IsDefault = table.Column(type: "bit", nullable: false),
IsStatic = table.Column(type: "bit", nullable: false),
IsPublic = table.Column(type: "bit", nullable: false),
EntityVersion = table.Column(type: "int", nullable: false),
CreationTime = table.Column(type: "datetime2", nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSecurityLogs",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
ApplicationName = table.Column(type: "nvarchar(96)", maxLength: 96, nullable: true),
Identity = table.Column(type: "nvarchar(96)", maxLength: 96, nullable: true),
Action = table.Column(type: "nvarchar(96)", maxLength: 96, nullable: true),
UserId = table.Column(type: "uniqueidentifier", nullable: true),
UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
TenantName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
ClientId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
CorrelationId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
ClientIpAddress = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
BrowserInfo = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true),
CreationTime = table.Column(type: "datetime2", nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSessions",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
SessionId = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
Device = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
DeviceInfo = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
UserId = table.Column(type: "uniqueidentifier", nullable: false),
ClientId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
IpAddresses = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
SignedIn = table.Column(type: "datetime2", nullable: false),
LastAccessed = table.Column(type: "datetime2", nullable: true),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSessions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettingDefinitions",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
DisplayName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true),
DefaultValue = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
IsVisibleToClients = table.Column(type: "bit", nullable: false),
Providers = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
IsInherited = table.Column(type: "bit", nullable: false),
IsEncrypted = table.Column(type: "bit", nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
Value = table.Column(type: "nvarchar(2048)", maxLength: 2048, nullable: false),
ProviderName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
ProviderKey = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpTenants",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
NormalizedName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
EntityVersion = table.Column(type: "int", nullable: false),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "datetime2", nullable: false),
CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column(type: "datetime2", nullable: true),
LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpTenants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUserDelegations",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
SourceUserId = table.Column(type: "uniqueidentifier", nullable: false),
TargetUserId = table.Column(type: "uniqueidentifier", nullable: false),
StartTime = table.Column(type: "datetime2", nullable: false),
EndTime = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserDelegations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
Surname = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true),
Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
EmailConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false),
PasswordHash = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
SecurityStamp = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
IsExternal = table.Column(type: "bit", nullable: false, defaultValue: false),
PhoneNumber = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true),
PhoneNumberConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false),
IsActive = table.Column(type: "bit", nullable: false),
TwoFactorEnabled = table.Column(type: "bit", nullable: false, defaultValue: false),
LockoutEnd = table.Column(type: "datetimeoffset", nullable: true),
LockoutEnabled = table.Column(type: "bit", nullable: false, defaultValue: false),
AccessFailedCount = table.Column(type: "int", nullable: false, defaultValue: 0),
ShouldChangePasswordOnNextLogin = table.Column(type: "bit", nullable: false),
EntityVersion = table.Column(type: "int", nullable: false),
LastPasswordChangeTime = table.Column(type: "datetimeoffset", nullable: true),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "datetime2", nullable: false),
CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column(type: "datetime2", nullable: true),
LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "OpenIddictApplications",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
ApplicationType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
ClientId = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true),
ClientSecret = table.Column(type: "nvarchar(max)", nullable: true),
ClientType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
ConsentType = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true),
DisplayName = table.Column(type: "nvarchar(max)", nullable: true),
DisplayNames = table.Column(type: "nvarchar(max)", nullable: true),
JsonWebKeySet = table.Column(type: "nvarchar(max)", nullable: true),
Permissions = table.Column(type: "nvarchar(max)", nullable: true),
PostLogoutRedirectUris = table.Column(type: "nvarchar(max)", nullable: true),
Properties = table.Column(type: "nvarchar(max)", nullable: true),
RedirectUris = table.Column(type: "nvarchar(max)", nullable: true),
Requirements = table.Column(type: "nvarchar(max)", nullable: true),
Settings = table.Column(type: "nvarchar(max)", nullable: true),
FrontChannelLogoutUri = table.Column(type: "nvarchar(max)", nullable: true),
ClientUri = table.Column(type: "nvarchar(max)", nullable: true),
LogoUri = table.Column(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "datetime2", nullable: false),
CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column(type: "datetime2", nullable: true),
LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_OpenIddictApplications", x => x.Id);
});
migrationBuilder.CreateTable(
name: "OpenIddictScopes",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
Description = table.Column(type: "nvarchar(max)", nullable: true),
Descriptions = table.Column(type: "nvarchar(max)", nullable: true),
DisplayName = table.Column(type: "nvarchar(max)", nullable: true),
DisplayNames = table.Column(type: "nvarchar(max)", nullable: true),
Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true),
Properties = table.Column(type: "nvarchar(max)", nullable: true),
Resources = table.Column(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false),
CreationTime = table.Column(type: "datetime2", nullable: false),
CreatorId = table.Column(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column(type: "datetime2", nullable: true),
LastModifierId = table.Column(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_OpenIddictScopes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpOrganizationUnitRoles",
columns: table => new
{
RoleId = table.Column(type: "uniqueidentifier", nullable: false),
OrganizationUnitId = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
CreationTime = table.Column(type: "datetime2", nullable: false),
CreatorId = table.Column(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId });
table.ForeignKey(
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUnitId",
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);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
RoleId = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
ClaimType = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
ClaimValue = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpTenantConnectionStrings",
columns: table => new
{
TenantId = table.Column(type: "uniqueidentifier", nullable: false),
Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
Value = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name });
table.ForeignKey(
name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId",
column: x => x.TenantId,
principalTable: "AbpTenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpUserClaims",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
UserId = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
ClaimType = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
ClaimValue = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpUserLogins",
columns: table => new
{
UserId = table.Column(type: "uniqueidentifier", nullable: false),
LoginProvider = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
ProviderKey = table.Column(type: "nvarchar(196)", maxLength: 196, nullable: false),
ProviderDisplayName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpUserOrganizationUnits",
columns: table => new
{
UserId = table.Column(type: "uniqueidentifier", nullable: false),
OrganizationUnitId = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
CreationTime = table.Column(type: "datetime2", nullable: false),
CreatorId = table.Column(type: "uniqueidentifier", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId });
table.ForeignKey(
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUnitId",
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);
});
migrationBuilder.CreateTable(
name: "AbpUserRoles",
columns: table => new
{
UserId = table.Column(type: "uniqueidentifier", nullable: false),
RoleId = table.Column(type: "uniqueidentifier", nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "AbpUserTokens",
columns: table => new
{
UserId = table.Column(type: "uniqueidentifier", nullable: false),
LoginProvider = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false),
Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false),
TenantId = table.Column(type: "uniqueidentifier", nullable: true),
Value = table.Column(type: "nvarchar(max)", nullable: true)
},
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);
});
migrationBuilder.CreateTable(
name: "OpenIddictAuthorizations",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
ApplicationId = table.Column