| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Persistence.Migrations
- {
- /// <inheritdoc />
- public partial class AddGameReleaseDateAndLanguages : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<DateOnly>(
- name: "ReleaseDate",
- table: "Game",
- type: "date",
- nullable: true,
- comment: "게임 출시일");
- migrationBuilder.CreateTable(
- name: "GameLanguage",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- KorName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "언어 한글명"),
- EngName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "언어 영문명"),
- Order = table.Column<int>(type: "int", nullable: false),
- IsActive = table.Column<bool>(type: "bit", nullable: false),
- CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_GameLanguage", x => x.ID);
- },
- comment: "게임 지원 언어 마스터");
- migrationBuilder.CreateTable(
- name: "GameLanguageSupport",
- columns: table => new
- {
- GameID = table.Column<int>(type: "int", nullable: false),
- GameLanguageID = table.Column<int>(type: "int", nullable: false),
- Interface = table.Column<bool>(type: "bit", nullable: false, comment: "인터페이스 지원"),
- FullAudio = table.Column<bool>(type: "bit", nullable: false, comment: "풀 오디오(음성) 지원"),
- Subtitles = table.Column<bool>(type: "bit", nullable: false, comment: "자막 지원")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_GameLanguageSupport", x => new { x.GameID, x.GameLanguageID });
- table.ForeignKey(
- name: "FK_GameLanguageSupport_GameLanguage_GameLanguageID",
- column: x => x.GameLanguageID,
- principalTable: "GameLanguage",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_GameLanguageSupport_Game_GameID",
- column: x => x.GameID,
- principalTable: "Game",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- },
- comment: "게임별 언어 지원 (인터페이스/풀오디오/자막)");
- migrationBuilder.CreateIndex(
- name: "IX_GameLanguage_IsActive_Order",
- table: "GameLanguage",
- columns: new[] { "IsActive", "Order" });
- migrationBuilder.CreateIndex(
- name: "IX_GameLanguage_KorName",
- table: "GameLanguage",
- column: "KorName",
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_GameLanguageSupport_GameLanguageID",
- table: "GameLanguageSupport",
- column: "GameLanguageID");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "GameLanguageSupport");
- migrationBuilder.DropTable(
- name: "GameLanguage");
- migrationBuilder.DropColumn(
- name: "ReleaseDate",
- table: "Game");
- }
- }
- }
|