| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddKosisMacro : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "MacroIndicator",
- columns: table => new
- {
- ID = table.Column<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Code = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false, comment: "지표 내부코드 (config Code)"),
- Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "지표 표시명"),
- Period = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false, comment: "수록 시점 (PRD_DE — 월 YYYYMM / 분기 YYYYQ / 연 YYYY)"),
- Value = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: false, comment: "수치 (DT)"),
- Unit = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "단위 (UNIT_NM)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
- CreatedAt = table.Column<DateTime>(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);
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "MacroIndicator");
- }
- }
- }
|