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