| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddPostCheer : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<int>(
- name: "Reward_CheerDailyMax",
- table: "Config",
- type: "int",
- nullable: false,
- defaultValue: 0);
- migrationBuilder.AddColumn<int>(
- name: "Reward_CheerFeePercent",
- table: "Config",
- type: "int",
- nullable: false,
- defaultValue: 0);
- migrationBuilder.AddColumn<int>(
- name: "Reward_CheerMinAmount",
- table: "Config",
- type: "int",
- nullable: false,
- defaultValue: 0);
- migrationBuilder.CreateTable(
- name: "PostCheer",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
- .Annotation("SqlServer:Identity", "1, 1"),
- PostID = table.Column<int>(type: "int", nullable: false, comment: "응원 대상 게시글 ID"),
- FromMemberID = table.Column<int>(type: "int", nullable: false, comment: "응원 발신자 회원 ID"),
- ToMemberID = table.Column<int>(type: "int", nullable: false, comment: "응원 수신자(글 작성자) 회원 ID"),
- Amount = table.Column<int>(type: "int", nullable: false, comment: "총 응원 금액"),
- FeeAmount = table.Column<int>(type: "int", nullable: false, comment: "플랫폼 수수료(소각분)"),
- NetAmount = table.Column<int>(type: "int", nullable: false, comment: "작성자 수령 순액(Reward 적립)"),
- Message = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "응원 한마디"),
- CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "응원 일시")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PostCheer", x => x.ID);
- table.ForeignKey(
- name: "FK_PostCheer_Member_FromMemberID",
- column: x => x.FromMemberID,
- principalTable: "Member",
- principalColumn: "ID");
- table.ForeignKey(
- name: "FK_PostCheer_Member_ToMemberID",
- column: x => x.ToMemberID,
- principalTable: "Member",
- principalColumn: "ID");
- table.ForeignKey(
- name: "FK_PostCheer_Post_PostID",
- column: x => x.PostID,
- principalTable: "Post",
- principalColumn: "ID");
- },
- comment: "분석글 응원(Cheer) — D3 M4");
- migrationBuilder.CreateIndex(
- name: "IX_PostCheer_FromMemberID_CreatedAt",
- table: "PostCheer",
- columns: new[] { "FromMemberID", "CreatedAt" });
- migrationBuilder.CreateIndex(
- name: "IX_PostCheer_PostID",
- table: "PostCheer",
- column: "PostID");
- migrationBuilder.CreateIndex(
- name: "IX_PostCheer_ToMemberID_CreatedAt",
- table: "PostCheer",
- columns: new[] { "ToMemberID", "CreatedAt" });
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "PostCheer");
- migrationBuilder.DropColumn(
- name: "Reward_CheerDailyMax",
- table: "Config");
- migrationBuilder.DropColumn(
- name: "Reward_CheerFeePercent",
- table: "Config");
- migrationBuilder.DropColumn(
- name: "Reward_CheerMinAmount",
- table: "Config");
- }
- }
- }
|