20260127065718_Init.cs 65 KB

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