20260127065718_Init.cs 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Infrastructure.Persistence.Migrations;
  5. /// <inheritdoc />
  6. public partial class Init : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.CreateTable(
  12. name: "BannerPosition",
  13. columns: table => new
  14. {
  15. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  16. .Annotation("SqlServer:Identity", "1, 1"),
  17. Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "위치 구분"),
  18. Subject = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "위치 명"),
  19. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
  20. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  21. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  22. },
  23. constraints: table =>
  24. {
  25. table.PrimaryKey("PK_BannerPosition", x => x.ID);
  26. },
  27. comment: "배너 위치");
  28. migrationBuilder.CreateTable(
  29. name: "Config",
  30. columns: table => new
  31. {
  32. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  33. .Annotation("SqlServer:Identity", "1, 1"),
  34. LastUpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "마지막 수정일시"),
  35. RowVersion = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: false, comment: "동시성 제어용"),
  36. Basic_SiteName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "사이트 이름"),
  37. Basic_RootID = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "최고 관리자 ID"),
  38. Basic_FromEmail = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "송수신 이메일"),
  39. Basic_FromName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "송수신자 이름"),
  40. Basic_SmtpServer = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "SMTP Server"),
  41. Basic_SmtpPort = table.Column<int>(type: "int", nullable: true, comment: "SMTP Port"),
  42. Basic_SmtpEnableSSL = table.Column<bool>(type: "bit", nullable: true, comment: "SMTP Enable SSL"),
  43. Basic_SmtpUsername = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "SMTP Username"),
  44. Basic_SmtpPassword = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "SMTP Password (암호화 저장 권장)"),
  45. Basic_AdminWhiteIPList = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "관리자단 접근 가능 IP"),
  46. Basic_FrontWhiteIPList = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "사용자단 접근 가능 IP"),
  47. Basic_BlockAlertTitle = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "차단 시 안내문 제목"),
  48. Basic_BlockAlertContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "차단 시 안내문 내용"),
  49. Basic_IsMaintenance = table.Column<bool>(type: "bit", nullable: false, comment: "점검 여부"),
  50. Basic_MaintenanceContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "점검 내용"),
  51. Meta_Keywords = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Meta Keywords"),
  52. Meta_Description = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Meta Description"),
  53. Meta_Author = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Meta Author"),
  54. Meta_Viewport = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Meta Viewport"),
  55. Meta_ApplicationName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Meta Application Name"),
  56. Meta_Generator = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Meta Generator"),
  57. Meta_Robots = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Meta Robots"),
  58. Meta_Adds = table.Column<string>(type: "nvarchar(max)", nullable: true),
  59. Company_Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
  60. Company_RegNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  61. Company_Owner = table.Column<string>(type: "nvarchar(max)", nullable: true),
  62. Company_Tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
  63. Company_Fax = table.Column<string>(type: "nvarchar(max)", nullable: true),
  64. Company_RetailSaleNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  65. Company_AddedSaleNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
  66. Company_ZipCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "사업장 주소(우편번호)"),
  67. Company_Hosting = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "호스팅 서비스"),
  68. Company_AdminName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "정보관리책임자"),
  69. Company_AdminEmail = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true, comment: "정보관리책임자 E-mail"),
  70. Company_SiteUrl = table.Column<string>(type: "nvarchar(300)", maxLength: 300, nullable: true, comment: "사이트 주소"),
  71. Company_BankCode = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "입금 계좌(은행 코드)"),
  72. Company_BankOwner = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true, comment: "예금주"),
  73. Company_BankNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "계좌번호"),
  74. Account_IsRegisterBlock = table.Column<bool>(type: "bit", nullable: false, comment: "회원가입 차단"),
  75. Account_IsRegisterEmailAuth = table.Column<bool>(type: "bit", nullable: false, comment: "회원가입 시 이메일 인증"),
  76. Account_PasswordMinLength = table.Column<int>(type: "int", nullable: true, comment: "비밀번호 최소 길이"),
  77. Account_PasswordUppercaseLength = table.Column<int>(type: "int", nullable: true, comment: "비밀번호 최소 대문자 수"),
  78. Account_PasswordNumbersLength = table.Column<int>(type: "int", nullable: true, comment: "비밀번호 최소 숫자 수"),
  79. Account_PasswordSpecialcharsLength = table.Column<int>(type: "int", nullable: true, comment: "비밀번호 최소 특수문자 수"),
  80. Account_DeniedEmailList = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "금지 이메일"),
  81. Account_DeniedNameList = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "금지 별명"),
  82. Account_ChangeEmailDay = table.Column<int>(type: "int", nullable: true, comment: "이메일 갱신 주기(일)"),
  83. Account_ChangeNameDay = table.Column<int>(type: "int", nullable: true, comment: "별명 갱신 주기(일)"),
  84. Account_ChangeSummaryDay = table.Column<int>(type: "int", nullable: true, comment: "한마디 갱신 주기(일)"),
  85. Account_ChangeIntroDay = table.Column<int>(type: "int", nullable: true, comment: "자기소개 갱신 주기(일)"),
  86. Account_ChangePasswordDay = table.Column<int>(type: "int", nullable: true, comment: "비밀번호 갱신 주기(일)"),
  87. Account_MaxLoginTryCount = table.Column<int>(type: "int", nullable: true, comment: "로그인 시도 제한 횟수"),
  88. Account_MaxLoginTryLimitSecond = table.Column<int>(type: "int", nullable: true, comment: "로그인 시도 제한 시간(초)"),
  89. EmailTemplate_RegisterEmailFormTitle = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "회원가입 시 - 제목"),
  90. EmailTemplate_RegisterEmailFormContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "회원가입 시 - 내용"),
  91. EmailTemplate_RegistrationEmailFormTitle = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "회원가입 완료 - 제목"),
  92. EmailTemplate_RegistrationEmailFormContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "회원가입 완료 - 내용"),
  93. EmailTemplate_ResetPasswordEmailFormTitle = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "비밀번호 재설정 - 제목"),
  94. EmailTemplate_ResetPasswordEmailFormContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "비밀번호 재설정 - 내용"),
  95. EmailTemplate_ChangedPasswordEmailFormTitle = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "비밀번호 변경 완료 - 제목"),
  96. EmailTemplate_ChangedPasswordEmailFormContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "비밀번호 변경 완료 - 내용"),
  97. EmailTemplate_WithdrawEmailFormTitle = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "회원탈퇴 시 - 제목"),
  98. EmailTemplate_WithdrawEmailFormContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "회원탈퇴 시 - 내용"),
  99. EmailTemplate_EmailVerifyFormTitle = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 시 - 제목"),
  100. EmailTemplate_EmailVerifyFormContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 시 - 내용"),
  101. EmailTemplate_ChangedEmailFormTitle = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 완료 - 제목"),
  102. EmailTemplate_ChangedEmailFormContent = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이메일 변경 완료 - 내용"),
  103. External_YouTubeApiKeyEnc = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "YouTube API Key (암호화 저장 권장)"),
  104. External_YouTubeApiName = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "YouTube API Name"),
  105. External_GoogleClientId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Google Client ID"),
  106. External_GoogleClientSecretEnc = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Google Client Secret (암호화 저장 권장)"),
  107. External_GoogleAppId = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "Google APP ID")
  108. },
  109. constraints: table =>
  110. {
  111. table.PrimaryKey("PK_Config", x => x.ID);
  112. },
  113. comment: "운영 정보 설정 값");
  114. migrationBuilder.CreateTable(
  115. name: "Document",
  116. columns: table => new
  117. {
  118. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  119. .Annotation("SqlServer:Identity", "1, 1"),
  120. Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "주소"),
  121. Subject = table.Column<string>(type: "nvarchar(120)", maxLength: 120, nullable: false, comment: "제목"),
  122. Content = table.Column<string>(type: "nvarchar(max)", maxLength: 5000, nullable: true, comment: "내용"),
  123. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
  124. Views = table.Column<int>(type: "int", nullable: false, comment: "조회 수"),
  125. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  126. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  127. },
  128. constraints: table =>
  129. {
  130. table.PrimaryKey("PK_Document", x => x.ID);
  131. },
  132. comment: "문서");
  133. migrationBuilder.CreateTable(
  134. name: "EmailVerifyNumber",
  135. columns: table => new
  136. {
  137. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  138. .Annotation("SqlServer:Identity", "1, 1"),
  139. Type = table.Column<int>(type: "int", nullable: false, comment: "인증 유형 (이메일 인증 / 비밀번호 재설정)"),
  140. Email = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "이메일"),
  141. Code = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false, comment: "Code"),
  142. IsVerified = table.Column<bool>(type: "bit", nullable: false, comment: "인증 여부"),
  143. Expiration = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "만료 일시"),
  144. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  145. },
  146. constraints: table =>
  147. {
  148. table.PrimaryKey("PK_EmailVerifyNumber", x => x.ID);
  149. },
  150. comment: "이메일 인증 번호들");
  151. migrationBuilder.CreateTable(
  152. name: "EmailVerifyToken",
  153. columns: table => new
  154. {
  155. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  156. .Annotation("SqlServer:Identity", "1, 1"),
  157. Type = table.Column<int>(type: "int", nullable: false, comment: "인증 유형 (이메일 인증 / 비밀번호 재설정)"),
  158. Email = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "이메일"),
  159. Token = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false, comment: "Token"),
  160. IsVerified = table.Column<bool>(type: "bit", nullable: false, comment: "인증 여부"),
  161. Expiration = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "만료 일시"),
  162. Additional = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "추가 정보(JSON)"),
  163. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  164. },
  165. constraints: table =>
  166. {
  167. table.PrimaryKey("PK_EmailVerifyToken", x => x.ID);
  168. },
  169. comment: "이메일 인증 토큰들");
  170. migrationBuilder.CreateTable(
  171. name: "FaqCategory",
  172. columns: table => new
  173. {
  174. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  175. .Annotation("SqlServer:Identity", "1, 1"),
  176. Code = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false, comment: "주소"),
  177. Subject = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "분류 명"),
  178. Order = table.Column<short>(type: "smallint", nullable: false, comment: "순서"),
  179. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
  180. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  181. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  182. },
  183. constraints: table =>
  184. {
  185. table.PrimaryKey("PK_FaqCategory", x => x.ID);
  186. },
  187. comment: "FAQ 분류");
  188. migrationBuilder.CreateTable(
  189. name: "MemberGrade",
  190. columns: table => new
  191. {
  192. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  193. .Annotation("SqlServer:Identity", "1, 1"),
  194. KorName = table.Column<string>(type: "nvarchar(240)", maxLength: 240, nullable: false, comment: "한글 명"),
  195. EngName = table.Column<string>(type: "nvarchar(120)", maxLength: 120, nullable: false, comment: "영문 명"),
  196. Description = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "설명"),
  197. Order = table.Column<short>(type: "smallint", nullable: false, comment: "순서"),
  198. Image = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "이미지"),
  199. RequiredExp = table.Column<int>(type: "int", nullable: false, comment: "누적 경험치"),
  200. RequiredAttendance = table.Column<long>(type: "bigint", nullable: false, comment: "누적 출석 수"),
  201. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
  202. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  203. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  204. },
  205. constraints: table =>
  206. {
  207. table.PrimaryKey("PK_MemberGrade", x => x.ID);
  208. },
  209. comment: "회원 등급");
  210. migrationBuilder.CreateTable(
  211. name: "Popup",
  212. columns: table => new
  213. {
  214. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  215. .Annotation("SqlServer:Identity", "1, 1"),
  216. Subject = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "제목"),
  217. Content = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true, comment: "내용"),
  218. Link = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "주소"),
  219. StartAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "사용 기간 - 시작"),
  220. EndAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "사용 기간 - 종료"),
  221. Order = table.Column<short>(type: "smallint", nullable: false, comment: "순서"),
  222. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
  223. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  224. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  225. },
  226. constraints: table =>
  227. {
  228. table.PrimaryKey("PK_Popup", x => x.ID);
  229. },
  230. comment: "팝업");
  231. migrationBuilder.CreateTable(
  232. name: "BannerItem",
  233. columns: table => new
  234. {
  235. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  236. .Annotation("SqlServer:Identity", "1, 1"),
  237. PositionID = table.Column<int>(type: "int", nullable: false, comment: "배너 위치 ID"),
  238. Subject = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "배너 명"),
  239. DesktopImage = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true, comment: "이미지(Desktop)"),
  240. MobileImage = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true, comment: "이미지(Mobile)"),
  241. Link = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "주소"),
  242. Order = table.Column<short>(type: "smallint", nullable: false, comment: "순서"),
  243. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
  244. StartAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "사용 기간 - 시작"),
  245. EndAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "사용 기간 - 종료"),
  246. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  247. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  248. },
  249. constraints: table =>
  250. {
  251. table.PrimaryKey("PK_BannerItem", x => x.ID);
  252. table.ForeignKey(
  253. name: "FK_BannerItem_BannerPosition_PositionID",
  254. column: x => x.PositionID,
  255. principalTable: "BannerPosition",
  256. principalColumn: "ID",
  257. onDelete: ReferentialAction.Cascade);
  258. },
  259. comment: "배너 아이템");
  260. migrationBuilder.CreateTable(
  261. name: "FaqItem",
  262. columns: table => new
  263. {
  264. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  265. .Annotation("SqlServer:Identity", "1, 1"),
  266. CategoryID = table.Column<int>(type: "int", nullable: false, comment: "분류 ID"),
  267. Question = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "질문"),
  268. Answer = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true, comment: "답변"),
  269. Order = table.Column<short>(type: "smallint", nullable: false, comment: "순서"),
  270. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "사용 여부"),
  271. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  272. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  273. },
  274. constraints: table =>
  275. {
  276. table.PrimaryKey("PK_FaqItem", x => x.ID);
  277. table.ForeignKey(
  278. name: "FK_FaqItem_FaqCategory_CategoryID",
  279. column: x => x.CategoryID,
  280. principalTable: "FaqCategory",
  281. principalColumn: "ID",
  282. onDelete: ReferentialAction.Cascade);
  283. },
  284. comment: "FAQ 목록");
  285. migrationBuilder.CreateTable(
  286. name: "Member",
  287. columns: table => new
  288. {
  289. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  290. .Annotation("SqlServer:Identity", "1, 1"),
  291. MemberGradeID = table.Column<int>(type: "int", nullable: true, comment: "회원등급 PK"),
  292. SID = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false, comment: "SID"),
  293. Email = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "이메일"),
  294. Name = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "별명"),
  295. FullName = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "본명"),
  296. FirstName = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true, comment: "본명(성)"),
  297. LastName = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "본명(이름)"),
  298. Password = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "비밀번호"),
  299. Intro = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: true, comment: "자기소개"),
  300. Summary = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "한마디"),
  301. Phone = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "연락처"),
  302. Birthday = table.Column<DateOnly>(type: "date", nullable: true, comment: "생년월일"),
  303. Gender = table.Column<int>(type: "int", nullable: true, comment: "성별"),
  304. Thunmbnail = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "썸네일"),
  305. Icon = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "아이콘"),
  306. IsEmailVerified = table.Column<bool>(type: "bit", nullable: false, comment: "이메일 인증 여부"),
  307. IsAuthCertified = table.Column<bool>(type: "bit", nullable: false, comment: "본인 인증 여부"),
  308. IsDenied = table.Column<bool>(type: "bit", nullable: false, comment: "차단 여부"),
  309. IsAdmin = table.Column<bool>(type: "bit", nullable: false, comment: "운영진 여부"),
  310. IsWithdraw = table.Column<bool>(type: "bit", nullable: false, comment: "탈퇴 여부"),
  311. IsCreator = table.Column<bool>(type: "bit", nullable: false, comment: "크리에이터 여부"),
  312. DeviceInfo = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: true, comment: "로그인 단말기 정보"),
  313. SignupIP = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "회원가입 시 IP"),
  314. LastLoginIp = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "마지막 로그인 IP"),
  315. IpAddress = table.Column<string>(type: "nvarchar(45)", maxLength: 45, nullable: true, comment: "IP Address"),
  316. UserAgent = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true, comment: "User-agent"),
  317. LastLoginAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "마지막 로그인 일시"),
  318. LastEmailChangedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "마지막 이메일 변경 일시"),
  319. LastNameChangedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "마지막 별명 변경 일시"),
  320. LastSummaryChangedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "마지막 한마디 변경 일시"),
  321. LastIntroChangedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "마지막 자기소개 변경 일시"),
  322. EmailVerifiedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "이메일 인증 일시"),
  323. AuthCertifiedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "본인인증 일시"),
  324. PasswordUpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "비밀번호 변경 일시"),
  325. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "가입 일시"),
  326. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  327. DeletedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "탈퇴 일시"),
  328. DeniedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "차단 일시")
  329. },
  330. constraints: table =>
  331. {
  332. table.PrimaryKey("PK_Member", x => x.ID);
  333. table.ForeignKey(
  334. name: "FK_Member_MemberGrade_MemberGradeID",
  335. column: x => x.MemberGradeID,
  336. principalTable: "MemberGrade",
  337. principalColumn: "ID",
  338. onDelete: ReferentialAction.SetNull);
  339. },
  340. comment: "회원 정보");
  341. migrationBuilder.CreateTable(
  342. name: "Channel",
  343. columns: table => new
  344. {
  345. ID = table.Column<int>(type: "int", nullable: false)
  346. .Annotation("SqlServer:Identity", "1, 1"),
  347. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  348. SID = table.Column<string>(type: "nvarchar(24)", maxLength: 24, nullable: false, comment: "채널 ID"),
  349. Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "채널 이름"),
  350. Handle = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: true, comment: "핸들"),
  351. YouTubeUrl = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: false, comment: "YouTube 채널 URL"),
  352. PlatformFeeRate = table.Column<decimal>(type: "decimal(5,2)", precision: 5, scale: 2, nullable: false, comment: "수수료(%)"),
  353. IsVerified = table.Column<bool>(type: "bit", nullable: false, comment: "인증 여부"),
  354. IsActive = table.Column<bool>(type: "bit", nullable: false, comment: "활성 여부"),
  355. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "수정 일시"),
  356. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  357. },
  358. constraints: table =>
  359. {
  360. table.PrimaryKey("PK_Channel", x => x.ID);
  361. table.ForeignKey(
  362. name: "FK_Channel_Member_MemberID",
  363. column: x => x.MemberID,
  364. principalTable: "Member",
  365. principalColumn: "ID",
  366. onDelete: ReferentialAction.Cascade);
  367. },
  368. comment: "채널 정보");
  369. migrationBuilder.CreateTable(
  370. name: "MemberApprove",
  371. columns: table => new
  372. {
  373. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  374. IsReceiveSMS = table.Column<bool>(type: "bit", nullable: false, comment: "SMS 수신 여부"),
  375. ReceiveSMSConsentAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "SMS 수신 동의 일시"),
  376. IsReceiveEmail = table.Column<bool>(type: "bit", nullable: false, comment: "E-MAIL 수신 여부"),
  377. ReceiveEmailConsentAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "E-MAIL 수신 동의 일시"),
  378. IsReceiveNote = table.Column<bool>(type: "bit", nullable: false, comment: "쪽지 수신 여부"),
  379. ReceiveNoteConsentAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "쪽지 수신 동의 일시"),
  380. IsDisclosureInvest = table.Column<bool>(type: "bit", nullable: false, comment: "투자 현황 공개 여부"),
  381. DisclosureInvestConsentAt = table.Column<DateTime>(type: "datetime2", nullable: true, comment: "투자 현황 공개 동의 일시")
  382. },
  383. constraints: table =>
  384. {
  385. table.PrimaryKey("PK_MemberApprove", x => x.MemberID);
  386. table.ForeignKey(
  387. name: "FK_MemberApprove_Member_MemberID",
  388. column: x => x.MemberID,
  389. principalTable: "Member",
  390. principalColumn: "ID",
  391. onDelete: ReferentialAction.Cascade);
  392. },
  393. comment: "회원 동의 및 수신 여부");
  394. migrationBuilder.CreateTable(
  395. name: "MemberEmailChangeLog",
  396. columns: table => new
  397. {
  398. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  399. .Annotation("SqlServer:Identity", "1, 1"),
  400. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  401. BeforeEmail = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: true, comment: "이전 이메일"),
  402. AfterEmail = table.Column<string>(type: "nvarchar(60)", maxLength: 60, nullable: false, comment: "바뀐 이메일"),
  403. Referer = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
  404. IpAddress = table.Column<string>(type: "nvarchar(45)", maxLength: 45, nullable: true, comment: "IP Address"),
  405. UserAgent = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
  406. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  407. },
  408. constraints: table =>
  409. {
  410. table.PrimaryKey("PK_MemberEmailChangeLog", x => x.ID);
  411. table.ForeignKey(
  412. name: "FK_MemberEmailChangeLog_Member_MemberID",
  413. column: x => x.MemberID,
  414. principalTable: "Member",
  415. principalColumn: "ID",
  416. onDelete: ReferentialAction.Cascade);
  417. },
  418. comment: "사용자 이메일 변경 내역");
  419. migrationBuilder.CreateTable(
  420. name: "MemberIntroChangeLog",
  421. columns: table => new
  422. {
  423. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  424. .Annotation("SqlServer:Identity", "1, 1"),
  425. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  426. BeforeIntro = table.Column<string>(type: "nvarchar(3000)", maxLength: 3000, nullable: true, comment: "이전 자기소개"),
  427. AfterIntro = table.Column<string>(type: "nvarchar(3000)", maxLength: 3000, nullable: true, comment: "바꾼 자기소개"),
  428. Referer = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
  429. IpAddress = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "IP Address"),
  430. UserAgent = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
  431. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  432. },
  433. constraints: table =>
  434. {
  435. table.PrimaryKey("PK_MemberIntroChangeLog", x => x.ID);
  436. table.ForeignKey(
  437. name: "FK_MemberIntroChangeLog_Member_MemberID",
  438. column: x => x.MemberID,
  439. principalTable: "Member",
  440. principalColumn: "ID",
  441. onDelete: ReferentialAction.Cascade);
  442. },
  443. comment: "자기소개 변경 내역");
  444. migrationBuilder.CreateTable(
  445. name: "MemberLoginLog",
  446. columns: table => new
  447. {
  448. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  449. .Annotation("SqlServer:Identity", "1, 1"),
  450. MemberID = table.Column<int>(type: "int", nullable: true, comment: "회원 ID"),
  451. Success = table.Column<bool>(type: "bit", nullable: false, comment: "로그인 성공 여부 (0: 실패, 1: 성공)"),
  452. Account = table.Column<string>(type: "nvarchar(120)", maxLength: 120, nullable: false, comment: "로그인 시도한 계정"),
  453. Reason = table.Column<string>(type: "nvarchar(225)", maxLength: 225, nullable: true, comment: "실패 이유"),
  454. Referer = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
  455. Url = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true, comment: "요청 주소"),
  456. IpAddress = table.Column<string>(type: "nvarchar(45)", maxLength: 45, nullable: true, comment: "IP Address"),
  457. UserAgent = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
  458. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  459. },
  460. constraints: table =>
  461. {
  462. table.PrimaryKey("PK_MemberLoginLog", x => x.ID);
  463. table.ForeignKey(
  464. name: "FK_MemberLoginLog_Member_MemberID",
  465. column: x => x.MemberID,
  466. principalTable: "Member",
  467. principalColumn: "ID",
  468. onDelete: ReferentialAction.SetNull);
  469. },
  470. comment: "로그인 기록");
  471. migrationBuilder.CreateTable(
  472. name: "MemberNameChangeLog",
  473. columns: table => new
  474. {
  475. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  476. .Annotation("SqlServer:Identity", "1, 1"),
  477. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  478. BeforeName = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "이전 별명"),
  479. AfterName = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true, comment: "바꾼 별명"),
  480. Referer = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
  481. IpAddress = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "IP Address"),
  482. UserAgent = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
  483. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  484. },
  485. constraints: table =>
  486. {
  487. table.PrimaryKey("PK_MemberNameChangeLog", x => x.ID);
  488. table.ForeignKey(
  489. name: "FK_MemberNameChangeLog_Member_MemberID",
  490. column: x => x.MemberID,
  491. principalTable: "Member",
  492. principalColumn: "ID",
  493. onDelete: ReferentialAction.Cascade);
  494. },
  495. comment: "별명 변경 내역");
  496. migrationBuilder.CreateTable(
  497. name: "MemberStats",
  498. columns: table => new
  499. {
  500. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  501. RowVersion = table.Column<byte[]>(type: "rowversion", rowVersion: true, nullable: false, comment: "동시성"),
  502. Exp = table.Column<long>(type: "bigint", nullable: false, comment: "경험치"),
  503. PostCount = table.Column<long>(type: "bigint", nullable: false, comment: "작성 게시글"),
  504. CommentCount = table.Column<long>(type: "bigint", nullable: false, comment: "작성 댓글"),
  505. LikeReceivedCount = table.Column<long>(type: "bigint", nullable: false, comment: "받은 좋아요 수"),
  506. LikeGivenCount = table.Column<long>(type: "bigint", nullable: false, comment: "누른 좋아요 수"),
  507. ReportedCount = table.Column<long>(type: "bigint", nullable: false, comment: "신고 당한 횟수"),
  508. BookmarkGivenCount = table.Column<long>(type: "bigint", nullable: false, comment: "즐겨찾기 글 수"),
  509. WarningCount = table.Column<int>(type: "int", nullable: false, comment: "경고 횟수"),
  510. SuspensionCount = table.Column<int>(type: "int", nullable: false, comment: "정지 횟수"),
  511. LoginCount = table.Column<long>(type: "bigint", nullable: false, comment: "로그인"),
  512. AttendanceCount = table.Column<long>(type: "bigint", nullable: false, comment: "출석"),
  513. FollowingCount = table.Column<long>(type: "bigint", nullable: false, comment: "구독 중"),
  514. FollowerCount = table.Column<long>(type: "bigint", nullable: false, comment: "구독자"),
  515. PaymentCount = table.Column<long>(type: "bigint", nullable: false, comment: "결제 횟수"),
  516. TotalPaidAmount = table.Column<long>(type: "bigint", nullable: false, comment: "누적 결제 금액"),
  517. TotalCanceledAmount = table.Column<long>(type: "bigint", nullable: false, comment: "누적 취소/환불 금액")
  518. },
  519. constraints: table =>
  520. {
  521. table.PrimaryKey("PK_MemberStats", x => x.MemberID);
  522. table.ForeignKey(
  523. name: "FK_MemberStats_Member_MemberID",
  524. column: x => x.MemberID,
  525. principalTable: "Member",
  526. principalColumn: "ID",
  527. onDelete: ReferentialAction.Cascade);
  528. },
  529. comment: "회원 활동 집계");
  530. migrationBuilder.CreateTable(
  531. name: "MemberSummaryChangeLog",
  532. columns: table => new
  533. {
  534. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  535. .Annotation("SqlServer:Identity", "1, 1"),
  536. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  537. BeforeSummary = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "이전 한마디"),
  538. AfterSummary = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true, comment: "바꾼 한마디"),
  539. Referer = table.Column<string>(type: "nvarchar(max)", nullable: true, comment: "이전 페이지 주소"),
  540. IpAddress = table.Column<string>(type: "nvarchar(15)", maxLength: 15, nullable: true, comment: "IP Address"),
  541. UserAgent = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true, comment: "User Agent"),
  542. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "등록 일시")
  543. },
  544. constraints: table =>
  545. {
  546. table.PrimaryKey("PK_MemberSummaryChangeLog", x => x.ID);
  547. table.ForeignKey(
  548. name: "FK_MemberSummaryChangeLog_Member_MemberID",
  549. column: x => x.MemberID,
  550. principalTable: "Member",
  551. principalColumn: "ID",
  552. onDelete: ReferentialAction.Cascade);
  553. },
  554. comment: "한마디 변경 내역");
  555. migrationBuilder.CreateTable(
  556. name: "Wallet",
  557. columns: table => new
  558. {
  559. ID = table.Column<int>(type: "int", nullable: false)
  560. .Annotation("SqlServer:Identity", "1, 1"),
  561. WalletKey = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  562. MemberID = table.Column<int>(type: "int", nullable: false),
  563. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
  564. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  565. },
  566. constraints: table =>
  567. {
  568. table.PrimaryKey("PK_Wallet", x => x.ID);
  569. table.UniqueConstraint("AK_Wallet_WalletKey", x => x.WalletKey);
  570. table.ForeignKey(
  571. name: "FK_Wallet_Member_MemberID",
  572. column: x => x.MemberID,
  573. principalTable: "Member",
  574. principalColumn: "ID",
  575. onDelete: ReferentialAction.Cascade);
  576. },
  577. comment: "회원 지갑");
  578. migrationBuilder.CreateTable(
  579. name: "WalletBalance",
  580. columns: table => new
  581. {
  582. ID = table.Column<int>(type: "int", nullable: false)
  583. .Annotation("SqlServer:Identity", "1, 1"),
  584. WalletKey = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  585. Type = table.Column<int>(type: "int", nullable: false),
  586. Amount = table.Column<decimal>(type: "decimal(18,0)", precision: 18, scale: 0, nullable: false),
  587. Currency = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false)
  588. },
  589. constraints: table =>
  590. {
  591. table.PrimaryKey("PK_WalletBalance", x => x.ID);
  592. table.ForeignKey(
  593. name: "FK_WalletBalance_Wallet_WalletKey",
  594. column: x => x.WalletKey,
  595. principalTable: "Wallet",
  596. principalColumn: "WalletKey",
  597. onDelete: ReferentialAction.Cascade);
  598. },
  599. comment: "회원 지갑 잔액");
  600. migrationBuilder.CreateTable(
  601. name: "WalletTransaction",
  602. columns: table => new
  603. {
  604. ID = table.Column<int>(type: "int", nullable: false)
  605. .Annotation("SqlServer:Identity", "1, 1"),
  606. WalletKey = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
  607. BalanceType = table.Column<int>(type: "int", nullable: false),
  608. TxType = table.Column<int>(type: "int", nullable: false),
  609. Amount = table.Column<decimal>(type: "decimal(18,0)", precision: 18, scale: 0, nullable: false),
  610. Currency = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
  611. BalanceAfter = table.Column<decimal>(type: "decimal(18,0)", precision: 18, scale: 0, nullable: false),
  612. BalanceAfterCurrency = table.Column<string>(type: "nvarchar(10)", maxLength: 10, nullable: false),
  613. Reason = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
  614. RefID = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
  615. UserID = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
  616. Memo = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  617. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
  618. },
  619. constraints: table =>
  620. {
  621. table.PrimaryKey("PK_WalletTransaction", x => x.ID);
  622. table.ForeignKey(
  623. name: "FK_WalletTransaction_Wallet_WalletKey",
  624. column: x => x.WalletKey,
  625. principalTable: "Wallet",
  626. principalColumn: "WalletKey",
  627. onDelete: ReferentialAction.Cascade);
  628. },
  629. comment: "회원 거래 장부");
  630. migrationBuilder.CreateIndex(
  631. name: "IX_BannerItem_IsActive",
  632. table: "BannerItem",
  633. column: "IsActive");
  634. migrationBuilder.CreateIndex(
  635. name: "IX_BannerItem_Order",
  636. table: "BannerItem",
  637. column: "Order");
  638. migrationBuilder.CreateIndex(
  639. name: "IX_BannerItem_PositionID",
  640. table: "BannerItem",
  641. column: "PositionID");
  642. migrationBuilder.CreateIndex(
  643. name: "IX_BannerItem_PositionID_Order_IsActive",
  644. table: "BannerItem",
  645. columns: new[] { "PositionID", "Order", "IsActive" });
  646. migrationBuilder.CreateIndex(
  647. name: "IX_BannerPosition_Code",
  648. table: "BannerPosition",
  649. column: "Code",
  650. unique: true);
  651. migrationBuilder.CreateIndex(
  652. name: "IX_BannerPosition_Code_IsActive",
  653. table: "BannerPosition",
  654. columns: new[] { "Code", "IsActive" });
  655. migrationBuilder.CreateIndex(
  656. name: "IX_BannerPosition_IsActive",
  657. table: "BannerPosition",
  658. column: "IsActive");
  659. migrationBuilder.CreateIndex(
  660. name: "IX_Channel_Handle",
  661. table: "Channel",
  662. column: "Handle",
  663. unique: true,
  664. filter: "[Handle] IS NOT NULL");
  665. migrationBuilder.CreateIndex(
  666. name: "IX_Channel_MemberID",
  667. table: "Channel",
  668. column: "MemberID",
  669. unique: true);
  670. migrationBuilder.CreateIndex(
  671. name: "IX_Channel_MemberID_IsActive",
  672. table: "Channel",
  673. columns: new[] { "MemberID", "IsActive" });
  674. migrationBuilder.CreateIndex(
  675. name: "IX_Channel_MemberID_IsVerified",
  676. table: "Channel",
  677. columns: new[] { "MemberID", "IsVerified" });
  678. migrationBuilder.CreateIndex(
  679. name: "IX_Channel_MemberID_IsVerified_IsActive",
  680. table: "Channel",
  681. columns: new[] { "MemberID", "IsVerified", "IsActive" });
  682. migrationBuilder.CreateIndex(
  683. name: "IX_Channel_Name",
  684. table: "Channel",
  685. column: "Name",
  686. unique: true);
  687. migrationBuilder.CreateIndex(
  688. name: "IX_Channel_SID",
  689. table: "Channel",
  690. column: "SID",
  691. unique: true);
  692. migrationBuilder.CreateIndex(
  693. name: "IX_Channel_YouTubeUrl",
  694. table: "Channel",
  695. column: "YouTubeUrl",
  696. unique: true);
  697. migrationBuilder.CreateIndex(
  698. name: "IX_Document_Code",
  699. table: "Document",
  700. column: "Code",
  701. unique: true);
  702. migrationBuilder.CreateIndex(
  703. name: "IX_Document_Code_IsActive",
  704. table: "Document",
  705. columns: new[] { "Code", "IsActive" });
  706. migrationBuilder.CreateIndex(
  707. name: "IX_Document_IsActive",
  708. table: "Document",
  709. column: "IsActive");
  710. migrationBuilder.CreateIndex(
  711. name: "IX_Document_Subject",
  712. table: "Document",
  713. column: "Subject");
  714. migrationBuilder.CreateIndex(
  715. name: "IX_EmailVerifyNumber_Code",
  716. table: "EmailVerifyNumber",
  717. column: "Code");
  718. migrationBuilder.CreateIndex(
  719. name: "IX_EmailVerifyNumber_Email",
  720. table: "EmailVerifyNumber",
  721. column: "Email");
  722. migrationBuilder.CreateIndex(
  723. name: "IX_EmailVerifyNumber_Expiration",
  724. table: "EmailVerifyNumber",
  725. column: "Expiration");
  726. migrationBuilder.CreateIndex(
  727. name: "IX_EmailVerifyNumber_IsVerified",
  728. table: "EmailVerifyNumber",
  729. column: "IsVerified");
  730. migrationBuilder.CreateIndex(
  731. name: "IX_EmailVerifyNumber_Type",
  732. table: "EmailVerifyNumber",
  733. column: "Type");
  734. migrationBuilder.CreateIndex(
  735. name: "IX_EmailVerifyNumber_Type_Code",
  736. table: "EmailVerifyNumber",
  737. columns: new[] { "Type", "Code" });
  738. migrationBuilder.CreateIndex(
  739. name: "IX_EmailVerifyNumber_Type_Code_IsVerified",
  740. table: "EmailVerifyNumber",
  741. columns: new[] { "Type", "Code", "IsVerified" });
  742. migrationBuilder.CreateIndex(
  743. name: "IX_EmailVerifyToken_Email",
  744. table: "EmailVerifyToken",
  745. column: "Email");
  746. migrationBuilder.CreateIndex(
  747. name: "IX_EmailVerifyToken_Expiration",
  748. table: "EmailVerifyToken",
  749. column: "Expiration");
  750. migrationBuilder.CreateIndex(
  751. name: "IX_EmailVerifyToken_IsVerified",
  752. table: "EmailVerifyToken",
  753. column: "IsVerified");
  754. migrationBuilder.CreateIndex(
  755. name: "IX_EmailVerifyToken_Token",
  756. table: "EmailVerifyToken",
  757. column: "Token");
  758. migrationBuilder.CreateIndex(
  759. name: "IX_EmailVerifyToken_Type",
  760. table: "EmailVerifyToken",
  761. column: "Type");
  762. migrationBuilder.CreateIndex(
  763. name: "IX_EmailVerifyToken_Type_Email_Token",
  764. table: "EmailVerifyToken",
  765. columns: new[] { "Type", "Email", "Token" });
  766. migrationBuilder.CreateIndex(
  767. name: "IX_EmailVerifyToken_Type_Email_Token_IsVerified",
  768. table: "EmailVerifyToken",
  769. columns: new[] { "Type", "Email", "Token", "IsVerified" });
  770. migrationBuilder.CreateIndex(
  771. name: "IX_FaqCategory_Code",
  772. table: "FaqCategory",
  773. column: "Code",
  774. unique: true);
  775. migrationBuilder.CreateIndex(
  776. name: "IX_FaqCategory_Code_Order_IsActive",
  777. table: "FaqCategory",
  778. columns: new[] { "Code", "Order", "IsActive" });
  779. migrationBuilder.CreateIndex(
  780. name: "IX_FaqCategory_Order_IsActive",
  781. table: "FaqCategory",
  782. columns: new[] { "Order", "IsActive" });
  783. migrationBuilder.CreateIndex(
  784. name: "IX_FaqItem_CategoryID",
  785. table: "FaqItem",
  786. column: "CategoryID");
  787. migrationBuilder.CreateIndex(
  788. name: "IX_FaqItem_CategoryID_Order_IsActive",
  789. table: "FaqItem",
  790. columns: new[] { "CategoryID", "Order", "IsActive" });
  791. migrationBuilder.CreateIndex(
  792. name: "IX_FaqItem_IsActive",
  793. table: "FaqItem",
  794. column: "IsActive");
  795. migrationBuilder.CreateIndex(
  796. name: "IX_FaqItem_Order",
  797. table: "FaqItem",
  798. column: "Order");
  799. migrationBuilder.CreateIndex(
  800. name: "IX_FaqItem_Order_IsActive",
  801. table: "FaqItem",
  802. columns: new[] { "Order", "IsActive" });
  803. migrationBuilder.CreateIndex(
  804. name: "IX_Member_CreatedAt",
  805. table: "Member",
  806. column: "CreatedAt");
  807. migrationBuilder.CreateIndex(
  808. name: "IX_Member_DeletedAt",
  809. table: "Member",
  810. column: "DeletedAt");
  811. migrationBuilder.CreateIndex(
  812. name: "IX_Member_Email",
  813. table: "Member",
  814. column: "Email",
  815. unique: true);
  816. migrationBuilder.CreateIndex(
  817. name: "IX_Member_FullName",
  818. table: "Member",
  819. column: "FullName");
  820. migrationBuilder.CreateIndex(
  821. name: "IX_Member_Gender",
  822. table: "Member",
  823. column: "Gender");
  824. migrationBuilder.CreateIndex(
  825. name: "IX_Member_IsAdmin",
  826. table: "Member",
  827. column: "IsAdmin");
  828. migrationBuilder.CreateIndex(
  829. name: "IX_Member_IsAuthCertified",
  830. table: "Member",
  831. column: "IsAuthCertified");
  832. migrationBuilder.CreateIndex(
  833. name: "IX_Member_IsCreator",
  834. table: "Member",
  835. column: "IsCreator");
  836. migrationBuilder.CreateIndex(
  837. name: "IX_Member_IsDenied",
  838. table: "Member",
  839. column: "IsDenied");
  840. migrationBuilder.CreateIndex(
  841. name: "IX_Member_IsEmailVerified",
  842. table: "Member",
  843. column: "IsEmailVerified");
  844. migrationBuilder.CreateIndex(
  845. name: "IX_Member_IsWithdraw",
  846. table: "Member",
  847. column: "IsWithdraw");
  848. migrationBuilder.CreateIndex(
  849. name: "IX_Member_MemberGradeID",
  850. table: "Member",
  851. column: "MemberGradeID");
  852. migrationBuilder.CreateIndex(
  853. name: "IX_Member_Name",
  854. table: "Member",
  855. column: "Name",
  856. unique: true,
  857. filter: "[Name] IS NOT NULL");
  858. migrationBuilder.CreateIndex(
  859. name: "IX_Member_Phone",
  860. table: "Member",
  861. column: "Phone");
  862. migrationBuilder.CreateIndex(
  863. name: "IX_Member_SID",
  864. table: "Member",
  865. column: "SID",
  866. unique: true);
  867. migrationBuilder.CreateIndex(
  868. name: "IX_MemberEmailChangeLog_CreatedAt",
  869. table: "MemberEmailChangeLog",
  870. column: "CreatedAt");
  871. migrationBuilder.CreateIndex(
  872. name: "IX_MemberEmailChangeLog_MemberID",
  873. table: "MemberEmailChangeLog",
  874. column: "MemberID");
  875. migrationBuilder.CreateIndex(
  876. name: "IX_MemberGrade_EngName",
  877. table: "MemberGrade",
  878. column: "EngName",
  879. unique: true);
  880. migrationBuilder.CreateIndex(
  881. name: "IX_MemberGrade_IsActive",
  882. table: "MemberGrade",
  883. column: "IsActive");
  884. migrationBuilder.CreateIndex(
  885. name: "IX_MemberGrade_KorName",
  886. table: "MemberGrade",
  887. column: "KorName",
  888. unique: true);
  889. migrationBuilder.CreateIndex(
  890. name: "IX_MemberGrade_Order",
  891. table: "MemberGrade",
  892. column: "Order");
  893. migrationBuilder.CreateIndex(
  894. name: "IX_MemberGrade_Order_IsActive",
  895. table: "MemberGrade",
  896. columns: new[] { "Order", "IsActive" });
  897. migrationBuilder.CreateIndex(
  898. name: "IX_MemberIntroChangeLog_MemberID",
  899. table: "MemberIntroChangeLog",
  900. column: "MemberID");
  901. migrationBuilder.CreateIndex(
  902. name: "IX_MemberLoginLog_Account",
  903. table: "MemberLoginLog",
  904. column: "Account");
  905. migrationBuilder.CreateIndex(
  906. name: "IX_MemberLoginLog_MemberID",
  907. table: "MemberLoginLog",
  908. column: "MemberID");
  909. migrationBuilder.CreateIndex(
  910. name: "IX_MemberLoginLog_MemberID_Success",
  911. table: "MemberLoginLog",
  912. columns: new[] { "MemberID", "Success" });
  913. migrationBuilder.CreateIndex(
  914. name: "IX_MemberNameChangeLog_MemberID",
  915. table: "MemberNameChangeLog",
  916. column: "MemberID");
  917. migrationBuilder.CreateIndex(
  918. name: "IX_MemberSummaryChangeLog_MemberID",
  919. table: "MemberSummaryChangeLog",
  920. column: "MemberID");
  921. migrationBuilder.CreateIndex(
  922. name: "IX_Popup_Order",
  923. table: "Popup",
  924. column: "Order");
  925. migrationBuilder.CreateIndex(
  926. name: "IX_Popup_Order_IsActive",
  927. table: "Popup",
  928. columns: new[] { "Order", "IsActive" });
  929. migrationBuilder.CreateIndex(
  930. name: "IX_Popup_StartAt_EndAt_Order_IsActive",
  931. table: "Popup",
  932. columns: new[] { "StartAt", "EndAt", "Order", "IsActive" });
  933. migrationBuilder.CreateIndex(
  934. name: "IX_Wallet_MemberID",
  935. table: "Wallet",
  936. column: "MemberID",
  937. unique: true);
  938. migrationBuilder.CreateIndex(
  939. name: "IX_Wallet_WalletKey",
  940. table: "Wallet",
  941. column: "WalletKey",
  942. unique: true);
  943. migrationBuilder.CreateIndex(
  944. name: "IX_WalletBalance_WalletKey_Type",
  945. table: "WalletBalance",
  946. columns: new[] { "WalletKey", "Type" },
  947. unique: true);
  948. migrationBuilder.CreateIndex(
  949. name: "IX_WalletTransaction_CreatedAt",
  950. table: "WalletTransaction",
  951. column: "CreatedAt");
  952. migrationBuilder.CreateIndex(
  953. name: "IX_WalletTransaction_WalletKey",
  954. table: "WalletTransaction",
  955. column: "WalletKey");
  956. migrationBuilder.CreateIndex(
  957. name: "IX_WalletTransaction_WalletKey_CreatedAt",
  958. table: "WalletTransaction",
  959. columns: new[] { "WalletKey", "CreatedAt" });
  960. }
  961. /// <inheritdoc />
  962. protected override void Down(MigrationBuilder migrationBuilder)
  963. {
  964. migrationBuilder.DropTable(
  965. name: "BannerItem");
  966. migrationBuilder.DropTable(
  967. name: "Channel");
  968. migrationBuilder.DropTable(
  969. name: "Config");
  970. migrationBuilder.DropTable(
  971. name: "Document");
  972. migrationBuilder.DropTable(
  973. name: "EmailVerifyNumber");
  974. migrationBuilder.DropTable(
  975. name: "EmailVerifyToken");
  976. migrationBuilder.DropTable(
  977. name: "FaqItem");
  978. migrationBuilder.DropTable(
  979. name: "MemberApprove");
  980. migrationBuilder.DropTable(
  981. name: "MemberEmailChangeLog");
  982. migrationBuilder.DropTable(
  983. name: "MemberIntroChangeLog");
  984. migrationBuilder.DropTable(
  985. name: "MemberLoginLog");
  986. migrationBuilder.DropTable(
  987. name: "MemberNameChangeLog");
  988. migrationBuilder.DropTable(
  989. name: "MemberStats");
  990. migrationBuilder.DropTable(
  991. name: "MemberSummaryChangeLog");
  992. migrationBuilder.DropTable(
  993. name: "Popup");
  994. migrationBuilder.DropTable(
  995. name: "WalletBalance");
  996. migrationBuilder.DropTable(
  997. name: "WalletTransaction");
  998. migrationBuilder.DropTable(
  999. name: "BannerPosition");
  1000. migrationBuilder.DropTable(
  1001. name: "FaqCategory");
  1002. migrationBuilder.DropTable(
  1003. name: "Wallet");
  1004. migrationBuilder.DropTable(
  1005. name: "Member");
  1006. migrationBuilder.DropTable(
  1007. name: "MemberGrade");
  1008. }
  1009. }