using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Infrastructure.Persistence.Migrations { /// public partial class AddNiceAuthSession : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "NiceAuthSession", columns: table => new { ID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), DeveloperID = table.Column(type: "int", nullable: false), SessionToken = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false), RequestNo = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), TransactionID = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), WebTransactionID = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), Ticket = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Iterators = table.Column(type: "int", nullable: false), Status = table.Column(type: "int", nullable: false), FailReason = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), CreatedAt = table.Column(type: "datetime2", nullable: false), ExpiresAt = table.Column(type: "datetime2", nullable: false), CompletedAt = table.Column(type: "datetime2", nullable: true) }, constraints: table => { table.PrimaryKey("PK_NiceAuthSession", x => x.ID); table.ForeignKey( name: "FK_NiceAuthSession_Developer_DeveloperID", column: x => x.DeveloperID, principalTable: "Developer", principalColumn: "ID", onDelete: ReferentialAction.Cascade); }, comment: "NICE 통합인증 1회 진행 세션"); migrationBuilder.CreateIndex( name: "IX_NiceAuthSession_DeveloperID_CreatedAt", table: "NiceAuthSession", columns: new[] { "DeveloperID", "CreatedAt" }); migrationBuilder.CreateIndex( name: "IX_NiceAuthSession_SessionToken", table: "NiceAuthSession", column: "SessionToken", unique: true); migrationBuilder.CreateIndex( name: "IX_NiceAuthSession_Status", table: "NiceAuthSession", column: "Status"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "NiceAuthSession"); } } }