The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20181222043715_InitialMigration.cs 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Metadata;
  3. using Microsoft.EntityFrameworkCore.Migrations;
  4. namespace Teknik.Data.Migrations
  5. {
  6. public partial class InitialMigration : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "Contact",
  12. columns: table => new
  13. {
  14. ContactId = table.Column<int>(nullable: false)
  15. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  16. Name = table.Column<string>(nullable: true),
  17. Email = table.Column<string>(nullable: true),
  18. Subject = table.Column<string>(nullable: true),
  19. Message = table.Column<string>(nullable: true),
  20. DateAdded = table.Column<DateTime>(nullable: false)
  21. },
  22. constraints: table =>
  23. {
  24. table.PrimaryKey("PK_Contact", x => x.ContactId);
  25. });
  26. migrationBuilder.CreateTable(
  27. name: "Podcasts",
  28. columns: table => new
  29. {
  30. PodcastId = table.Column<int>(nullable: false)
  31. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  32. Episode = table.Column<int>(nullable: false),
  33. Title = table.Column<string>(nullable: true),
  34. Description = table.Column<string>(nullable: true),
  35. Published = table.Column<bool>(nullable: false),
  36. DatePosted = table.Column<DateTime>(nullable: false),
  37. DatePublished = table.Column<DateTime>(nullable: false),
  38. DateEdited = table.Column<DateTime>(nullable: false)
  39. },
  40. constraints: table =>
  41. {
  42. table.PrimaryKey("PK_Podcasts", x => x.PodcastId);
  43. });
  44. migrationBuilder.CreateTable(
  45. name: "Takedowns",
  46. columns: table => new
  47. {
  48. TakedownId = table.Column<int>(nullable: false)
  49. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  50. Requester = table.Column<string>(nullable: true),
  51. RequesterContact = table.Column<string>(nullable: true),
  52. Reason = table.Column<string>(nullable: true),
  53. ActionTaken = table.Column<string>(nullable: true),
  54. DateRequested = table.Column<DateTime>(nullable: false),
  55. DateActionTaken = table.Column<DateTime>(nullable: false)
  56. },
  57. constraints: table =>
  58. {
  59. table.PrimaryKey("PK_Takedowns", x => x.TakedownId);
  60. });
  61. migrationBuilder.CreateTable(
  62. name: "Transactions",
  63. columns: table => new
  64. {
  65. TransactionId = table.Column<int>(nullable: false)
  66. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  67. Amount = table.Column<decimal>(type: "decimal(19, 5)", nullable: false),
  68. Currency = table.Column<int>(nullable: false),
  69. Reason = table.Column<string>(nullable: true),
  70. DateSent = table.Column<DateTime>(nullable: false)
  71. },
  72. constraints: table =>
  73. {
  74. table.PrimaryKey("PK_Transactions", x => x.TransactionId);
  75. });
  76. migrationBuilder.CreateTable(
  77. name: "Users",
  78. columns: table => new
  79. {
  80. UserId = table.Column<int>(nullable: false)
  81. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  82. Username = table.Column<string>(nullable: true),
  83. About = table.Column<string>(nullable: true),
  84. Website = table.Column<string>(nullable: true),
  85. Quote = table.Column<string>(nullable: true),
  86. Title = table.Column<string>(nullable: true),
  87. Description = table.Column<string>(nullable: true),
  88. Encrypt = table.Column<bool>(nullable: false)
  89. },
  90. constraints: table =>
  91. {
  92. table.PrimaryKey("PK_Users", x => x.UserId);
  93. });
  94. migrationBuilder.CreateTable(
  95. name: "PodcastFiles",
  96. columns: table => new
  97. {
  98. PodcastFileId = table.Column<int>(nullable: false)
  99. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  100. PodcastId = table.Column<int>(nullable: false),
  101. FileName = table.Column<string>(nullable: true),
  102. Path = table.Column<string>(nullable: true),
  103. ContentType = table.Column<string>(nullable: true),
  104. ContentLength = table.Column<long>(nullable: false),
  105. Size = table.Column<int>(nullable: false)
  106. },
  107. constraints: table =>
  108. {
  109. table.PrimaryKey("PK_PodcastFiles", x => x.PodcastFileId);
  110. table.ForeignKey(
  111. name: "FK_PodcastFiles_Podcasts_PodcastId",
  112. column: x => x.PodcastId,
  113. principalTable: "Podcasts",
  114. principalColumn: "PodcastId",
  115. onDelete: ReferentialAction.Cascade);
  116. });
  117. migrationBuilder.CreateTable(
  118. name: "PodcastTags",
  119. columns: table => new
  120. {
  121. PodcastTagId = table.Column<int>(nullable: false)
  122. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  123. PodcastId = table.Column<int>(nullable: false),
  124. Name = table.Column<string>(nullable: true),
  125. Description = table.Column<string>(nullable: true)
  126. },
  127. constraints: table =>
  128. {
  129. table.PrimaryKey("PK_PodcastTags", x => x.PodcastTagId);
  130. table.ForeignKey(
  131. name: "FK_PodcastTags_Podcasts_PodcastId",
  132. column: x => x.PodcastId,
  133. principalTable: "Podcasts",
  134. principalColumn: "PodcastId",
  135. onDelete: ReferentialAction.Cascade);
  136. });
  137. migrationBuilder.CreateTable(
  138. name: "Blogs",
  139. columns: table => new
  140. {
  141. BlogId = table.Column<int>(nullable: false)
  142. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  143. UserId = table.Column<int>(nullable: false)
  144. },
  145. constraints: table =>
  146. {
  147. table.PrimaryKey("PK_Blogs", x => x.BlogId);
  148. table.ForeignKey(
  149. name: "FK_Blogs_Users_UserId",
  150. column: x => x.UserId,
  151. principalTable: "Users",
  152. principalColumn: "UserId",
  153. onDelete: ReferentialAction.Cascade);
  154. });
  155. migrationBuilder.CreateTable(
  156. name: "InviteCodes",
  157. columns: table => new
  158. {
  159. InviteCodeId = table.Column<int>(nullable: false)
  160. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  161. Active = table.Column<bool>(nullable: false),
  162. Code = table.Column<string>(nullable: true),
  163. OwnerId = table.Column<int>(nullable: true),
  164. ClaimedUserId = table.Column<int>(nullable: true)
  165. },
  166. constraints: table =>
  167. {
  168. table.PrimaryKey("PK_InviteCodes", x => x.InviteCodeId);
  169. table.ForeignKey(
  170. name: "FK_InviteCodes_Users_ClaimedUserId",
  171. column: x => x.ClaimedUserId,
  172. principalTable: "Users",
  173. principalColumn: "UserId",
  174. onDelete: ReferentialAction.Restrict);
  175. table.ForeignKey(
  176. name: "FK_InviteCodes_Users_OwnerId",
  177. column: x => x.OwnerId,
  178. principalTable: "Users",
  179. principalColumn: "UserId",
  180. onDelete: ReferentialAction.Restrict);
  181. });
  182. migrationBuilder.CreateTable(
  183. name: "Pastes",
  184. columns: table => new
  185. {
  186. PasteId = table.Column<int>(nullable: false)
  187. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  188. UserId = table.Column<int>(nullable: true),
  189. DatePosted = table.Column<DateTime>(nullable: false),
  190. Url = table.Column<string>(nullable: true),
  191. FileName = table.Column<string>(nullable: true),
  192. Content = table.Column<string>(nullable: true),
  193. Title = table.Column<string>(nullable: true),
  194. Syntax = table.Column<string>(nullable: true),
  195. ExpireDate = table.Column<DateTime>(nullable: true),
  196. HashedPassword = table.Column<string>(nullable: true),
  197. Key = table.Column<string>(nullable: true),
  198. KeySize = table.Column<int>(nullable: false),
  199. IV = table.Column<string>(nullable: true),
  200. BlockSize = table.Column<int>(nullable: false),
  201. DeleteKey = table.Column<string>(nullable: true),
  202. Hide = table.Column<bool>(nullable: false),
  203. MaxViews = table.Column<int>(nullable: false),
  204. Views = table.Column<int>(nullable: false)
  205. },
  206. constraints: table =>
  207. {
  208. table.PrimaryKey("PK_Pastes", x => x.PasteId);
  209. table.ForeignKey(
  210. name: "FK_Pastes_Users_UserId",
  211. column: x => x.UserId,
  212. principalTable: "Users",
  213. principalColumn: "UserId",
  214. onDelete: ReferentialAction.Restrict);
  215. });
  216. migrationBuilder.CreateTable(
  217. name: "PodcastComments",
  218. columns: table => new
  219. {
  220. PodcastCommentId = table.Column<int>(nullable: false)
  221. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  222. PodcastId = table.Column<int>(nullable: false),
  223. UserId = table.Column<int>(nullable: false),
  224. DatePosted = table.Column<DateTime>(nullable: false),
  225. DateEdited = table.Column<DateTime>(nullable: false),
  226. Article = table.Column<string>(nullable: true)
  227. },
  228. constraints: table =>
  229. {
  230. table.PrimaryKey("PK_PodcastComments", x => x.PodcastCommentId);
  231. table.ForeignKey(
  232. name: "FK_PodcastComments_Podcasts_PodcastId",
  233. column: x => x.PodcastId,
  234. principalTable: "Podcasts",
  235. principalColumn: "PodcastId",
  236. onDelete: ReferentialAction.Cascade);
  237. table.ForeignKey(
  238. name: "FK_PodcastComments_Users_UserId",
  239. column: x => x.UserId,
  240. principalTable: "Users",
  241. principalColumn: "UserId",
  242. onDelete: ReferentialAction.Cascade);
  243. });
  244. migrationBuilder.CreateTable(
  245. name: "ShortenedUrls",
  246. columns: table => new
  247. {
  248. ShortenedUrlId = table.Column<int>(nullable: false)
  249. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  250. UserId = table.Column<int>(nullable: true),
  251. ShortUrl = table.Column<string>(nullable: true),
  252. OriginalUrl = table.Column<string>(nullable: true),
  253. DateAdded = table.Column<DateTime>(nullable: false),
  254. Views = table.Column<int>(nullable: false)
  255. },
  256. constraints: table =>
  257. {
  258. table.PrimaryKey("PK_ShortenedUrls", x => x.ShortenedUrlId);
  259. table.ForeignKey(
  260. name: "FK_ShortenedUrls_Users_UserId",
  261. column: x => x.UserId,
  262. principalTable: "Users",
  263. principalColumn: "UserId",
  264. onDelete: ReferentialAction.Restrict);
  265. });
  266. migrationBuilder.CreateTable(
  267. name: "Uploads",
  268. columns: table => new
  269. {
  270. UploadId = table.Column<int>(nullable: false)
  271. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  272. UserId = table.Column<int>(nullable: true),
  273. DateUploaded = table.Column<DateTime>(nullable: false),
  274. Url = table.Column<string>(nullable: true),
  275. FileName = table.Column<string>(nullable: true),
  276. ContentLength = table.Column<long>(nullable: false),
  277. ContentType = table.Column<string>(nullable: true),
  278. Key = table.Column<string>(nullable: true),
  279. IV = table.Column<string>(nullable: true),
  280. KeySize = table.Column<int>(nullable: false),
  281. BlockSize = table.Column<int>(nullable: false),
  282. DeleteKey = table.Column<string>(nullable: true),
  283. ExpireDate = table.Column<DateTime>(nullable: true),
  284. MaxDownloads = table.Column<int>(nullable: false),
  285. Downloads = table.Column<int>(nullable: false),
  286. Takedown_TakedownId = table.Column<int>(nullable: true)
  287. },
  288. constraints: table =>
  289. {
  290. table.PrimaryKey("PK_Uploads", x => x.UploadId);
  291. table.ForeignKey(
  292. name: "FK_Uploads_Takedowns_Takedown_TakedownId",
  293. column: x => x.Takedown_TakedownId,
  294. principalTable: "Takedowns",
  295. principalColumn: "TakedownId",
  296. onDelete: ReferentialAction.Restrict);
  297. table.ForeignKey(
  298. name: "FK_Uploads_Users_UserId",
  299. column: x => x.UserId,
  300. principalTable: "Users",
  301. principalColumn: "UserId",
  302. onDelete: ReferentialAction.Restrict);
  303. });
  304. migrationBuilder.CreateTable(
  305. name: "UserLogins",
  306. columns: table => new
  307. {
  308. LoginInfoId = table.Column<int>(nullable: false)
  309. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  310. LoginProvider = table.Column<string>(nullable: true),
  311. ProviderDisplayName = table.Column<string>(nullable: true),
  312. ProviderKey = table.Column<string>(nullable: true),
  313. UserId = table.Column<int>(nullable: false)
  314. },
  315. constraints: table =>
  316. {
  317. table.PrimaryKey("PK_UserLogins", x => x.LoginInfoId);
  318. table.ForeignKey(
  319. name: "FK_UserLogins_Users_UserId",
  320. column: x => x.UserId,
  321. principalTable: "Users",
  322. principalColumn: "UserId",
  323. onDelete: ReferentialAction.Cascade);
  324. });
  325. migrationBuilder.CreateTable(
  326. name: "Vaults",
  327. columns: table => new
  328. {
  329. VaultId = table.Column<int>(nullable: false)
  330. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  331. UserId = table.Column<int>(nullable: true),
  332. Url = table.Column<string>(nullable: true),
  333. Title = table.Column<string>(nullable: true),
  334. Description = table.Column<string>(nullable: true),
  335. DateCreated = table.Column<DateTime>(nullable: false),
  336. DateEdited = table.Column<DateTime>(nullable: false),
  337. Views = table.Column<int>(nullable: false)
  338. },
  339. constraints: table =>
  340. {
  341. table.PrimaryKey("PK_Vaults", x => x.VaultId);
  342. table.ForeignKey(
  343. name: "FK_Vaults_Users_UserId",
  344. column: x => x.UserId,
  345. principalTable: "Users",
  346. principalColumn: "UserId",
  347. onDelete: ReferentialAction.Restrict);
  348. });
  349. migrationBuilder.CreateTable(
  350. name: "BlogPosts",
  351. columns: table => new
  352. {
  353. BlogPostId = table.Column<int>(nullable: false)
  354. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  355. BlogId = table.Column<int>(nullable: false),
  356. System = table.Column<bool>(nullable: false),
  357. DatePosted = table.Column<DateTime>(nullable: false),
  358. DatePublished = table.Column<DateTime>(nullable: false),
  359. DateEdited = table.Column<DateTime>(nullable: false),
  360. Published = table.Column<bool>(nullable: false),
  361. Title = table.Column<string>(nullable: true),
  362. Article = table.Column<string>(nullable: true)
  363. },
  364. constraints: table =>
  365. {
  366. table.PrimaryKey("PK_BlogPosts", x => x.BlogPostId);
  367. table.ForeignKey(
  368. name: "FK_BlogPosts_Blogs_BlogId",
  369. column: x => x.BlogId,
  370. principalTable: "Blogs",
  371. principalColumn: "BlogId",
  372. onDelete: ReferentialAction.Cascade);
  373. });
  374. migrationBuilder.CreateTable(
  375. name: "VaultItems",
  376. columns: table => new
  377. {
  378. VaultItemId = table.Column<int>(nullable: false)
  379. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  380. VaultId = table.Column<int>(nullable: false),
  381. Title = table.Column<string>(nullable: true),
  382. Description = table.Column<string>(nullable: true),
  383. DateAdded = table.Column<DateTime>(nullable: false),
  384. Discriminator = table.Column<string>(nullable: false),
  385. PasteId = table.Column<int>(nullable: true),
  386. UploadId = table.Column<int>(nullable: true)
  387. },
  388. constraints: table =>
  389. {
  390. table.PrimaryKey("PK_VaultItems", x => x.VaultItemId);
  391. table.ForeignKey(
  392. name: "FK_VaultItems_Pastes_PasteId",
  393. column: x => x.PasteId,
  394. principalTable: "Pastes",
  395. principalColumn: "PasteId",
  396. onDelete: ReferentialAction.Cascade);
  397. table.ForeignKey(
  398. name: "FK_VaultItems_Uploads_UploadId",
  399. column: x => x.UploadId,
  400. principalTable: "Uploads",
  401. principalColumn: "UploadId",
  402. onDelete: ReferentialAction.Cascade);
  403. table.ForeignKey(
  404. name: "FK_VaultItems_Vaults_VaultId",
  405. column: x => x.VaultId,
  406. principalTable: "Vaults",
  407. principalColumn: "VaultId",
  408. onDelete: ReferentialAction.Cascade);
  409. });
  410. migrationBuilder.CreateTable(
  411. name: "BlogPostComments",
  412. columns: table => new
  413. {
  414. BlogPostCommentId = table.Column<int>(nullable: false)
  415. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  416. BlogPostId = table.Column<int>(nullable: false),
  417. UserId = table.Column<int>(nullable: true),
  418. DatePosted = table.Column<DateTime>(nullable: false),
  419. DateEdited = table.Column<DateTime>(nullable: false),
  420. Article = table.Column<string>(nullable: true)
  421. },
  422. constraints: table =>
  423. {
  424. table.PrimaryKey("PK_BlogPostComments", x => x.BlogPostCommentId);
  425. table.ForeignKey(
  426. name: "FK_BlogPostComments_BlogPosts_BlogPostId",
  427. column: x => x.BlogPostId,
  428. principalTable: "BlogPosts",
  429. principalColumn: "BlogPostId",
  430. onDelete: ReferentialAction.Cascade);
  431. table.ForeignKey(
  432. name: "FK_BlogPostComments_Users_UserId",
  433. column: x => x.UserId,
  434. principalTable: "Users",
  435. principalColumn: "UserId",
  436. onDelete: ReferentialAction.Restrict);
  437. });
  438. migrationBuilder.CreateTable(
  439. name: "BlogPostTags",
  440. columns: table => new
  441. {
  442. BlogPostTagId = table.Column<int>(nullable: false)
  443. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  444. BlogPostId = table.Column<int>(nullable: false),
  445. Name = table.Column<string>(nullable: true),
  446. Description = table.Column<string>(nullable: true)
  447. },
  448. constraints: table =>
  449. {
  450. table.PrimaryKey("PK_BlogPostTags", x => x.BlogPostTagId);
  451. table.ForeignKey(
  452. name: "FK_BlogPostTags_BlogPosts_BlogPostId",
  453. column: x => x.BlogPostId,
  454. principalTable: "BlogPosts",
  455. principalColumn: "BlogPostId",
  456. onDelete: ReferentialAction.Cascade);
  457. });
  458. migrationBuilder.CreateIndex(
  459. name: "IX_BlogPostComments_BlogPostId",
  460. table: "BlogPostComments",
  461. column: "BlogPostId");
  462. migrationBuilder.CreateIndex(
  463. name: "IX_BlogPostComments_UserId",
  464. table: "BlogPostComments",
  465. column: "UserId");
  466. migrationBuilder.CreateIndex(
  467. name: "IX_BlogPosts_BlogId",
  468. table: "BlogPosts",
  469. column: "BlogId");
  470. migrationBuilder.CreateIndex(
  471. name: "IX_BlogPostTags_BlogPostId",
  472. table: "BlogPostTags",
  473. column: "BlogPostId");
  474. migrationBuilder.CreateIndex(
  475. name: "IX_Blogs_UserId",
  476. table: "Blogs",
  477. column: "UserId");
  478. migrationBuilder.CreateIndex(
  479. name: "IX_InviteCodes_ClaimedUserId",
  480. table: "InviteCodes",
  481. column: "ClaimedUserId",
  482. unique: true,
  483. filter: "[ClaimedUserId] IS NOT NULL");
  484. migrationBuilder.CreateIndex(
  485. name: "IX_InviteCodes_OwnerId",
  486. table: "InviteCodes",
  487. column: "OwnerId");
  488. migrationBuilder.CreateIndex(
  489. name: "IX_Pastes_UserId",
  490. table: "Pastes",
  491. column: "UserId");
  492. migrationBuilder.CreateIndex(
  493. name: "IX_PodcastComments_PodcastId",
  494. table: "PodcastComments",
  495. column: "PodcastId");
  496. migrationBuilder.CreateIndex(
  497. name: "IX_PodcastComments_UserId",
  498. table: "PodcastComments",
  499. column: "UserId");
  500. migrationBuilder.CreateIndex(
  501. name: "IX_PodcastFiles_PodcastId",
  502. table: "PodcastFiles",
  503. column: "PodcastId");
  504. migrationBuilder.CreateIndex(
  505. name: "IX_PodcastTags_PodcastId",
  506. table: "PodcastTags",
  507. column: "PodcastId");
  508. migrationBuilder.CreateIndex(
  509. name: "IX_ShortenedUrls_UserId",
  510. table: "ShortenedUrls",
  511. column: "UserId");
  512. migrationBuilder.CreateIndex(
  513. name: "IX_Uploads_Takedown_TakedownId",
  514. table: "Uploads",
  515. column: "Takedown_TakedownId");
  516. migrationBuilder.CreateIndex(
  517. name: "IX_Uploads_UserId",
  518. table: "Uploads",
  519. column: "UserId");
  520. migrationBuilder.CreateIndex(
  521. name: "IX_UserLogins_UserId",
  522. table: "UserLogins",
  523. column: "UserId");
  524. migrationBuilder.CreateIndex(
  525. name: "IX_VaultItems_PasteId",
  526. table: "VaultItems",
  527. column: "PasteId");
  528. migrationBuilder.CreateIndex(
  529. name: "IX_VaultItems_UploadId",
  530. table: "VaultItems",
  531. column: "UploadId");
  532. migrationBuilder.CreateIndex(
  533. name: "IX_VaultItems_VaultId",
  534. table: "VaultItems",
  535. column: "VaultId");
  536. migrationBuilder.CreateIndex(
  537. name: "IX_Vaults_UserId",
  538. table: "Vaults",
  539. column: "UserId");
  540. }
  541. protected override void Down(MigrationBuilder migrationBuilder)
  542. {
  543. migrationBuilder.DropTable(
  544. name: "BlogPostComments");
  545. migrationBuilder.DropTable(
  546. name: "BlogPostTags");
  547. migrationBuilder.DropTable(
  548. name: "Contact");
  549. migrationBuilder.DropTable(
  550. name: "InviteCodes");
  551. migrationBuilder.DropTable(
  552. name: "PodcastComments");
  553. migrationBuilder.DropTable(
  554. name: "PodcastFiles");
  555. migrationBuilder.DropTable(
  556. name: "PodcastTags");
  557. migrationBuilder.DropTable(
  558. name: "ShortenedUrls");
  559. migrationBuilder.DropTable(
  560. name: "Transactions");
  561. migrationBuilder.DropTable(
  562. name: "UserLogins");
  563. migrationBuilder.DropTable(
  564. name: "VaultItems");
  565. migrationBuilder.DropTable(
  566. name: "BlogPosts");
  567. migrationBuilder.DropTable(
  568. name: "Podcasts");
  569. migrationBuilder.DropTable(
  570. name: "Pastes");
  571. migrationBuilder.DropTable(
  572. name: "Uploads");
  573. migrationBuilder.DropTable(
  574. name: "Vaults");
  575. migrationBuilder.DropTable(
  576. name: "Blogs");
  577. migrationBuilder.DropTable(
  578. name: "Takedowns");
  579. migrationBuilder.DropTable(
  580. name: "Users");
  581. }
  582. }
  583. }