| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddSeibroIssuerAndStockExtension : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<decimal>(
- name: "FaceValue",
- table: "Stock",
- type: "decimal(15,4)",
- precision: 15,
- scale: 4,
- nullable: true,
- comment: "액면가 (SEIBro PVAL)");
- migrationBuilder.AddColumn<bool>(
- name: "IsElectronicSecurity",
- table: "Stock",
- type: "bit",
- nullable: true,
- comment: "전자증권 여부 (SEIBro ELTSC_YN)");
- migrationBuilder.AddColumn<int>(
- name: "IssucoCustno",
- table: "Stock",
- type: "int",
- nullable: true,
- comment: "SEIBro 발행회사 고객번호 (ISSUCO_CUSTNO) — 기업정보 API 조인키");
- migrationBuilder.AddColumn<long>(
- name: "TotalIssuedShares",
- table: "Stock",
- type: "bigint",
- nullable: true,
- comment: "총발행주식수 (SEIBro TOTAL_STK_CNT)");
- migrationBuilder.AddColumn<decimal>(
- name: "VotingRights",
- table: "Stock",
- type: "decimal(5,2)",
- precision: 5,
- scale: 2,
- nullable: true,
- comment: "1주당 의결권수 (SEIBro VOTRNO)");
- migrationBuilder.CreateTable(
- name: "SeibroIssuerCode",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Market = table.Column<string>(type: "nchar(2)", fixedLength: true, maxLength: 2, nullable: false, comment: "시장구분 (MART_TPCD) — 11유가/12코스닥/13K-OTC/14코넥스/50기타"),
- ShortCode = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: false, comment: "단축코드 (SHOTN_ISIN)"),
- Name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false, comment: "종목명 (KOR_SECN_NM)"),
- IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_SeibroIssuerCode", x => x.ID);
- },
- comment: "SEIBro 시장별 단축코드↔발행회사번호 매핑 (getShotnByMart)");
- migrationBuilder.CreateIndex(
- name: "IX_Stock_IssucoCustno",
- table: "Stock",
- column: "IssucoCustno");
- migrationBuilder.CreateIndex(
- name: "IX_SeibroIssuerCode_IssucoCustno",
- table: "SeibroIssuerCode",
- column: "IssucoCustno");
- migrationBuilder.CreateIndex(
- name: "IX_SeibroIssuerCode_Market_ShortCode",
- table: "SeibroIssuerCode",
- columns: new[] { "Market", "ShortCode" },
- unique: true);
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "SeibroIssuerCode");
- migrationBuilder.DropIndex(
- name: "IX_Stock_IssucoCustno",
- table: "Stock");
- migrationBuilder.DropColumn(
- name: "FaceValue",
- table: "Stock");
- migrationBuilder.DropColumn(
- name: "IsElectronicSecurity",
- table: "Stock");
- migrationBuilder.DropColumn(
- name: "IssucoCustno",
- table: "Stock");
- migrationBuilder.DropColumn(
- name: "TotalIssuedShares",
- table: "Stock");
- migrationBuilder.DropColumn(
- name: "VotingRights",
- table: "Stock");
- }
- }
- }
|