| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddSeibroCorpAction : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "ConvertibleBondTarget",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- BondIsin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "채권 종목번호 (BOND_ISIN)"),
- BondSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "채권 종목명 (BOND_SECN_NM)"),
- BondKindNm = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "채권종류코드 (BOND_KIND_NM) — EB/CB/BW"),
- XrcStkIsin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "행사주식종목번호 (XRC_STK_ISIN)"),
- StkSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "주식 종목명 (STK_SECN_NM)"),
- WrtbIsin = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "신주인수권증권종목번호 (WRTB_ISIN)"),
- WrtbSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "신주인수권증권명 (WRTB_SECN_NM)"),
- XrcRatio = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사비율 (XRC_RATIO)"),
- XrcPrice = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사가격 (XRC_PRICE)"),
- SetaccEndtermLimitDays = table.Column<int>(type: "int", nullable: true, comment: "결산기말제한일수 (SETACC_ENDTERM_LIMIT_DAYS)"),
- NewstkAllocDdBfLimitDays = table.Column<int>(type: "int", nullable: true, comment: "신주배정일전제한일수 (NEWSTK_ALOC_DD_BF_LIMIT_DAYS)"),
- DmanLimitRsnContent = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "청구제한사유내용 (DMAN_LIMIT_RSN_CONTENT)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ConvertibleBondTarget", x => x.ID);
- },
- comment: "SEIBro 주식관련사채 행사대상 주식정보 (getXrcStkStatInfo) — CB/BW/EB 행사대상·행사가·행사비율. rolling per-채권ISIN. 필드 매핑은 스펙 기준(빈 샘플)");
- migrationBuilder.CreateTable(
- name: "ConvertibleExercise",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- BondIsin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "채권 종목코드 (BOND_ISIN)"),
- BondKorSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "채권 한글종목명 (BOND_KOR_SECN_NM)"),
- BondKindNm = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "채권종류코드 (BOND_KIND_NM) — EB/CB/BW"),
- XrcStkIsin = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "행사주식 종목코드 (XRC_STK_ISIN)"),
- StkKorSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "행사주식명 (STK_KOR_SECN_NM)"),
- RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리행사일 (RGT_STD_DT)"),
- XrcPossBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "행사시작일 (XRC_POSS_BEGIN_DT)"),
- XrcPossExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "행사종료일 (XRC_POSS_EXPRY_DT)"),
- XrcAmt = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사금액 (XRC_AMT)"),
- XrcQty = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사주수 (XRC_QTY)"),
- XrcPrice = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사가격 (XRC_PRICE)"),
- ListDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "주식상장일 (LIST_DT)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ConvertibleExercise", x => x.ID);
- },
- comment: "SEIBro 주식관련사채 행사내역 (getXrcStkOptionXrcInfo) — CB/BW/EB 권리행사. 날짜 스윕(권리행사일) window delete+insert. 필드 매핑은 스펙 기준(빈 샘플)");
- migrationBuilder.CreateTable(
- name: "CorpNameChange",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
- RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
- FmnmBfaltKorNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "변경전상호(국문, FMNM_BFALT_KOR_NM)"),
- FmnmBfaltEngNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "변경전상호(영문, FMNM_BFALT_ENG_NM)"),
- FmnmAltKorNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "변경후상호(국문, FMNM_ALT_KOR_NM)"),
- FmnmAltEngNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "변경후상호(영문, FMNM_ALT_ENG_NM)"),
- MixusCirclBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "혼용유통시작일자 (MIXUS_CIRCL_BEGIN_DT)"),
- MixusCirclExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "혼용유통종료일자 (MIXUS_CIRCL_EXPRY_DT)"),
- UniCirclDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "단일유통일자 (UNI_CIRCL_DT)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_CorpNameChange", x => x.ID);
- },
- comment: "SEIBro 상호변경 정보 (getFmnmAltInfo) — 사명 변경 전후·혼용유통기간. RightsBaseDate RGT_RACD=204 이벤트 구동");
- migrationBuilder.CreateTable(
- name: "GeneralMeeting",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
- IssuinNo = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "발행회사발행체번호 (ISSUIN_NO)"),
- GmetKacd = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: false, comment: "총회종류코드 (GMET_KACD) — 001정기 002임시 003종류 009기타"),
- RgtRsnDetailSortCd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "권리사유세부유형코드 (RGT_RSN_DTAIL_SORT_CD)"),
- RostCloseBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄시작일자 (ROST_CLOSE_BEGIN_DT)"),
- RostCloseExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄종료일자 (ROST_CLOSE_EXPRY_DT)"),
- GmetOmeetYn = table.Column<bool>(type: "bit", nullable: true, comment: "총회개최여부 (GMET_OMEET_YN)"),
- GmetPlaceTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: true, comment: "총회장소구분코드 (GMET_PLACE_TPCD) — 1서울 2지방 3해당없음"),
- CouncilDterminPubnDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "이사회결의공시일자 (COUNCL_DTERMIN_PUBN_DT)"),
- GmetPlace = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "총회장소 (GMET_PLACE)"),
- StkBuyreqRlYn = table.Column<bool>(type: "bit", nullable: true, comment: "주식매수청구관련여부 (STK_BUYREQ_RL_YN)"),
- RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
- GmetDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "총회일자 (GMET_DT)"),
- GmetTtm = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "총회시각 (GMET_TTM) — HHmm 문자"),
- NotcDlineDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "통지시한일자 (NOTC_DLINE_DT)"),
- DferYn = table.Column<bool>(type: "bit", nullable: true, comment: "연기여부 (DFER_YN)"),
- EvoteYn = table.Column<bool>(type: "bit", nullable: true, comment: "전자투표 적용여부 (EVOTE_YN)"),
- IsElectronicSecurity = table.Column<bool>(type: "bit", nullable: true, comment: "전자증권 여부 (ELTSC_YN)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_GeneralMeeting", x => x.ID);
- },
- comment: "SEIBro 총회일정 정보 (getGmeetInfo) — 주총 일정·장소·전자투표. RightsBaseDate 총회계열 이벤트 구동");
- migrationBuilder.CreateTable(
- name: "MeetingAgenda",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
- IssuinNo = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "발행회사발행체번호 (ISSUIN_NO)"),
- RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
- GmetDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "총회일자 (GMET_DT)"),
- GmetKacd = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true, comment: "총회종류코드 (GMET_KACD)"),
- AgendaSeq = table.Column<int>(type: "int", nullable: false, comment: "안건일련번호 (AGENDA_SEQ)"),
- AgendaXpresNo = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "안건표시번호 (AGENDA_XPRES_NO)"),
- AgendaSchSeqo = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "안건조회순서 (AGENDA_SCH_SEQO)"),
- AgendaNo = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "안건번호 (AGENDA_NO)"),
- DtailAgendaNo = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "세부안건번호 (DTAIL_AGENDA_NO)"),
- AgendaNm = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "안건명 (AGENDA_NM)"),
- EngAgendaNm = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "영문안건명 (ENG_AGENDA_NM)"),
- DtailAgendaNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "세부안건명 (DTAIL_AGENDA_NM)"),
- DtailEngAgendaNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "세부영문안건명 (DTAIL_ENG_AGENDA_NM)"),
- VoteMannTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: true, comment: "투표방식구분코드 (VOTE_MANN_TPCD)"),
- GmetResultTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: true, comment: "총회결과구분코드 (GMET_RESULT_TPCD) — 1승인 2부결 3수정승인 4부분승인 5철회"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_MeetingAgenda", x => x.ID);
- },
- comment: "SEIBro 총회안건 정보 (getGmeetMeasureInfo) — 주총 안건·결과. GeneralMeeting 동일 트리거");
- migrationBuilder.CreateTable(
- name: "OddLotPayment",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO, 요청 스탬핑)"),
- PayDate = table.Column<DateOnly>(type: "date", nullable: false, comment: "대금지급일 (TH1_PAY_TERM_BEGIN_DT, 요청 스탬핑)"),
- RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
- RgtRacd = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true, comment: "권리사유코드 (RGT_RACD)"),
- RgtRacdNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "권리사유명 (RGT_RACD_NM)"),
- RgtRsnDetailSortCd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "권리사유세부유형코드 (RGT_RSN_DTAIL_SORT_CD)"),
- EstmStdTpcd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "산정기준구분코드 (ESTM_STD_TPCD)"),
- EstmStdDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "산정기준일자 (ESTM_STD_DT)"),
- EstmStdprc = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "산정기준가 (ESTM_STDPRC)"),
- RostCloseBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄시작일자 (ROST_CLOSE_BEGIN_DT)"),
- RostCloseExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄종료일자 (ROST_CLOSE_EXPRY_DT)"),
- XrgtDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "권리락일자 (XRGT_DT)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_OddLotPayment", x => x.ID);
- },
- comment: "SEIBro 단주대금 정보 (getOddLotInfo) — 단주대금 사유·산정기준·권리락일. PaymentSchedule 단주(구분3) 이벤트 구동");
- migrationBuilder.CreateTable(
- name: "PaymentSchedule",
- columns: table => new
- {
- ID = table.Column<int>(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
- Isin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "종목번호 (ISIN)"),
- KorSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "한글종목명 (KOR_SECN_NM)"),
- SecnKacd = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true, comment: "종목종류코드 (SECN_KACD) — 101보통주 201우선주"),
- RgtStdDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "권리기준일자 (RGT_STD_DT)"),
- RgtRacdNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "권리사유명 (RGT_RACD_NM)"),
- RgtRsnDetailSortCd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "권리사유세부유형코드 (RGT_RSN_DTAIL_SORT_CD)"),
- PayCostTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: false, comment: "지급대금구분코드 (PAY_COST_TPCD, 요청 스탬핑) — 1배당금 3단주대금"),
- Th1PayTermBeginDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "대금지급일 (TH1_PAY_TERM_BEGIN_DT, 요청 스탬핑)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PaymentSchedule", x => x.ID);
- },
- comment: "SEIBro 대금지급일정 정보 (getCostPaySchedul) — 배당금/단주대금 지급일정. 날짜 스윕 × 지급구분{1,3}, 지급일 window delete+insert");
- migrationBuilder.CreateIndex(
- name: "IX_ConvertibleBondTarget_BondIsin_XrcStkIsin",
- table: "ConvertibleBondTarget",
- columns: new[] { "BondIsin", "XrcStkIsin" },
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_ConvertibleBondTarget_XrcStkIsin",
- table: "ConvertibleBondTarget",
- column: "XrcStkIsin");
- migrationBuilder.CreateIndex(
- name: "IX_ConvertibleExercise_BondIsin",
- table: "ConvertibleExercise",
- column: "BondIsin");
- migrationBuilder.CreateIndex(
- name: "IX_ConvertibleExercise_RgtStdDt",
- table: "ConvertibleExercise",
- column: "RgtStdDt");
- migrationBuilder.CreateIndex(
- name: "IX_ConvertibleExercise_XrcStkIsin",
- table: "ConvertibleExercise",
- column: "XrcStkIsin");
- migrationBuilder.CreateIndex(
- name: "IX_CorpNameChange_IssucoCustno_RgtStdDt",
- table: "CorpNameChange",
- columns: new[] { "IssucoCustno", "RgtStdDt" },
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_GeneralMeeting_GmetDt",
- table: "GeneralMeeting",
- column: "GmetDt");
- migrationBuilder.CreateIndex(
- name: "IX_GeneralMeeting_IssucoCustno_RgtStdDt_GmetKacd",
- table: "GeneralMeeting",
- columns: new[] { "IssucoCustno", "RgtStdDt", "GmetKacd" },
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_MeetingAgenda_IssucoCustno_RgtStdDt_AgendaSeq",
- table: "MeetingAgenda",
- columns: new[] { "IssucoCustno", "RgtStdDt", "AgendaSeq" },
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_OddLotPayment_IssucoCustno_PayDate_RgtStdDt",
- table: "OddLotPayment",
- columns: new[] { "IssucoCustno", "PayDate", "RgtStdDt" },
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_PaymentSchedule_Isin",
- table: "PaymentSchedule",
- column: "Isin");
- migrationBuilder.CreateIndex(
- name: "IX_PaymentSchedule_Th1PayTermBeginDt_PayCostTpcd",
- table: "PaymentSchedule",
- columns: new[] { "Th1PayTermBeginDt", "PayCostTpcd" });
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "ConvertibleBondTarget");
- migrationBuilder.DropTable(
- name: "ConvertibleExercise");
- migrationBuilder.DropTable(
- name: "CorpNameChange");
- migrationBuilder.DropTable(
- name: "GeneralMeeting");
- migrationBuilder.DropTable(
- name: "MeetingAgenda");
- migrationBuilder.DropTable(
- name: "OddLotPayment");
- migrationBuilder.DropTable(
- name: "PaymentSchedule");
- }
- }
- }
|