using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace BrokerApiCore.Migrations { /// public partial class SchemaChanges_110113 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "planet_exchange_order_amount_total_limits", columns: table => new { exchange_meta_id = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "교환 메타 아이디") .Annotation("MySql:CharSet", "utf8mb4"), exchange_date = table.Column(type: "date", nullable: false, comment: "교환 일자"), PlanetId = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SeasonId = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), daily_amount = table.Column(type: "INT", nullable: false, comment: "일일 교환 메타 수량 합계"), CreatedAt = table.Column(type: "datetime(6)", nullable: false), UpdatedAt = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_planet_exchange_order_amount_total_limits", x => new { x.exchange_meta_id, x.exchange_date }); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "planet_exchange_order_amount_user_limits", columns: table => new { exchange_meta_id = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "교환 메타 아이디") .Annotation("MySql:CharSet", "utf8mb4"), exchange_date = table.Column(type: "date", nullable: false, comment: "교환 일자"), user_guid = table.Column(type: "varchar(50)", maxLength: 50, nullable: false, comment: "유저 아이디 (GUID)") .Annotation("MySql:CharSet", "utf8mb4"), PlanetId = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SeasonId = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), daily_amount = table.Column(type: "INT", nullable: false, comment: "사용자별 일일 교환 메타 수량"), CreatedAt = table.Column(type: "datetime(6)", nullable: false), UpdatedAt = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_planet_exchange_order_amount_user_limits", x => new { x.exchange_meta_id, x.exchange_date, x.user_guid }); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_planet_exchange_order_amount_total_limits_exchange_date", table: "planet_exchange_order_amount_total_limits", column: "exchange_date"); migrationBuilder.CreateIndex( name: "IX_planet_exchange_order_amount_total_limits_exchange_meta_id", table: "planet_exchange_order_amount_total_limits", column: "exchange_meta_id"); migrationBuilder.CreateIndex( name: "IX_planet_exchange_order_amount_user_limits_exchange_date", table: "planet_exchange_order_amount_user_limits", column: "exchange_date"); migrationBuilder.CreateIndex( name: "IX_planet_exchange_order_amount_user_limits_exchange_meta_id", table: "planet_exchange_order_amount_user_limits", column: "exchange_meta_id"); migrationBuilder.CreateIndex( name: "IX_planet_exchange_order_amount_user_limits_user_guid", table: "planet_exchange_order_amount_user_limits", column: "user_guid"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "planet_exchange_order_amount_total_limits"); migrationBuilder.DropTable( name: "planet_exchange_order_amount_user_limits"); } } }