20260707114052_AddSeibroCorpAction.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Infrastructure.Migrations.AppDb
  5. {
  6. /// <inheritdoc />
  7. public partial class AddSeibroCorpAction : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "ConvertibleBondTarget",
  14. columns: table => new
  15. {
  16. ID = table.Column<int>(type: "int", nullable: false)
  17. .Annotation("SqlServer:Identity", "1, 1"),
  18. BondIsin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "채권 종목번호 (BOND_ISIN)"),
  19. BondSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "채권 종목명 (BOND_SECN_NM)"),
  20. BondKindNm = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "채권종류코드 (BOND_KIND_NM) — EB/CB/BW"),
  21. XrcStkIsin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "행사주식종목번호 (XRC_STK_ISIN)"),
  22. StkSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "주식 종목명 (STK_SECN_NM)"),
  23. WrtbIsin = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "신주인수권증권종목번호 (WRTB_ISIN)"),
  24. WrtbSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "신주인수권증권명 (WRTB_SECN_NM)"),
  25. XrcRatio = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사비율 (XRC_RATIO)"),
  26. XrcPrice = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사가격 (XRC_PRICE)"),
  27. SetaccEndtermLimitDays = table.Column<int>(type: "int", nullable: true, comment: "결산기말제한일수 (SETACC_ENDTERM_LIMIT_DAYS)"),
  28. NewstkAllocDdBfLimitDays = table.Column<int>(type: "int", nullable: true, comment: "신주배정일전제한일수 (NEWSTK_ALOC_DD_BF_LIMIT_DAYS)"),
  29. DmanLimitRsnContent = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "청구제한사유내용 (DMAN_LIMIT_RSN_CONTENT)"),
  30. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  31. },
  32. constraints: table =>
  33. {
  34. table.PrimaryKey("PK_ConvertibleBondTarget", x => x.ID);
  35. },
  36. comment: "SEIBro 주식관련사채 행사대상 주식정보 (getXrcStkStatInfo) — CB/BW/EB 행사대상·행사가·행사비율. rolling per-채권ISIN. 필드 매핑은 스펙 기준(빈 샘플)");
  37. migrationBuilder.CreateTable(
  38. name: "ConvertibleExercise",
  39. columns: table => new
  40. {
  41. ID = table.Column<int>(type: "int", nullable: false)
  42. .Annotation("SqlServer:Identity", "1, 1"),
  43. BondIsin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "채권 종목코드 (BOND_ISIN)"),
  44. BondKorSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "채권 한글종목명 (BOND_KOR_SECN_NM)"),
  45. BondKindNm = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: true, comment: "채권종류코드 (BOND_KIND_NM) — EB/CB/BW"),
  46. XrcStkIsin = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "행사주식 종목코드 (XRC_STK_ISIN)"),
  47. StkKorSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "행사주식명 (STK_KOR_SECN_NM)"),
  48. RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리행사일 (RGT_STD_DT)"),
  49. XrcPossBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "행사시작일 (XRC_POSS_BEGIN_DT)"),
  50. XrcPossExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "행사종료일 (XRC_POSS_EXPRY_DT)"),
  51. XrcAmt = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사금액 (XRC_AMT)"),
  52. XrcQty = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사주수 (XRC_QTY)"),
  53. XrcPrice = table.Column<decimal>(type: "decimal(28,10)", precision: 28, scale: 10, nullable: true, comment: "행사가격 (XRC_PRICE)"),
  54. ListDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "주식상장일 (LIST_DT)"),
  55. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  56. },
  57. constraints: table =>
  58. {
  59. table.PrimaryKey("PK_ConvertibleExercise", x => x.ID);
  60. },
  61. comment: "SEIBro 주식관련사채 행사내역 (getXrcStkOptionXrcInfo) — CB/BW/EB 권리행사. 날짜 스윕(권리행사일) window delete+insert. 필드 매핑은 스펙 기준(빈 샘플)");
  62. migrationBuilder.CreateTable(
  63. name: "CorpNameChange",
  64. columns: table => new
  65. {
  66. ID = table.Column<int>(type: "int", nullable: false)
  67. .Annotation("SqlServer:Identity", "1, 1"),
  68. IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
  69. RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
  70. FmnmBfaltKorNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "변경전상호(국문, FMNM_BFALT_KOR_NM)"),
  71. FmnmBfaltEngNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "변경전상호(영문, FMNM_BFALT_ENG_NM)"),
  72. FmnmAltKorNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "변경후상호(국문, FMNM_ALT_KOR_NM)"),
  73. FmnmAltEngNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "변경후상호(영문, FMNM_ALT_ENG_NM)"),
  74. MixusCirclBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "혼용유통시작일자 (MIXUS_CIRCL_BEGIN_DT)"),
  75. MixusCirclExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "혼용유통종료일자 (MIXUS_CIRCL_EXPRY_DT)"),
  76. UniCirclDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "단일유통일자 (UNI_CIRCL_DT)"),
  77. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  78. },
  79. constraints: table =>
  80. {
  81. table.PrimaryKey("PK_CorpNameChange", x => x.ID);
  82. },
  83. comment: "SEIBro 상호변경 정보 (getFmnmAltInfo) — 사명 변경 전후·혼용유통기간. RightsBaseDate RGT_RACD=204 이벤트 구동");
  84. migrationBuilder.CreateTable(
  85. name: "GeneralMeeting",
  86. columns: table => new
  87. {
  88. ID = table.Column<int>(type: "int", nullable: false)
  89. .Annotation("SqlServer:Identity", "1, 1"),
  90. IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
  91. IssuinNo = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "발행회사발행체번호 (ISSUIN_NO)"),
  92. GmetKacd = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: false, comment: "총회종류코드 (GMET_KACD) — 001정기 002임시 003종류 009기타"),
  93. RgtRsnDetailSortCd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "권리사유세부유형코드 (RGT_RSN_DTAIL_SORT_CD)"),
  94. RostCloseBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄시작일자 (ROST_CLOSE_BEGIN_DT)"),
  95. RostCloseExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄종료일자 (ROST_CLOSE_EXPRY_DT)"),
  96. GmetOmeetYn = table.Column<bool>(type: "bit", nullable: true, comment: "총회개최여부 (GMET_OMEET_YN)"),
  97. GmetPlaceTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: true, comment: "총회장소구분코드 (GMET_PLACE_TPCD) — 1서울 2지방 3해당없음"),
  98. CouncilDterminPubnDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "이사회결의공시일자 (COUNCL_DTERMIN_PUBN_DT)"),
  99. GmetPlace = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "총회장소 (GMET_PLACE)"),
  100. StkBuyreqRlYn = table.Column<bool>(type: "bit", nullable: true, comment: "주식매수청구관련여부 (STK_BUYREQ_RL_YN)"),
  101. RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
  102. GmetDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "총회일자 (GMET_DT)"),
  103. GmetTtm = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "총회시각 (GMET_TTM) — HHmm 문자"),
  104. NotcDlineDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "통지시한일자 (NOTC_DLINE_DT)"),
  105. DferYn = table.Column<bool>(type: "bit", nullable: true, comment: "연기여부 (DFER_YN)"),
  106. EvoteYn = table.Column<bool>(type: "bit", nullable: true, comment: "전자투표 적용여부 (EVOTE_YN)"),
  107. IsElectronicSecurity = table.Column<bool>(type: "bit", nullable: true, comment: "전자증권 여부 (ELTSC_YN)"),
  108. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  109. },
  110. constraints: table =>
  111. {
  112. table.PrimaryKey("PK_GeneralMeeting", x => x.ID);
  113. },
  114. comment: "SEIBro 총회일정 정보 (getGmeetInfo) — 주총 일정·장소·전자투표. RightsBaseDate 총회계열 이벤트 구동");
  115. migrationBuilder.CreateTable(
  116. name: "MeetingAgenda",
  117. columns: table => new
  118. {
  119. ID = table.Column<int>(type: "int", nullable: false)
  120. .Annotation("SqlServer:Identity", "1, 1"),
  121. IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
  122. IssuinNo = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "발행회사발행체번호 (ISSUIN_NO)"),
  123. RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
  124. GmetDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "총회일자 (GMET_DT)"),
  125. GmetKacd = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true, comment: "총회종류코드 (GMET_KACD)"),
  126. AgendaSeq = table.Column<int>(type: "int", nullable: false, comment: "안건일련번호 (AGENDA_SEQ)"),
  127. AgendaXpresNo = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "안건표시번호 (AGENDA_XPRES_NO)"),
  128. AgendaSchSeqo = table.Column<string>(type: "nvarchar(6)", maxLength: 6, nullable: true, comment: "안건조회순서 (AGENDA_SCH_SEQO)"),
  129. AgendaNo = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "안건번호 (AGENDA_NO)"),
  130. DtailAgendaNo = table.Column<string>(type: "nvarchar(12)", maxLength: 12, nullable: true, comment: "세부안건번호 (DTAIL_AGENDA_NO)"),
  131. AgendaNm = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false, comment: "안건명 (AGENDA_NM)"),
  132. EngAgendaNm = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "영문안건명 (ENG_AGENDA_NM)"),
  133. DtailAgendaNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "세부안건명 (DTAIL_AGENDA_NM)"),
  134. DtailEngAgendaNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "세부영문안건명 (DTAIL_ENG_AGENDA_NM)"),
  135. VoteMannTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: true, comment: "투표방식구분코드 (VOTE_MANN_TPCD)"),
  136. GmetResultTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: true, comment: "총회결과구분코드 (GMET_RESULT_TPCD) — 1승인 2부결 3수정승인 4부분승인 5철회"),
  137. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  138. },
  139. constraints: table =>
  140. {
  141. table.PrimaryKey("PK_MeetingAgenda", x => x.ID);
  142. },
  143. comment: "SEIBro 총회안건 정보 (getGmeetMeasureInfo) — 주총 안건·결과. GeneralMeeting 동일 트리거");
  144. migrationBuilder.CreateTable(
  145. name: "OddLotPayment",
  146. columns: table => new
  147. {
  148. ID = table.Column<int>(type: "int", nullable: false)
  149. .Annotation("SqlServer:Identity", "1, 1"),
  150. IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO, 요청 스탬핑)"),
  151. PayDate = table.Column<DateOnly>(type: "date", nullable: false, comment: "대금지급일 (TH1_PAY_TERM_BEGIN_DT, 요청 스탬핑)"),
  152. RgtStdDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "권리기준일자 (RGT_STD_DT)"),
  153. RgtRacd = table.Column<string>(type: "nvarchar(3)", maxLength: 3, nullable: true, comment: "권리사유코드 (RGT_RACD)"),
  154. RgtRacdNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "권리사유명 (RGT_RACD_NM)"),
  155. RgtRsnDetailSortCd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "권리사유세부유형코드 (RGT_RSN_DTAIL_SORT_CD)"),
  156. EstmStdTpcd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "산정기준구분코드 (ESTM_STD_TPCD)"),
  157. EstmStdDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "산정기준일자 (ESTM_STD_DT)"),
  158. EstmStdprc = table.Column<decimal>(type: "decimal(18,4)", precision: 18, scale: 4, nullable: true, comment: "산정기준가 (ESTM_STDPRC)"),
  159. RostCloseBeginDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄시작일자 (ROST_CLOSE_BEGIN_DT)"),
  160. RostCloseExpryDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "명부폐쇄종료일자 (ROST_CLOSE_EXPRY_DT)"),
  161. XrgtDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "권리락일자 (XRGT_DT)"),
  162. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  163. },
  164. constraints: table =>
  165. {
  166. table.PrimaryKey("PK_OddLotPayment", x => x.ID);
  167. },
  168. comment: "SEIBro 단주대금 정보 (getOddLotInfo) — 단주대금 사유·산정기준·권리락일. PaymentSchedule 단주(구분3) 이벤트 구동");
  169. migrationBuilder.CreateTable(
  170. name: "PaymentSchedule",
  171. columns: table => new
  172. {
  173. ID = table.Column<int>(type: "int", nullable: false)
  174. .Annotation("SqlServer:Identity", "1, 1"),
  175. IssucoCustno = table.Column<int>(type: "int", nullable: false, comment: "발행회사 고객번호 (ISSUCO_CUSTNO)"),
  176. Isin = table.Column<string>(type: "nchar(12)", fixedLength: true, maxLength: 12, nullable: false, comment: "종목번호 (ISIN)"),
  177. KorSecnNm = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "한글종목명 (KOR_SECN_NM)"),
  178. SecnKacd = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: true, comment: "종목종류코드 (SECN_KACD) — 101보통주 201우선주"),
  179. RgtStdDt = table.Column<DateOnly>(type: "date", nullable: true, comment: "권리기준일자 (RGT_STD_DT)"),
  180. RgtRacdNm = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "권리사유명 (RGT_RACD_NM)"),
  181. RgtRsnDetailSortCd = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true, comment: "권리사유세부유형코드 (RGT_RSN_DTAIL_SORT_CD)"),
  182. PayCostTpcd = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: false, comment: "지급대금구분코드 (PAY_COST_TPCD, 요청 스탬핑) — 1배당금 3단주대금"),
  183. Th1PayTermBeginDt = table.Column<DateOnly>(type: "date", nullable: false, comment: "대금지급일 (TH1_PAY_TERM_BEGIN_DT, 요청 스탬핑)"),
  184. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  185. },
  186. constraints: table =>
  187. {
  188. table.PrimaryKey("PK_PaymentSchedule", x => x.ID);
  189. },
  190. comment: "SEIBro 대금지급일정 정보 (getCostPaySchedul) — 배당금/단주대금 지급일정. 날짜 스윕 × 지급구분{1,3}, 지급일 window delete+insert");
  191. migrationBuilder.CreateIndex(
  192. name: "IX_ConvertibleBondTarget_BondIsin_XrcStkIsin",
  193. table: "ConvertibleBondTarget",
  194. columns: new[] { "BondIsin", "XrcStkIsin" },
  195. unique: true);
  196. migrationBuilder.CreateIndex(
  197. name: "IX_ConvertibleBondTarget_XrcStkIsin",
  198. table: "ConvertibleBondTarget",
  199. column: "XrcStkIsin");
  200. migrationBuilder.CreateIndex(
  201. name: "IX_ConvertibleExercise_BondIsin",
  202. table: "ConvertibleExercise",
  203. column: "BondIsin");
  204. migrationBuilder.CreateIndex(
  205. name: "IX_ConvertibleExercise_RgtStdDt",
  206. table: "ConvertibleExercise",
  207. column: "RgtStdDt");
  208. migrationBuilder.CreateIndex(
  209. name: "IX_ConvertibleExercise_XrcStkIsin",
  210. table: "ConvertibleExercise",
  211. column: "XrcStkIsin");
  212. migrationBuilder.CreateIndex(
  213. name: "IX_CorpNameChange_IssucoCustno_RgtStdDt",
  214. table: "CorpNameChange",
  215. columns: new[] { "IssucoCustno", "RgtStdDt" },
  216. unique: true);
  217. migrationBuilder.CreateIndex(
  218. name: "IX_GeneralMeeting_GmetDt",
  219. table: "GeneralMeeting",
  220. column: "GmetDt");
  221. migrationBuilder.CreateIndex(
  222. name: "IX_GeneralMeeting_IssucoCustno_RgtStdDt_GmetKacd",
  223. table: "GeneralMeeting",
  224. columns: new[] { "IssucoCustno", "RgtStdDt", "GmetKacd" },
  225. unique: true);
  226. migrationBuilder.CreateIndex(
  227. name: "IX_MeetingAgenda_IssucoCustno_RgtStdDt_AgendaSeq",
  228. table: "MeetingAgenda",
  229. columns: new[] { "IssucoCustno", "RgtStdDt", "AgendaSeq" },
  230. unique: true);
  231. migrationBuilder.CreateIndex(
  232. name: "IX_OddLotPayment_IssucoCustno_PayDate_RgtStdDt",
  233. table: "OddLotPayment",
  234. columns: new[] { "IssucoCustno", "PayDate", "RgtStdDt" },
  235. unique: true);
  236. migrationBuilder.CreateIndex(
  237. name: "IX_PaymentSchedule_Isin",
  238. table: "PaymentSchedule",
  239. column: "Isin");
  240. migrationBuilder.CreateIndex(
  241. name: "IX_PaymentSchedule_Th1PayTermBeginDt_PayCostTpcd",
  242. table: "PaymentSchedule",
  243. columns: new[] { "Th1PayTermBeginDt", "PayCostTpcd" });
  244. }
  245. /// <inheritdoc />
  246. protected override void Down(MigrationBuilder migrationBuilder)
  247. {
  248. migrationBuilder.DropTable(
  249. name: "ConvertibleBondTarget");
  250. migrationBuilder.DropTable(
  251. name: "ConvertibleExercise");
  252. migrationBuilder.DropTable(
  253. name: "CorpNameChange");
  254. migrationBuilder.DropTable(
  255. name: "GeneralMeeting");
  256. migrationBuilder.DropTable(
  257. name: "MeetingAgenda");
  258. migrationBuilder.DropTable(
  259. name: "OddLotPayment");
  260. migrationBuilder.DropTable(
  261. name: "PaymentSchedule");
  262. }
  263. }
  264. }