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

117 lines
5.6 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BrokerApiServer.Migrations
{
/// <inheritdoc />
public partial class SchemaChanges_105106 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "planet_info",
columns: table => new
{
planet_id = table.Column<string>(type: "varchar(50)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
planet_name = table.Column<string>(type: "varchar(32)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
company_name = table.Column<string>(type: "varchar(32)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
secret_key = table.Column<string>(type: "varchar(50)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
server_type = table.Column<string>(type: "varchar(50)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
description = table.Column<string>(type: "varchar(255)", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
created_at = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP", comment: "생성 시간"),
updated_at = table.Column<DateTime>(type: "timestamp", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", comment: "수정 시간")
},
constraints: table =>
{
table.PrimaryKey("PK_planet_info", x => x.planet_id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "sapphire_exchange_order",
columns: table => new
{
order_id = table.Column<string>(type: "varchar(50)", nullable: false, comment: "사파이어 교환 주문 아이디 guid")
.Annotation("MySql:CharSet", "utf8mb4"),
account_id = table.Column<ulong>(type: "bigint unsigned", nullable: false, comment: "sso 계정 아이디"),
order_status = table.Column<sbyte>(type: "tinyint", nullable: false, comment: "사파이어 교환 주문 상태"),
user_guid = table.Column<string>(type: "varchar(50)", nullable: false, comment: "유저 아이디")
.Annotation("MySql:CharSet", "utf8mb4"),
planet_id = table.Column<string>(type: "varchar(50)", nullable: false, comment: "플래닛 아이디")
.Annotation("MySql:CharSet", "utf8mb4"),
sapphire_reduced_amount = table.Column<decimal>(type: "decimal(20,0)", nullable: false, comment: "사파이어 차감 수량"),
planet_money_amount = table.Column<decimal>(type: "decimal(20,0)", nullable: false, comment: "플래닛에서 발급한 재화 수량"),
created_at = table.Column<DateTime>(type: "timestamp", nullable: false, comment: "사파이어 교환 주문 시작 시간"),
completed_at = table.Column<DateTime>(type: "timestamp", nullable: true, comment: "사파이어 교환 주문 완료 시간")
},
constraints: table =>
{
table.PrimaryKey("PK_sapphire_exchange_order", x => x.order_id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_planet_info_company_name",
table: "planet_info",
column: "company_name");
migrationBuilder.CreateIndex(
name: "IX_planet_info_planet_name",
table: "planet_info",
column: "planet_name");
migrationBuilder.CreateIndex(
name: "IX_planet_info_secret_key",
table: "planet_info",
column: "secret_key");
migrationBuilder.CreateIndex(
name: "IX_sapphire_exchange_order_account_id",
table: "sapphire_exchange_order",
column: "account_id");
migrationBuilder.CreateIndex(
name: "IX_sapphire_exchange_order_created_at",
table: "sapphire_exchange_order",
column: "created_at");
migrationBuilder.CreateIndex(
name: "IX_sapphire_exchange_order_order_status",
table: "sapphire_exchange_order",
column: "order_status");
migrationBuilder.CreateIndex(
name: "IX_sapphire_exchange_order_planet_id",
table: "sapphire_exchange_order",
column: "planet_id");
migrationBuilder.CreateIndex(
name: "IX_sapphire_exchange_order_user_guid",
table: "sapphire_exchange_order",
column: "user_guid");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "planet_info");
migrationBuilder.DropTable(
name: "sapphire_exchange_order");
}
}
}