| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddStatusItems : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterTable(
- name: "MemberItem",
- comment: "계정 귀속 아이템 (지위 아이템 장착형 + 소모품)",
- oldComment: "계정 귀속 소모품 아이템");
- migrationBuilder.AlterColumn<byte>(
- name: "ItemKind",
- table: "Product",
- type: "tinyint",
- nullable: true,
- comment: "아이템 종류 (null=일반상품, 2~4=지위, 5~11=소모품)",
- oldClrType: typeof(byte),
- oldType: "tinyint",
- oldNullable: true,
- oldComment: "소모품 종류 (null=일반상품, 5~11=소모품)");
- migrationBuilder.AlterColumn<int>(
- name: "DurationDays",
- table: "Product",
- type: "int",
- nullable: false,
- defaultValue: 0,
- comment: "아이템 효과 지속일 (0=즉시소모/영구)",
- oldClrType: typeof(int),
- oldType: "int",
- oldDefaultValue: 0,
- oldComment: "소모품 효과 지속일 (0=즉시소모)");
- migrationBuilder.AddColumn<string>(
- name: "EffectPayload",
- table: "Product",
- type: "nvarchar(max)",
- nullable: true,
- comment: "지위 아이템 효과 페이로드 JSON (색상·아이콘·애니메이션)");
- migrationBuilder.AddColumn<bool>(
- name: "IsGiftable",
- table: "Product",
- type: "bit",
- nullable: false,
- defaultValue: false,
- comment: "선물하기 가능 여부");
- migrationBuilder.AddColumn<string>(
- name: "GiftMessage",
- table: "Order",
- type: "nvarchar(200)",
- maxLength: 200,
- nullable: true,
- comment: "선물 메시지");
- migrationBuilder.AddColumn<int>(
- name: "GiftToMemberID",
- table: "Order",
- type: "int",
- nullable: true,
- comment: "선물 수신자 회원 ID (null=본인구매)");
- migrationBuilder.AlterColumn<int>(
- name: "MemberID",
- table: "MemberItem",
- type: "int",
- nullable: false,
- comment: "회원 ID (지급 대상)",
- oldClrType: typeof(int),
- oldType: "int",
- oldComment: "회원 ID");
- migrationBuilder.AlterColumn<byte>(
- name: "Kind",
- table: "MemberItem",
- type: "tinyint",
- nullable: false,
- comment: "아이템 종류 (2~4=지위, 5~11=소모품)",
- oldClrType: typeof(byte),
- oldType: "tinyint",
- oldComment: "아이템 종류 (5~11)");
- migrationBuilder.AlterColumn<int>(
- name: "DurationDays",
- table: "MemberItem",
- type: "int",
- nullable: false,
- defaultValue: 0,
- comment: "효과 지속일 (0=즉시소모/영구)",
- oldClrType: typeof(int),
- oldType: "int",
- oldDefaultValue: 0,
- oldComment: "효과 지속일 (0=즉시소모)");
- migrationBuilder.AddColumn<byte>(
- name: "EquipSlot",
- table: "MemberItem",
- type: "tinyint",
- nullable: true,
- comment: "장착 슬롯 (1=Badge, 2=NicknameEffect, 3=CommentEffect, null=소모품)");
- migrationBuilder.AddColumn<DateTime>(
- name: "ExpiresAt",
- table: "MemberItem",
- type: "datetime2",
- nullable: true,
- comment: "만료 일시 (null=영구)");
- migrationBuilder.AddColumn<int>(
- name: "GiftFromMemberID",
- table: "MemberItem",
- type: "int",
- nullable: true,
- comment: "선물 발신자 회원 ID (null=본인구매)");
- migrationBuilder.AddColumn<bool>(
- name: "IsEquipped",
- table: "MemberItem",
- type: "bit",
- nullable: false,
- defaultValue: false,
- comment: "장착 여부 (지위 아이템)");
- migrationBuilder.CreateIndex(
- name: "IX_MemberItem_MemberID_EquipSlot",
- table: "MemberItem",
- columns: new[] { "MemberID", "EquipSlot" },
- unique: true,
- filter: "[IsEquipped] = 1");
- migrationBuilder.CreateIndex(
- name: "IX_MemberItem_MemberID_ExpiresAt",
- table: "MemberItem",
- columns: new[] { "MemberID", "ExpiresAt" });
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropIndex(
- name: "IX_MemberItem_MemberID_EquipSlot",
- table: "MemberItem");
- migrationBuilder.DropIndex(
- name: "IX_MemberItem_MemberID_ExpiresAt",
- table: "MemberItem");
- migrationBuilder.DropColumn(
- name: "EffectPayload",
- table: "Product");
- migrationBuilder.DropColumn(
- name: "IsGiftable",
- table: "Product");
- migrationBuilder.DropColumn(
- name: "GiftMessage",
- table: "Order");
- migrationBuilder.DropColumn(
- name: "GiftToMemberID",
- table: "Order");
- migrationBuilder.DropColumn(
- name: "EquipSlot",
- table: "MemberItem");
- migrationBuilder.DropColumn(
- name: "ExpiresAt",
- table: "MemberItem");
- migrationBuilder.DropColumn(
- name: "GiftFromMemberID",
- table: "MemberItem");
- migrationBuilder.DropColumn(
- name: "IsEquipped",
- table: "MemberItem");
- migrationBuilder.AlterTable(
- name: "MemberItem",
- comment: "계정 귀속 소모품 아이템",
- oldComment: "계정 귀속 아이템 (지위 아이템 장착형 + 소모품)");
- migrationBuilder.AlterColumn<byte>(
- name: "ItemKind",
- table: "Product",
- type: "tinyint",
- nullable: true,
- comment: "소모품 종류 (null=일반상품, 5~11=소모품)",
- oldClrType: typeof(byte),
- oldType: "tinyint",
- oldNullable: true,
- oldComment: "아이템 종류 (null=일반상품, 2~4=지위, 5~11=소모품)");
- migrationBuilder.AlterColumn<int>(
- name: "DurationDays",
- table: "Product",
- type: "int",
- nullable: false,
- defaultValue: 0,
- comment: "소모품 효과 지속일 (0=즉시소모)",
- oldClrType: typeof(int),
- oldType: "int",
- oldDefaultValue: 0,
- oldComment: "아이템 효과 지속일 (0=즉시소모/영구)");
- migrationBuilder.AlterColumn<int>(
- name: "MemberID",
- table: "MemberItem",
- type: "int",
- nullable: false,
- comment: "회원 ID",
- oldClrType: typeof(int),
- oldType: "int",
- oldComment: "회원 ID (지급 대상)");
- migrationBuilder.AlterColumn<byte>(
- name: "Kind",
- table: "MemberItem",
- type: "tinyint",
- nullable: false,
- comment: "아이템 종류 (5~11)",
- oldClrType: typeof(byte),
- oldType: "tinyint",
- oldComment: "아이템 종류 (2~4=지위, 5~11=소모품)");
- migrationBuilder.AlterColumn<int>(
- name: "DurationDays",
- table: "MemberItem",
- type: "int",
- nullable: false,
- defaultValue: 0,
- comment: "효과 지속일 (0=즉시소모)",
- oldClrType: typeof(int),
- oldType: "int",
- oldDefaultValue: 0,
- oldComment: "효과 지속일 (0=즉시소모/영구)");
- }
- }
- }
|