using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BaseService.Migrations
{
///
public partial class init : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ApplicationName = 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"),
TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
TenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ImpersonatorUserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ImpersonatorUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ImpersonatorTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ImpersonatorTenantName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExecutionTime = table.Column(type: "datetime(6)", nullable: false),
ExecutionDuration = table.Column(type: "int", nullable: false),
ClientIpAddress = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ClientName = table.Column(type: "varchar(128)", maxLength: 128, 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"),
BrowserInfo = table.Column(type: "varchar(512)", maxLength: 512, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
HttpMethod = table.Column(type: "varchar(16)", maxLength: 16, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Url = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Exceptions = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Comments = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
HttpStatusCode = table.Column(type: "int", nullable: true),
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_AbpAuditLogs", x => x.Id);
})
.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: "AbpPermissionGrants",
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(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpPermissionGroups",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpPermissions",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
GroupName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ParentName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
DisplayName = table.Column(type: "varchar(256)", maxLength: 256, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsEnabled = table.Column(type: "tinyint(1)", nullable: false),
MultiTenancySide = table.Column(type: "tinyint unsigned", nullable: false),
Providers = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
StateCheckers = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissions", x => x.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: "AbpSettings",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ProviderName = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ProviderKey = table.Column(type: "varchar(64)", maxLength: 64, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpTenants",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column(type: "varchar(64)", maxLength: 64, 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_AbpTenants", 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: "base_dict",
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(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: 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"),
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")
},
constraints: table =>
{
table.PrimaryKey("PK_base_dict", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "base_dict_details",
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"),
Pid = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Label = table.Column(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Value = table.Column(type: "varchar(256)", maxLength: 256, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Sort = table.Column(type: "smallint", nullable: false),
IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: 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"),
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")
},
constraints: table =>
{
table.PrimaryKey("PK_base_dict_details", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "base_jobs",
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(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Enabled = table.Column(type: "tinyint(1)", nullable: false),
Sort = table.Column(type: "int", nullable: false),
Description = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: 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"),
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")
},
constraints: table =>
{
table.PrimaryKey("PK_base_jobs", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "base_menu",
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"),
FormId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Pid = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
CategoryId = table.Column(type: "int", nullable: false),
Name = table.Column(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Label = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Sort = table.Column(type: "int", nullable: false),
Path = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Component = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Permission = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Icon = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Hidden = table.Column(type: "tinyint(1)", nullable: false),
AlwaysShow = table.Column(type: "tinyint(1)", nullable: false),
IsHost = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false),
IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: 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"),
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")
},
constraints: table =>
{
table.PrimaryKey("PK_base_menu", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "base_orgs",
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"),
CategoryId = table.Column(type: "smallint", nullable: false),
Pid = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Name = table.Column(type: "varchar(50)", maxLength: 50, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
FullName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Sort = table.Column(type: "int", nullable: false),
Leaf = table.Column(type: "tinyint(1)", nullable: false),
CascadeId = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Enabled = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false),
IsDeleted = table.Column(type: "tinyint(1)", nullable: false, defaultValue: 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"),
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")
},
constraints: table =>
{
table.PrimaryKey("PK_base_orgs", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "base_role_menu",
columns: table => new
{
RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
MenuId = 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_base_role_menu", x => new { x.RoleId, x.MenuId });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "base_user_jobs",
columns: table => new
{
UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobId = 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_base_user_jobs", x => new { x.UserId, x.JobId });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "base_user_orgs",
columns: table => new
{
UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
OrganizationId = 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_base_user_orgs", x => new { x.UserId, x.OrganizationId });
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
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"),
AuditLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ServiceName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
MethodName = table.Column(type: "varchar(128)", maxLength: 128, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Parameters = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExecutionTime = table.Column(type: "datetime(6)", nullable: false),
ExecutionDuration = table.Column(type: "int", nullable: false),
ExtraProperties = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
AuditLogId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
ChangeTime = table.Column(type: "datetime(6)", nullable: false),
ChangeType = table.Column(type: "tinyint unsigned", nullable: false),
EntityTenantId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
EntityId = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EntityTypeFullName = table.Column(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
},
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);
})
.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: "AbpTenantConnectionStrings",
columns: table => new
{
TenantId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column