| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb;
- /// <inheritdoc />
- public partial class AddChannelHandleHistory : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "ChannelHandleHistory",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
- .Annotation("SqlServer:Identity", "1, 1"),
- ChannelID = table.Column<int>(type: "int", nullable: false, comment: "채널 ID"),
- OldHandle = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "이전 핸들"),
- ChangedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "변경 일시")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ChannelHandleHistory", x => x.ID);
- table.ForeignKey(
- name: "FK_ChannelHandleHistory_Channel_ChannelID",
- column: x => x.ChannelID,
- principalTable: "Channel",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- },
- comment: "채널 핸들 변경 이력");
- migrationBuilder.CreateIndex(
- name: "IX_ChannelHandleHistory_ChannelID_ChangedAt",
- table: "ChannelHandleHistory",
- columns: new[] { "ChannelID", "ChangedAt" },
- descending: new[] { false, true });
- migrationBuilder.CreateIndex(
- name: "IX_ChannelHandleHistory_OldHandle",
- table: "ChannelHandleHistory",
- column: "OldHandle");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "ChannelHandleHistory");
- }
- }
|