Files
caliverse_server/BrokerApiCore/Migrations/20250317030502_SchemaChanges_120450.cs
2025-05-01 07:23:28 +09:00

297 lines
12 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BrokerApiServer.Migrations
{
/// <inheritdoc />
public partial class SchemaChanges_120450 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_planet_exchange_order_amount_user_limits",
table: "planet_exchange_order_amount_user_limits");
migrationBuilder.DropPrimaryKey(
name: "PK_planet_exchange_order_amount_total_limits",
table: "planet_exchange_order_amount_total_limits");
migrationBuilder.RenameColumn(
name: "UpdatedAt",
table: "planet_exchange_order_amount_user_limits",
newName: "updated_at");
migrationBuilder.RenameColumn(
name: "SeasonId",
table: "planet_exchange_order_amount_user_limits",
newName: "season_id");
migrationBuilder.RenameColumn(
name: "CreatedAt",
table: "planet_exchange_order_amount_user_limits",
newName: "created_at");
migrationBuilder.RenameColumn(
name: "UpdatedAt",
table: "planet_exchange_order_amount_total_limits",
newName: "updated_at");
migrationBuilder.RenameColumn(
name: "SeasonId",
table: "planet_exchange_order_amount_total_limits",
newName: "season_id");
migrationBuilder.RenameColumn(
name: "PlanetId",
table: "planet_exchange_order_amount_total_limits",
newName: "planet_id");
migrationBuilder.RenameColumn(
name: "CreatedAt",
table: "planet_exchange_order_amount_total_limits",
newName: "created_at");
migrationBuilder.AlterColumn<DateTime>(
name: "updated_at",
table: "planet_exchange_order_amount_user_limits",
type: "TIMESTAMP",
nullable: false,
comment: "업데이트 일자",
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.AlterColumn<string>(
name: "season_id",
table: "planet_exchange_order_amount_user_limits",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "시즌 아이디",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "created_at",
table: "planet_exchange_order_amount_user_limits",
type: "TIMESTAMP",
nullable: false,
comment: "생성 일자",
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.AlterColumn<DateTime>(
name: "updated_at",
table: "planet_exchange_order_amount_total_limits",
type: "TIMESTAMP",
nullable: false,
comment: "업데이트 일자",
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.AlterColumn<string>(
name: "season_id",
table: "planet_exchange_order_amount_total_limits",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "시즌 아이디",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<string>(
name: "planet_id",
table: "planet_exchange_order_amount_total_limits",
type: "varchar(50)",
maxLength: 50,
nullable: false,
comment: "플래닛 아이디",
oldClrType: typeof(string),
oldType: "longtext")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "created_at",
table: "planet_exchange_order_amount_total_limits",
type: "TIMESTAMP",
nullable: false,
comment: "생성 일자",
oldClrType: typeof(DateTime),
oldType: "datetime(6)");
migrationBuilder.AddPrimaryKey(
name: "PK_planet_exchange_order_amount_user_limits",
table: "planet_exchange_order_amount_user_limits",
columns: new[] { "exchange_meta_id", "exchange_date", "season_id", "user_guid" });
migrationBuilder.AddPrimaryKey(
name: "PK_planet_exchange_order_amount_total_limits",
table: "planet_exchange_order_amount_total_limits",
columns: new[] { "exchange_meta_id", "exchange_date", "season_id" });
migrationBuilder.CreateIndex(
name: "IX_planet_exchange_order_amount_user_limits_season_id",
table: "planet_exchange_order_amount_user_limits",
column: "season_id");
migrationBuilder.CreateIndex(
name: "IX_planet_exchange_order_amount_total_limits_planet_id",
table: "planet_exchange_order_amount_total_limits",
column: "planet_id");
migrationBuilder.CreateIndex(
name: "IX_planet_exchange_order_amount_total_limits_season_id",
table: "planet_exchange_order_amount_total_limits",
column: "season_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_planet_exchange_order_amount_user_limits",
table: "planet_exchange_order_amount_user_limits");
migrationBuilder.DropIndex(
name: "IX_planet_exchange_order_amount_user_limits_season_id",
table: "planet_exchange_order_amount_user_limits");
migrationBuilder.DropPrimaryKey(
name: "PK_planet_exchange_order_amount_total_limits",
table: "planet_exchange_order_amount_total_limits");
migrationBuilder.DropIndex(
name: "IX_planet_exchange_order_amount_total_limits_planet_id",
table: "planet_exchange_order_amount_total_limits");
migrationBuilder.DropIndex(
name: "IX_planet_exchange_order_amount_total_limits_season_id",
table: "planet_exchange_order_amount_total_limits");
migrationBuilder.RenameColumn(
name: "updated_at",
table: "planet_exchange_order_amount_user_limits",
newName: "UpdatedAt");
migrationBuilder.RenameColumn(
name: "created_at",
table: "planet_exchange_order_amount_user_limits",
newName: "CreatedAt");
migrationBuilder.RenameColumn(
name: "season_id",
table: "planet_exchange_order_amount_user_limits",
newName: "SeasonId");
migrationBuilder.RenameColumn(
name: "updated_at",
table: "planet_exchange_order_amount_total_limits",
newName: "UpdatedAt");
migrationBuilder.RenameColumn(
name: "planet_id",
table: "planet_exchange_order_amount_total_limits",
newName: "PlanetId");
migrationBuilder.RenameColumn(
name: "created_at",
table: "planet_exchange_order_amount_total_limits",
newName: "CreatedAt");
migrationBuilder.RenameColumn(
name: "season_id",
table: "planet_exchange_order_amount_total_limits",
newName: "SeasonId");
migrationBuilder.AlterColumn<DateTime>(
name: "UpdatedAt",
table: "planet_exchange_order_amount_user_limits",
type: "datetime(6)",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "TIMESTAMP",
oldComment: "업데이트 일자");
migrationBuilder.AlterColumn<DateTime>(
name: "CreatedAt",
table: "planet_exchange_order_amount_user_limits",
type: "datetime(6)",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "TIMESTAMP",
oldComment: "생성 일자");
migrationBuilder.AlterColumn<string>(
name: "SeasonId",
table: "planet_exchange_order_amount_user_limits",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "시즌 아이디")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "UpdatedAt",
table: "planet_exchange_order_amount_total_limits",
type: "datetime(6)",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "TIMESTAMP",
oldComment: "업데이트 일자");
migrationBuilder.AlterColumn<string>(
name: "PlanetId",
table: "planet_exchange_order_amount_total_limits",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "플래닛 아이디")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<DateTime>(
name: "CreatedAt",
table: "planet_exchange_order_amount_total_limits",
type: "datetime(6)",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "TIMESTAMP",
oldComment: "생성 일자");
migrationBuilder.AlterColumn<string>(
name: "SeasonId",
table: "planet_exchange_order_amount_total_limits",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(50)",
oldMaxLength: 50,
oldComment: "시즌 아이디")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddPrimaryKey(
name: "PK_planet_exchange_order_amount_user_limits",
table: "planet_exchange_order_amount_user_limits",
columns: new[] { "exchange_meta_id", "exchange_date", "user_guid" });
migrationBuilder.AddPrimaryKey(
name: "PK_planet_exchange_order_amount_total_limits",
table: "planet_exchange_order_amount_total_limits",
columns: new[] { "exchange_meta_id", "exchange_date" });
}
}
}