using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Infrastructure.Persistence.Migrations { /// public partial class AddPaymentOrder : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "External_DanalLiveClientKeyEnc", table: "Config", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "External_DanalLiveCpid", table: "Config", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "External_DanalLiveSecretKeyEnc", table: "Config", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "External_DanalPayMode", table: "Config", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "External_DanalTestClientKeyEnc", table: "Config", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "External_DanalTestCpid", table: "Config", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "External_DanalTestSecretKeyEnc", table: "Config", type: "nvarchar(max)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalCardFeeAmount", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalCardFeeRate", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalSimpleFeeAmount", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalSimpleFeeRate", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalTransferFeeAmount", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalTransferFeeRate", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalVbankFeeAmount", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.AddColumn( name: "Payment_DanalVbankFeeRate", table: "Config", type: "decimal(18,2)", nullable: true); migrationBuilder.CreateTable( name: "PaymentOrder", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), MemberID = table.Column(type: "int", nullable: false), OrderId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), TransactionId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), Amount = table.Column(type: "int", nullable: false), PointAmount = table.Column(type: "int", nullable: false), VatAmount = table.Column(type: "int", nullable: false), PaymentMethod = table.Column(type: "int", nullable: false), Status = table.Column(type: "int", nullable: false), PaidAt = table.Column(type: "datetime2", nullable: true), CancelledAt = table.Column(type: "datetime2", nullable: true), FailReason = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), VirtualAccountNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), VirtualAccountBank = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true), VirtualAccountHolder = table.Column(type: "nvarchar(32)", maxLength: 32, nullable: true), VirtualAccountExpireAt = table.Column(type: "datetime2", nullable: true), CreatedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PaymentOrder", x => x.ID); table.ForeignKey( name: "FK_PaymentOrder_Member_MemberID", column: x => x.MemberID, principalTable: "Member", principalColumn: "ID"); }, comment: "PG 결제 주문"); migrationBuilder.CreateIndex( name: "IX_PaymentOrder_MemberID", table: "PaymentOrder", column: "MemberID"); migrationBuilder.CreateIndex( name: "IX_PaymentOrder_OrderId", table: "PaymentOrder", column: "OrderId", unique: true); migrationBuilder.CreateIndex( name: "IX_PaymentOrder_Status", table: "PaymentOrder", column: "Status"); migrationBuilder.CreateIndex( name: "IX_PaymentOrder_TransactionId", table: "PaymentOrder", column: "TransactionId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PaymentOrder"); migrationBuilder.DropColumn( name: "External_DanalLiveClientKeyEnc", table: "Config"); migrationBuilder.DropColumn( name: "External_DanalLiveCpid", table: "Config"); migrationBuilder.DropColumn( name: "External_DanalLiveSecretKeyEnc", table: "Config"); migrationBuilder.DropColumn( name: "External_DanalPayMode", table: "Config"); migrationBuilder.DropColumn( name: "External_DanalTestClientKeyEnc", table: "Config"); migrationBuilder.DropColumn( name: "External_DanalTestCpid", table: "Config"); migrationBuilder.DropColumn( name: "External_DanalTestSecretKeyEnc", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalCardFeeAmount", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalCardFeeRate", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalSimpleFeeAmount", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalSimpleFeeRate", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalTransferFeeAmount", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalTransferFeeRate", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalVbankFeeAmount", table: "Config"); migrationBuilder.DropColumn( name: "Payment_DanalVbankFeeRate", table: "Config"); } } }