| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddWorldIndex : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "WorldIndexSnapshot",
- columns: table => new
- {
- ID = table.Column<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Symbol = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "외부 소스(Stooq) 심볼"),
- Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "지수 표시명"),
- CountryCode = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false, comment: "국가 코드 (ISO2)"),
- ExchangeName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "거래소·시장 표기"),
- TradeDate = table.Column<DateOnly>(type: "date", nullable: false),
- Close = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, comment: "종가"),
- PrevClose = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, comment: "직전 거래일 종가"),
- ChangeVal = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, comment: "전일 대비"),
- FlucRateBp = table.Column<int>(type: "int", nullable: false, comment: "등락률 basis point (%×100)"),
- Open = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, comment: "시가"),
- High = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, comment: "고가"),
- Low = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false, comment: "저가"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_WorldIndexSnapshot", x => x.ID);
- },
- comment: "세계 주요국 증시지수 최신 스냅샷 (메인 세계지도 핀, 외부 소스 일1회 upsert)");
- migrationBuilder.CreateIndex(
- name: "IX_WorldIndexSnapshot_CountryCode",
- table: "WorldIndexSnapshot",
- column: "CountryCode");
- migrationBuilder.CreateIndex(
- name: "IX_WorldIndexSnapshot_Symbol",
- table: "WorldIndexSnapshot",
- column: "Symbol",
- unique: true);
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "WorldIndexSnapshot");
- }
- }
- }
|