| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddBondIndexDailyPrice : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "BondIndexDailyPrice",
- columns: table => new
- {
- ID = table.Column<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- GroupName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "채권지수 그룹명 (BND_IDX_GRP_NM)"),
- TradeDate = table.Column<DateOnly>(type: "date", nullable: false),
- TotalEarningIndex = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "총수익지수 (TOT_EARNG_IDX)"),
- TotalEarningChange = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "총수익지수 전일 대비"),
- NetPriceIndex = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "순가격지수 (NETPRC_IDX)"),
- NetPriceChange = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "순가격지수 전일 대비"),
- ZeroReinvestIndex = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "제로재투자지수 (ZERO_REINVST_IDX)"),
- ZeroReinvestChange = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "제로재투자지수 전일 대비"),
- CallReinvestIndex = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "Call재투자지수 (CALL_REINVST_IDX)"),
- CallReinvestChange = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "Call재투자지수 전일 대비"),
- MarketPriceIndex = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "시장가격지수 (MKT_PRC_IDX)"),
- MarketPriceChange = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "시장가격지수 전일 대비"),
- AvgDuration = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "평균 듀레이션 (AVG_DURATION)"),
- AvgConvexity = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "평균 컨벡시티 (AVG_CONVEXITY_PRC)"),
- AvgYield = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "평균 만기수익률 YTM (BND_IDX_AVG_YD)"),
- CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_BondIndexDailyPrice", x => x.ID);
- },
- comment: "채권지수 일별시세 (KRX OpenAPI idx/bon_dd_trd)");
- migrationBuilder.CreateIndex(
- name: "IX_BondIndexDailyPrice_GroupName_TradeDate",
- table: "BondIndexDailyPrice",
- columns: new[] { "GroupName", "TradeDate" },
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_BondIndexDailyPrice_TradeDate",
- table: "BondIndexDailyPrice",
- column: "TradeDate");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "BondIndexDailyPrice");
- }
- }
- }
|