1249 lines
67 KiB
C#
1249 lines
67 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Hua.Abp.Demo.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Initial : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpAuditLogExcelFiles",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
FileName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpAuditLogExcelFiles", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpAuditLogs",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ApplicationName = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
|
|
UserId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
TenantName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
ImpersonatorUserId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ImpersonatorUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
ImpersonatorTenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ImpersonatorTenantName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
ExecutionTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
ExecutionDuration = table.Column<int>(type: "integer", nullable: false),
|
|
ClientIpAddress = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
ClientName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
ClientId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
CorrelationId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
BrowserInfo = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
|
HttpMethod = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: true),
|
|
Url = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
Exceptions = table.Column<string>(type: "text", nullable: true),
|
|
Comments = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
HttpStatusCode = table.Column<int>(type: "integer", nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpBackgroundJobs",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ApplicationName = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
|
|
JobName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
JobArgs = table.Column<string>(type: "character varying(1048576)", maxLength: 1048576, nullable: false),
|
|
TryCount = table.Column<short>(type: "smallint", nullable: false, defaultValue: (short)0),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
NextTryTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
LastTryTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
IsAbandoned = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
Priority = table.Column<byte>(type: "smallint", nullable: false, defaultValue: (byte)15),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpBlobContainers",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpBlobContainers", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpClaimTypes",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
Required = table.Column<bool>(type: "boolean", nullable: false),
|
|
IsStatic = table.Column<bool>(type: "boolean", nullable: false),
|
|
Regex = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
|
RegexDescription = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
Description = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
ValueType = table.Column<int>(type: "integer", nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpFeatureGroups",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpFeatures",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
GroupName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
ParentName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
Description = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
DefaultValue = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
IsVisibleToClients = table.Column<bool>(type: "boolean", nullable: false),
|
|
IsAvailableToHost = table.Column<bool>(type: "boolean", nullable: false),
|
|
AllowedProviders = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
ValueType = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpFeatures", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpFeatureValues",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
Value = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpLinkUsers",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
SourceUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
SourceTenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
TargetUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TargetTenantId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpLinkUsers", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpOrganizationUnits",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ParentId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
Code = table.Column<string>(type: "character varying(95)", maxLength: 95, nullable: false),
|
|
DisplayName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
EntityVersion = table.Column<int>(type: "integer", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
DeletionTime = table.Column<DateTime>(type: "timestamp without time zone", 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<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpPermissionGroups",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpPermissions",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
GroupName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
ParentName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
|
MultiTenancySide = table.Column<byte>(type: "smallint", nullable: false),
|
|
Providers = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
StateCheckers = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpPermissions", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpRoles",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
IsDefault = table.Column<bool>(type: "boolean", nullable: false),
|
|
IsStatic = table.Column<bool>(type: "boolean", nullable: false),
|
|
IsPublic = table.Column<bool>(type: "boolean", nullable: false),
|
|
EntityVersion = table.Column<int>(type: "integer", nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpRoles", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpSecurityLogs",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ApplicationName = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
|
|
Identity = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
|
|
Action = table.Column<string>(type: "character varying(96)", maxLength: 96, nullable: true),
|
|
UserId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
TenantName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
ClientId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
CorrelationId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
ClientIpAddress = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
BrowserInfo = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpSessions",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
SessionId = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
Device = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
DeviceInfo = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ClientId = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
IpAddresses = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
SignedIn = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
LastAccessed = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpSessions", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpSettingDefinitions",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
Description = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
|
DefaultValue = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true),
|
|
IsVisibleToClients = table.Column<bool>(type: "boolean", nullable: false),
|
|
Providers = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
IsInherited = table.Column<bool>(type: "boolean", nullable: false),
|
|
IsEncrypted = table.Column<bool>(type: "boolean", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpSettings",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
Value = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpSettings", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpTenants",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
NormalizedName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
EntityVersion = table.Column<int>(type: "integer", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
DeletionTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpTenants", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpUserDelegations",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
SourceUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TargetUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
StartTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
EndTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpUserDelegations", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpUsers",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
Surname = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: true),
|
|
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
PasswordHash = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
SecurityStamp = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
IsExternal = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
PhoneNumber = table.Column<string>(type: "character varying(16)", maxLength: 16, nullable: true),
|
|
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
IsActive = table.Column<bool>(type: "boolean", nullable: false),
|
|
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
|
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
AccessFailedCount = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
|
|
ShouldChangePasswordOnNextLogin = table.Column<bool>(type: "boolean", nullable: false),
|
|
EntityVersion = table.Column<int>(type: "integer", nullable: false),
|
|
LastPasswordChangeTime = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
DeletionTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpUsers", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AppBooks",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
Type = table.Column<int>(type: "integer", nullable: false),
|
|
PublishDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
Price = table.Column<float>(type: "real", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AppBooks", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "OpenIddictApplications",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ApplicationType = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
ClientId = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
|
ClientSecret = table.Column<string>(type: "text", nullable: true),
|
|
ClientType = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
ConsentType = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
DisplayName = table.Column<string>(type: "text", nullable: true),
|
|
DisplayNames = table.Column<string>(type: "text", nullable: true),
|
|
JsonWebKeySet = table.Column<string>(type: "text", nullable: true),
|
|
Permissions = table.Column<string>(type: "text", nullable: true),
|
|
PostLogoutRedirectUris = table.Column<string>(type: "text", nullable: true),
|
|
Properties = table.Column<string>(type: "text", nullable: true),
|
|
RedirectUris = table.Column<string>(type: "text", nullable: true),
|
|
Requirements = table.Column<string>(type: "text", nullable: true),
|
|
Settings = table.Column<string>(type: "text", nullable: true),
|
|
FrontChannelLogoutUri = table.Column<string>(type: "text", nullable: true),
|
|
ClientUri = table.Column<string>(type: "text", nullable: true),
|
|
LogoUri = table.Column<string>(type: "text", nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
DeletionTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_OpenIddictApplications", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "OpenIddictScopes",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Description = table.Column<string>(type: "text", nullable: true),
|
|
Descriptions = table.Column<string>(type: "text", nullable: true),
|
|
DisplayName = table.Column<string>(type: "text", nullable: true),
|
|
DisplayNames = table.Column<string>(type: "text", nullable: true),
|
|
Name = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: true),
|
|
Properties = table.Column<string>(type: "text", nullable: true),
|
|
Resources = table.Column<string>(type: "text", nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
|
DeleterId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
DeletionTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_OpenIddictScopes", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpAuditLogActions",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
AuditLogId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ServiceName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
MethodName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
Parameters = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: true),
|
|
ExecutionTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
ExecutionDuration = table.Column<int>(type: "integer", nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
|
|
column: x => x.AuditLogId,
|
|
principalTable: "AbpAuditLogs",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpEntityChanges",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
AuditLogId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ChangeTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
ChangeType = table.Column<byte>(type: "smallint", nullable: false),
|
|
EntityTenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
EntityId = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
EntityTypeFullName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
|
|
column: x => x.AuditLogId,
|
|
principalTable: "AbpAuditLogs",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpBlobs",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ContainerId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
Content = table.Column<byte[]>(type: "bytea", maxLength: 2147483647, nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpBlobs", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_AbpBlobs_AbpBlobContainers_ContainerId",
|
|
column: x => x.ContainerId,
|
|
principalTable: "AbpBlobContainers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpOrganizationUnitRoles",
|
|
columns: table => new
|
|
{
|
|
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
OrganizationUnitId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId });
|
|
table.ForeignKey(
|
|
name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationU~",
|
|
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<Guid>(type: "uuid", nullable: false),
|
|
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ClaimType = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
ClaimValue = table.Column<string>(type: "character varying(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<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
Value = table.Column<string>(type: "character varying(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<Guid>(type: "uuid", nullable: false),
|
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ClaimType = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
ClaimValue = table.Column<string>(type: "character varying(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<Guid>(type: "uuid", nullable: false),
|
|
LoginProvider = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ProviderKey = table.Column<string>(type: "character varying(196)", maxLength: 196, nullable: false),
|
|
ProviderDisplayName = table.Column<string>(type: "character varying(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<Guid>(type: "uuid", nullable: false),
|
|
OrganizationUnitId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId });
|
|
table.ForeignKey(
|
|
name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationU~",
|
|
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<Guid>(type: "uuid", nullable: false),
|
|
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", 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<Guid>(type: "uuid", nullable: false),
|
|
LoginProvider = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
Value = table.Column<string>(type: "text", 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<Guid>(type: "uuid", nullable: false),
|
|
ApplicationId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
CreationDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
Properties = table.Column<string>(type: "text", nullable: true),
|
|
Scopes = table.Column<string>(type: "text", nullable: true),
|
|
Status = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
Subject = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: true),
|
|
Type = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_OpenIddictAuthorizations_OpenIddictApplications_Application~",
|
|
column: x => x.ApplicationId,
|
|
principalTable: "OpenIddictApplications",
|
|
principalColumn: "Id");
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpEntityPropertyChanges",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
EntityChangeId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
NewValue = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
|
OriginalValue = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: true),
|
|
PropertyName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
|
|
PropertyTypeFullName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
|
|
column: x => x.EntityChangeId,
|
|
principalTable: "AbpEntityChanges",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "OpenIddictTokens",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ApplicationId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
AuthorizationId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
CreationDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
ExpirationDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
Payload = table.Column<string>(type: "text", nullable: true),
|
|
Properties = table.Column<string>(type: "text", nullable: true),
|
|
RedemptionDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
|
ReferenceId = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
|
Status = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
|
|
Subject = table.Column<string>(type: "character varying(400)", maxLength: 400, nullable: true),
|
|
Type = table.Column<string>(type: "character varying(150)", maxLength: 150, nullable: true),
|
|
ExtraProperties = table.Column<string>(type: "text", nullable: false),
|
|
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false)
|
|
},
|
|
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");
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpAuditLogActions_AuditLogId",
|
|
table: "AbpAuditLogActions",
|
|
column: "AuditLogId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Executio~",
|
|
table: "AbpAuditLogActions",
|
|
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
|
|
table: "AbpAuditLogs",
|
|
columns: new[] { "TenantId", "ExecutionTime" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
|
|
table: "AbpAuditLogs",
|
|
columns: new[] { "TenantId", "UserId", "ExecutionTime" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime",
|
|
table: "AbpBackgroundJobs",
|
|
columns: new[] { "IsAbandoned", "NextTryTime" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpBlobContainers_TenantId_Name",
|
|
table: "AbpBlobContainers",
|
|
columns: new[] { "TenantId", "Name" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpBlobs_ContainerId",
|
|
table: "AbpBlobs",
|
|
column: "ContainerId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpBlobs_TenantId_ContainerId_Name",
|
|
table: "AbpBlobs",
|
|
columns: new[] { "TenantId", "ContainerId", "Name" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpEntityChanges_AuditLogId",
|
|
table: "AbpEntityChanges",
|
|
column: "AuditLogId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
|
|
table: "AbpEntityChanges",
|
|
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpEntityPropertyChanges_EntityChangeId",
|
|
table: "AbpEntityPropertyChanges",
|
|
column: "EntityChangeId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpFeatureGroups_Name",
|
|
table: "AbpFeatureGroups",
|
|
column: "Name",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpFeatures_GroupName",
|
|
table: "AbpFeatures",
|
|
column: "GroupName");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpFeatures_Name",
|
|
table: "AbpFeatures",
|
|
column: "Name",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey",
|
|
table: "AbpFeatureValues",
|
|
columns: new[] { "Name", "ProviderName", "ProviderKey" },
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Targe~",
|
|
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_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey",
|
|
table: "AbpPermissionGrants",
|
|
columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" },
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpPermissionGroups_Name",
|
|
table: "AbpPermissionGroups",
|
|
column: "Name",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpPermissions_GroupName",
|
|
table: "AbpPermissions",
|
|
column: "GroupName");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpPermissions_Name",
|
|
table: "AbpPermissions",
|
|
column: "Name",
|
|
unique: true);
|
|
|
|
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_AbpSessions_Device",
|
|
table: "AbpSessions",
|
|
column: "Device");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpSessions_SessionId",
|
|
table: "AbpSessions",
|
|
column: "SessionId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpSessions_TenantId_UserId",
|
|
table: "AbpSessions",
|
|
columns: new[] { "TenantId", "UserId" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpSettingDefinitions_Name",
|
|
table: "AbpSettingDefinitions",
|
|
column: "Name",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
|
|
table: "AbpSettings",
|
|
columns: new[] { "Name", "ProviderName", "ProviderKey" },
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpTenants_Name",
|
|
table: "AbpTenants",
|
|
column: "Name");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpTenants_NormalizedName",
|
|
table: "AbpTenants",
|
|
column: "NormalizedName");
|
|
|
|
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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "AbpAuditLogActions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpAuditLogExcelFiles");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpBackgroundJobs");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpBlobs");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpClaimTypes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpEntityPropertyChanges");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpFeatureGroups");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpFeatures");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpFeatureValues");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpLinkUsers");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpOrganizationUnitRoles");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpPermissionGrants");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpPermissionGroups");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpPermissions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpRoleClaims");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpSecurityLogs");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpSessions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpSettingDefinitions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpSettings");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpTenantConnectionStrings");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpUserClaims");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpUserDelegations");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpUserLogins");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpUserOrganizationUnits");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpUserRoles");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpUserTokens");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AppBooks");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "OpenIddictScopes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "OpenIddictTokens");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpBlobContainers");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpEntityChanges");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpTenants");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpOrganizationUnits");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpRoles");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpUsers");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "OpenIddictAuthorizations");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpAuditLogs");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "OpenIddictApplications");
|
|
}
|
|
}
|
|
}
|