537 lines
22 KiB
C#
537 lines
22 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace BrokerApiServer.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class SchemaChanges_152918 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_planet_exchange_orders",
|
|
table: "planet_exchange_orders");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_planet_exchange_orders_account_id",
|
|
table: "planet_exchange_orders");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_planet_exchange_orders_created_at",
|
|
table: "planet_exchange_orders");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_planet_exchange_orders_order_status",
|
|
table: "planet_exchange_orders");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_planet_exchange_orders_planet_id",
|
|
table: "planet_exchange_orders");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_planet_exchange_orders_user_guid",
|
|
table: "planet_exchange_orders");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "planet_exchange_orders",
|
|
newName: "PlanetItemExchangeOrders");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "user_guid",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "유저 아이디 (GUID)",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "유저 아이디 (GUID)")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 8)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "season_id",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "시즌 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "시즌 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 4)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "planet_item_type",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "플래닛 아이템 타입",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "플래닛 아이템 타입")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 12)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "planet_item_quantity",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "INT",
|
|
nullable: false,
|
|
comment: "플래닛 아이템 갯수",
|
|
oldClrType: typeof(int),
|
|
oldType: "INT",
|
|
oldComment: "플래닛 아이템 갯수")
|
|
.Annotation("Relational:ColumnOrder", 14);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "planet_item_id",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "플래닛 아이템 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "플래닛 아이템 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 13)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "planet_id",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "플래닛 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "플래닛 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 3)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "order_status",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "교환 주문 상태",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "교환 주문 상태")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 2)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "exchange_meta_id",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "교환 메타 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "교환 메타 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 5)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "exchange_meta_amount",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "INT",
|
|
nullable: false,
|
|
comment: "교환 메타 수량",
|
|
oldClrType: typeof(int),
|
|
oldType: "INT",
|
|
oldComment: "교환 메타 수량")
|
|
.Annotation("Relational:ColumnOrder", 6);
|
|
|
|
migrationBuilder.AlterColumn<DateTime>(
|
|
name: "created_at",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "TIMESTAMP",
|
|
nullable: false,
|
|
defaultValueSql: "CURRENT_TIMESTAMP",
|
|
comment: "교환 주문 시작 시간",
|
|
oldClrType: typeof(DateTime),
|
|
oldType: "TIMESTAMP",
|
|
oldDefaultValueSql: "CURRENT_TIMESTAMP",
|
|
oldComment: "교환 주문 시작 시간")
|
|
.Annotation("Relational:ColumnOrder", 15);
|
|
|
|
migrationBuilder.AlterColumn<DateTime>(
|
|
name: "completed_at",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "TIMESTAMP",
|
|
nullable: true,
|
|
comment: "교환 주문 완료 시간",
|
|
oldClrType: typeof(DateTime),
|
|
oldType: "TIMESTAMP",
|
|
oldNullable: true,
|
|
oldComment: "교환 주문 완료 시간")
|
|
.Annotation("Relational:ColumnOrder", 16);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "caliverse_item_type",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "칼리버스 아이템 타입",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "칼리버스 아이템 타입")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 9)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "caliverse_item_quantity",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "INT",
|
|
nullable: false,
|
|
comment: "칼리버스 아이템 갯수",
|
|
oldClrType: typeof(int),
|
|
oldType: "INT",
|
|
oldComment: "칼리버스 아이템 갯수")
|
|
.Annotation("Relational:ColumnOrder", 11);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "caliverse_item_id",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "칼리버스 아이템 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "칼리버스 아이템 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 10)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "account_id",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "SSO 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "SSO 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 7)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "order_id",
|
|
table: "PlanetItemExchangeOrders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "교환 주문 아이디 (GUID)",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "교환 주문 아이디 (GUID)")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.Annotation("Relational:ColumnOrder", 1)
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_PlanetItemExchangeOrders",
|
|
table: "PlanetItemExchangeOrders",
|
|
column: "order_id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropPrimaryKey(
|
|
name: "PK_PlanetItemExchangeOrders",
|
|
table: "PlanetItemExchangeOrders");
|
|
|
|
migrationBuilder.RenameTable(
|
|
name: "PlanetItemExchangeOrders",
|
|
newName: "planet_exchange_orders");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "user_guid",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "유저 아이디 (GUID)",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "유저 아이디 (GUID)")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 8);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "season_id",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "시즌 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "시즌 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 4);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "planet_item_type",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "플래닛 아이템 타입",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "플래닛 아이템 타입")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 12);
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "planet_item_quantity",
|
|
table: "planet_exchange_orders",
|
|
type: "INT",
|
|
nullable: false,
|
|
comment: "플래닛 아이템 갯수",
|
|
oldClrType: typeof(int),
|
|
oldType: "INT",
|
|
oldComment: "플래닛 아이템 갯수")
|
|
.OldAnnotation("Relational:ColumnOrder", 14);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "planet_item_id",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "플래닛 아이템 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "플래닛 아이템 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 13);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "planet_id",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "플래닛 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "플래닛 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 3);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "order_status",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "교환 주문 상태",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "교환 주문 상태")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 2);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "exchange_meta_id",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "교환 메타 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "교환 메타 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 5);
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "exchange_meta_amount",
|
|
table: "planet_exchange_orders",
|
|
type: "INT",
|
|
nullable: false,
|
|
comment: "교환 메타 수량",
|
|
oldClrType: typeof(int),
|
|
oldType: "INT",
|
|
oldComment: "교환 메타 수량")
|
|
.OldAnnotation("Relational:ColumnOrder", 6);
|
|
|
|
migrationBuilder.AlterColumn<DateTime>(
|
|
name: "created_at",
|
|
table: "planet_exchange_orders",
|
|
type: "TIMESTAMP",
|
|
nullable: false,
|
|
defaultValueSql: "CURRENT_TIMESTAMP",
|
|
comment: "교환 주문 시작 시간",
|
|
oldClrType: typeof(DateTime),
|
|
oldType: "TIMESTAMP",
|
|
oldDefaultValueSql: "CURRENT_TIMESTAMP",
|
|
oldComment: "교환 주문 시작 시간")
|
|
.OldAnnotation("Relational:ColumnOrder", 15);
|
|
|
|
migrationBuilder.AlterColumn<DateTime>(
|
|
name: "completed_at",
|
|
table: "planet_exchange_orders",
|
|
type: "TIMESTAMP",
|
|
nullable: true,
|
|
comment: "교환 주문 완료 시간",
|
|
oldClrType: typeof(DateTime),
|
|
oldType: "TIMESTAMP",
|
|
oldNullable: true,
|
|
oldComment: "교환 주문 완료 시간")
|
|
.OldAnnotation("Relational:ColumnOrder", 16);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "caliverse_item_type",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "칼리버스 아이템 타입",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "칼리버스 아이템 타입")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 9);
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "caliverse_item_quantity",
|
|
table: "planet_exchange_orders",
|
|
type: "INT",
|
|
nullable: false,
|
|
comment: "칼리버스 아이템 갯수",
|
|
oldClrType: typeof(int),
|
|
oldType: "INT",
|
|
oldComment: "칼리버스 아이템 갯수")
|
|
.OldAnnotation("Relational:ColumnOrder", 11);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "caliverse_item_id",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "칼리버스 아이템 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "칼리버스 아이템 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 10);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "account_id",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "SSO 아이디",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "SSO 아이디")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 7);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "order_id",
|
|
table: "planet_exchange_orders",
|
|
type: "varchar(50)",
|
|
maxLength: 50,
|
|
nullable: false,
|
|
comment: "교환 주문 아이디 (GUID)",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(50)",
|
|
oldMaxLength: 50,
|
|
oldComment: "교환 주문 아이디 (GUID)")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("Relational:ColumnOrder", 1);
|
|
|
|
migrationBuilder.AddPrimaryKey(
|
|
name: "PK_planet_exchange_orders",
|
|
table: "planet_exchange_orders",
|
|
column: "order_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_planet_exchange_orders_account_id",
|
|
table: "planet_exchange_orders",
|
|
column: "account_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_planet_exchange_orders_created_at",
|
|
table: "planet_exchange_orders",
|
|
column: "created_at");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_planet_exchange_orders_order_status",
|
|
table: "planet_exchange_orders",
|
|
column: "order_status");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_planet_exchange_orders_planet_id",
|
|
table: "planet_exchange_orders",
|
|
column: "planet_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_planet_exchange_orders_user_guid",
|
|
table: "planet_exchange_orders",
|
|
column: "user_guid");
|
|
}
|
|
}
|
|
}
|