using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Infrastructure.Migrations.AppDb { /// public partial class AddKosisMacro : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "MacroIndicator", columns: table => new { ID = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Code = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false, comment: "지표 내부코드 (config Code)"), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "지표 표시명"), Period = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false, comment: "수록 시점 (PRD_DE — 월 YYYYMM / 분기 YYYYQ / 연 YYYY)"), Value = table.Column(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false, comment: "수치 (DT)"), Unit = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "단위 (UNIT_NM)"), UpdatedAt = table.Column(type: "datetime2", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_MacroIndicator", x => x.ID); }, comment: "거시경제지표 시계열 (KOSIS 국가통계포털 OpenAPI 수집)"); migrationBuilder.CreateIndex( name: "IX_MacroIndicator_Code_Period", table: "MacroIndicator", columns: new[] { "Code", "Period" }, unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "MacroIndicator"); } } }