using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Infrastructure.Migrations.AppDb
{
///
public partial class AddDisclosure : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Disclosure",
columns: table => new
{
ID = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
RceptNo = table.Column(type: "nvarchar(14)", maxLength: 14, nullable: false, comment: "접수번호 (rcept_no, 14자리)"),
CorpCode = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false, comment: "고유번호 (corp_code, 8자리)"),
CorpName = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false, comment: "법인명 (corp_name)"),
StockCode = table.Column(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "종목코드 (stock_code, 6자리) — 비상장이면 null"),
CorpCls = table.Column(type: "nvarchar(1)", maxLength: 1, nullable: false, comment: "법인구분 (corp_cls, Y유가/K코스닥/N코넥스/E기타)"),
ReportNm = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false, comment: "보고서명 (report_nm)"),
FlrNm = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false, comment: "공시 제출인명 (flr_nm)"),
RceptDt = table.Column(type: "date", nullable: false, comment: "접수일자 (rcept_dt)"),
Rm = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "비고 (rm)"),
CreatedAt = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Disclosure", x => x.ID);
},
comment: "전자공시(DART) 공시 목록 (OpenDART list.json)");
migrationBuilder.CreateIndex(
name: "IX_Disclosure_RceptDt",
table: "Disclosure",
column: "RceptDt",
descending: new bool[0]);
migrationBuilder.CreateIndex(
name: "IX_Disclosure_RceptNo",
table: "Disclosure",
column: "RceptNo",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Disclosure_StockCode_RceptDt",
table: "Disclosure",
columns: new[] { "StockCode", "RceptDt" },
descending: new[] { false, true });
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Disclosure");
}
}
}