You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
158 lines
8.1 KiB
158 lines
8.1 KiB
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace LY.MicroService.BackendAdmin.Migrations
|
|
{
|
|
public partial class ReInitlizeDbMigration : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterDatabase()
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpFeatureValues",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Value = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProviderName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProviderKey = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpPermissionGrants",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
|
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProviderName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProviderKey = table.Column<string>(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: "AbpSettings",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Value = table.Column<string>(type: "varchar(2048)", maxLength: 2048, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProviderName = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ProviderKey = table.Column<string>(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<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
|
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
|
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
|
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
|
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
|
|
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
|
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_AbpTenants", x => x.Id);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "AbpTenantConnectionStrings",
|
|
columns: table => new
|
|
{
|
|
TenantId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
|
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
|
Value = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: false)
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
},
|
|
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);
|
|
})
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey",
|
|
table: "AbpFeatureValues",
|
|
columns: new[] { "Name", "ProviderName", "ProviderKey" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
|
|
table: "AbpPermissionGrants",
|
|
columns: new[] { "Name", "ProviderName", "ProviderKey" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
|
|
table: "AbpSettings",
|
|
columns: new[] { "Name", "ProviderName", "ProviderKey" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_AbpTenants_Name",
|
|
table: "AbpTenants",
|
|
column: "Name");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "AbpFeatureValues");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpPermissionGrants");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpSettings");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpTenantConnectionStrings");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "AbpTenants");
|
|
}
|
|
}
|
|
}
|
|
|