Oppaitime's version of Gazelle

gazelle.sql 66KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811
  1. SET FOREIGN_KEY_CHECKS = 0;
  2. CREATE DATABASE gazelle CHARACTER SET utf8mb4;
  3. USE gazelle;
  4. CREATE TABLE `api_applications` (
  5. `ID` int(10) NOT NULL AUTO_INCREMENT,
  6. `UserID` int(10) NOT NULL,
  7. `Token` char(32) NOT NULL,
  8. `Name` varchar(50) NOT NULL,
  9. PRIMARY KEY (`ID`)
  10. ) ENGINE=InnoDB CHARSET=utf8mb4;
  11. CREATE TABLE `api_users` (
  12. `UserID` int(10) NOT NULL,
  13. `AppID` int(10) NOT NULL,
  14. `Token` char(32) NOT NULL,
  15. `State` enum('0','1','2') NOT NULL DEFAULT '0',
  16. `Time` datetime,
  17. `Access` text,
  18. PRIMARY KEY (`UserID`,`AppID`),
  19. KEY `UserID` (`UserID`)
  20. ) ENGINE=InnoDB CHARSET=utf8mb4;
  21. CREATE TABLE `artists_alias` (
  22. `AliasID` int(10) NOT NULL AUTO_INCREMENT,
  23. `ArtistID` int(10) NOT NULL,
  24. `Name` varchar(200) DEFAULT NULL,
  25. `Redirect` int(10) NOT NULL DEFAULT '0',
  26. `UserID` int(10) unsigned NOT NULL DEFAULT '0',
  27. PRIMARY KEY (`AliasID`),
  28. KEY `ArtistID` (`ArtistID`),
  29. KEY `Name` (`Name`)
  30. ) ENGINE=InnoDB CHARSET=utf8mb4;
  31. CREATE TABLE `artists_aliases` (
  32. `ID` int(10) NOT NULL AUTO_INCREMENT,
  33. `ArtistID` int(10) NOT NULL,
  34. `Name` varchar(255) NOT NULL DEFAULT '',
  35. `Primary` enum('0','1') DEFAULT '0',
  36. PRIMARY KEY (`ArtistID`,`Name`),
  37. UNIQUE KEY `ArtistID` (`ArtistID`,`Primary`),
  38. KEY `ID` (`ID`)
  39. ) ENGINE=InnoDB CHARSET=utf8mb4;
  40. CREATE TABLE `artists_group` (
  41. `ArtistID` int(10) NOT NULL AUTO_INCREMENT,
  42. `Name` varchar(200) NOT NULL DEFAULT '',
  43. `RevisionID` int(12) DEFAULT NULL,
  44. `LastCommentID` int(10) NOT NULL DEFAULT '0',
  45. PRIMARY KEY (`ArtistID`,`Name`),
  46. KEY `RevisionID` (`RevisionID`)
  47. ) ENGINE=InnoDB CHARSET=utf8mb4;
  48. CREATE TABLE `artists_tags` (
  49. `TagID` int(10) NOT NULL DEFAULT '0',
  50. `ArtistID` int(10) NOT NULL DEFAULT '0',
  51. `PositiveVotes` int(6) NOT NULL DEFAULT '1',
  52. `NegativeVotes` int(6) NOT NULL DEFAULT '1',
  53. `UserID` int(10) DEFAULT NULL,
  54. PRIMARY KEY (`TagID`,`ArtistID`),
  55. KEY `TagID` (`TagID`),
  56. KEY `ArtistID` (`ArtistID`),
  57. KEY `PositiveVotes` (`PositiveVotes`),
  58. KEY `NegativeVotes` (`NegativeVotes`),
  59. KEY `UserID` (`UserID`)
  60. ) ENGINE=InnoDB CHARSET=utf8mb4;
  61. CREATE TABLE `bad_passwords` (
  62. `Password` char(32) NOT NULL,
  63. PRIMARY KEY (`Password`)
  64. ) ENGINE=InnoDB CHARSET=utf8mb4;
  65. CREATE TABLE `badges` (
  66. `ID` int(10) NOT NULL AUTO_INCREMENT,
  67. `Icon` varchar(255) NOT NULL,
  68. `Name` varchar(255) DEFAULT NULL,
  69. `Description` varchar(255) DEFAULT NULL,
  70. PRIMARY KEY (`ID`)
  71. ) ENGINE=InnoDB CHARSET=utf8mb4;
  72. CREATE TABLE `blog` (
  73. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  74. `UserID` int(10) unsigned NOT NULL,
  75. `Title` varchar(255) NOT NULL,
  76. `Body` text,
  77. `Time` datetime,
  78. `ThreadID` int(10) unsigned DEFAULT NULL,
  79. `Important` tinyint(4) NOT NULL DEFAULT '0',
  80. PRIMARY KEY (`ID`),
  81. KEY `UserID` (`UserID`),
  82. KEY `Time` (`Time`)
  83. ) ENGINE=InnoDB CHARSET=utf8mb4;
  84. CREATE TABLE `bookmarks_artists` (
  85. `UserID` int(10) NOT NULL,
  86. `ArtistID` int(10) NOT NULL,
  87. `Time` datetime,
  88. KEY `UserID` (`UserID`),
  89. KEY `ArtistID` (`ArtistID`)
  90. ) ENGINE=InnoDB CHARSET=utf8mb4;
  91. CREATE TABLE `bookmarks_collages` (
  92. `UserID` int(10) NOT NULL,
  93. `CollageID` int(10) NOT NULL,
  94. `Time` datetime,
  95. KEY `UserID` (`UserID`),
  96. KEY `CollageID` (`CollageID`)
  97. ) ENGINE=InnoDB CHARSET=utf8mb4;
  98. CREATE TABLE `bookmarks_requests` (
  99. `UserID` int(10) NOT NULL,
  100. `RequestID` int(10) NOT NULL,
  101. `Time` datetime,
  102. KEY `UserID` (`UserID`),
  103. KEY `RequestID` (`RequestID`)
  104. ) ENGINE=InnoDB CHARSET=utf8mb4;
  105. CREATE TABLE `bookmarks_torrents` (
  106. `UserID` int(10) NOT NULL,
  107. `GroupID` int(10) NOT NULL,
  108. `Time` datetime,
  109. `Sort` int(11) NOT NULL DEFAULT '0',
  110. UNIQUE KEY `groups_users` (`GroupID`,`UserID`),
  111. KEY `UserID` (`UserID`),
  112. KEY `GroupID` (`GroupID`)
  113. ) ENGINE=InnoDB CHARSET=utf8mb4;
  114. CREATE TABLE `calendar` (
  115. `ID` int(10) NOT NULL AUTO_INCREMENT,
  116. `Title` varchar(255) DEFAULT NULL,
  117. `Body` mediumtext,
  118. `Category` tinyint(1) DEFAULT NULL,
  119. `StartDate` datetime DEFAULT NULL,
  120. `EndDate` datetime DEFAULT NULL,
  121. `AddedBy` int(10) DEFAULT NULL,
  122. `Importance` tinyint(1) DEFAULT NULL,
  123. `Team` tinyint(1) DEFAULT '1',
  124. PRIMARY KEY (`ID`)
  125. ) ENGINE=InnoDB CHARSET=utf8mb4;
  126. CREATE TABLE `changelog` (
  127. `ID` int(11) NOT NULL AUTO_INCREMENT,
  128. `Time` datetime,
  129. `Message` text,
  130. `Author` varchar(30) NOT NULL,
  131. PRIMARY KEY (`ID`)
  132. ) ENGINE=InnoDB CHARSET=utf8mb4;
  133. CREATE TABLE `collages` (
  134. `ID` int(10) NOT NULL AUTO_INCREMENT,
  135. `Name` varchar(100) NOT NULL DEFAULT '',
  136. `Description` text,
  137. `UserID` int(10) NOT NULL DEFAULT '0',
  138. `NumTorrents` int(4) NOT NULL DEFAULT '0',
  139. `Deleted` enum('0','1') DEFAULT '0',
  140. `Locked` enum('0','1') NOT NULL DEFAULT '0',
  141. `CategoryID` int(2) NOT NULL DEFAULT '1',
  142. `TagList` varchar(500) NOT NULL DEFAULT '',
  143. `MaxGroups` int(10) NOT NULL DEFAULT '0',
  144. `MaxGroupsPerUser` int(10) NOT NULL DEFAULT '0',
  145. `Featured` tinyint(4) NOT NULL DEFAULT '0',
  146. `Subscribers` int(10) DEFAULT '0',
  147. `updated` datetime,
  148. PRIMARY KEY (`ID`),
  149. UNIQUE KEY `Name` (`Name`),
  150. KEY `UserID` (`UserID`),
  151. KEY `CategoryID` (`CategoryID`)
  152. ) ENGINE=InnoDB CHARSET=utf8mb4;
  153. CREATE TABLE `collages_artists` (
  154. `CollageID` int(10) NOT NULL,
  155. `ArtistID` int(10) NOT NULL,
  156. `UserID` int(10) NOT NULL,
  157. `Sort` int(10) NOT NULL DEFAULT '0',
  158. `AddedOn` datetime,
  159. PRIMARY KEY (`CollageID`,`ArtistID`),
  160. KEY `UserID` (`UserID`),
  161. KEY `Sort` (`Sort`)
  162. ) ENGINE=InnoDB CHARSET=utf8mb4;
  163. CREATE TABLE `collages_torrents` (
  164. `CollageID` int(10) NOT NULL,
  165. `GroupID` int(10) NOT NULL,
  166. `UserID` int(10) NOT NULL,
  167. `Sort` int(10) NOT NULL DEFAULT '0',
  168. `AddedOn` datetime,
  169. PRIMARY KEY (`CollageID`,`GroupID`),
  170. KEY `UserID` (`UserID`),
  171. KEY `Sort` (`Sort`)
  172. ) ENGINE=InnoDB CHARSET=utf8mb4;
  173. CREATE TABLE `comments` (
  174. `ID` int(10) NOT NULL AUTO_INCREMENT,
  175. `Page` enum('artist','collages','requests','torrents') NOT NULL,
  176. `PageID` int(10) NOT NULL,
  177. `AuthorID` int(10) NOT NULL,
  178. `AddedTime` datetime,
  179. `Body` mediumtext,
  180. `EditedUserID` int(10) DEFAULT NULL,
  181. `EditedTime` datetime DEFAULT NULL,
  182. PRIMARY KEY (`ID`),
  183. KEY `Page` (`Page`,`PageID`),
  184. KEY `AuthorID` (`AuthorID`)
  185. ) ENGINE=InnoDB CHARSET=utf8mb4;
  186. CREATE TABLE `comments_edits` (
  187. `Page` enum('forums','artist','collages','requests','torrents') DEFAULT NULL,
  188. `PostID` int(10) DEFAULT NULL,
  189. `EditUser` int(10) DEFAULT NULL,
  190. `EditTime` datetime DEFAULT NULL,
  191. `Body` mediumtext,
  192. KEY `EditUser` (`EditUser`),
  193. KEY `PostHistory` (`Page`,`PostID`,`EditTime`)
  194. ) ENGINE=InnoDB CHARSET=utf8mb4;
  195. CREATE TABLE `comments_edits_tmp` (
  196. `Page` enum('forums','artist','collages','requests','torrents') DEFAULT NULL,
  197. `PostID` int(10) DEFAULT NULL,
  198. `EditUser` int(10) DEFAULT NULL,
  199. `EditTime` datetime DEFAULT NULL,
  200. `Body` mediumtext,
  201. KEY `EditUser` (`EditUser`),
  202. KEY `PostHistory` (`Page`,`PostID`,`EditTime`)
  203. ) ENGINE=InnoDB CHARSET=utf8mb4;
  204. CREATE TABLE `cover_art` (
  205. `ID` int(10) NOT NULL AUTO_INCREMENT,
  206. `GroupID` int(10) NOT NULL,
  207. `Image` varchar(255) NOT NULL DEFAULT '',
  208. `Summary` varchar(100) DEFAULT NULL,
  209. `UserID` int(10) NOT NULL DEFAULT '0',
  210. `Time` datetime DEFAULT NULL,
  211. PRIMARY KEY (`ID`),
  212. UNIQUE KEY `GroupID` (`GroupID`,`Image`)
  213. ) ENGINE=InnoDB CHARSET=utf8mb4;
  214. CREATE TABLE `currency_conversion_rates` (
  215. `Currency` char(3) NOT NULL,
  216. `Rate` decimal(9,4) DEFAULT NULL,
  217. `Time` datetime DEFAULT NULL,
  218. PRIMARY KEY (`Currency`)
  219. ) ENGINE=InnoDB CHARSET=utf8mb4;
  220. CREATE TABLE `do_not_upload` (
  221. `ID` int(10) NOT NULL AUTO_INCREMENT,
  222. `Name` varchar(255) NOT NULL,
  223. `Comment` varchar(255) NOT NULL,
  224. `UserID` int(10) NOT NULL,
  225. `Time` datetime,
  226. `Sequence` mediumint(8) NOT NULL,
  227. PRIMARY KEY (`ID`),
  228. KEY `Time` (`Time`)
  229. ) ENGINE=InnoDB CHARSET=utf8mb4;
  230. CREATE TABLE `donations` (
  231. `UserID` int(10) NOT NULL,
  232. `Amount` decimal(6,2) NOT NULL,
  233. `Email` varchar(255) NOT NULL,
  234. `Time` datetime,
  235. `Currency` varchar(5) NOT NULL DEFAULT 'USD',
  236. `Source` varchar(30) NOT NULL DEFAULT '',
  237. `Reason` mediumtext,
  238. `Rank` int(10) DEFAULT '0',
  239. `AddedBy` int(10) DEFAULT '0',
  240. `TotalRank` int(10) DEFAULT '0',
  241. KEY `UserID` (`UserID`),
  242. KEY `Time` (`Time`),
  243. KEY `Amount` (`Amount`)
  244. ) ENGINE=InnoDB CHARSET=utf8mb4;
  245. CREATE TABLE `donations_bitcoin` (
  246. `BitcoinAddress` varchar(34) NOT NULL,
  247. `Amount` decimal(24,8) NOT NULL,
  248. KEY `BitcoinAddress` (`BitcoinAddress`,`Amount`)
  249. ) ENGINE=InnoDB CHARSET=utf8mb4;
  250. CREATE TABLE `donor_forum_usernames` (
  251. `UserID` int(10) NOT NULL DEFAULT '0',
  252. `Prefix` varchar(30) NOT NULL DEFAULT '',
  253. `Suffix` varchar(30) NOT NULL DEFAULT '',
  254. `UseComma` tinyint(1) DEFAULT '1',
  255. PRIMARY KEY (`UserID`)
  256. ) ENGINE=InnoDB CHARSET=utf8mb4;
  257. CREATE TABLE `donor_rewards` (
  258. `UserID` int(10) NOT NULL DEFAULT '0',
  259. `IconMouseOverText` varchar(200) NOT NULL DEFAULT '',
  260. `AvatarMouseOverText` varchar(200) NOT NULL DEFAULT '',
  261. `CustomIcon` varchar(200) NOT NULL DEFAULT '',
  262. `SecondAvatar` varchar(200) NOT NULL DEFAULT '',
  263. `CustomIconLink` varchar(200) NOT NULL DEFAULT '',
  264. `ProfileInfo1` text,
  265. `ProfileInfo2` text,
  266. `ProfileInfo3` text,
  267. `ProfileInfo4` text,
  268. `ProfileInfoTitle1` varchar(255) NOT NULL,
  269. `ProfileInfoTitle2` varchar(255) NOT NULL,
  270. `ProfileInfoTitle3` varchar(255) NOT NULL,
  271. `ProfileInfoTitle4` varchar(255) NOT NULL,
  272. PRIMARY KEY (`UserID`)
  273. ) ENGINE=InnoDB CHARSET=utf8mb4;
  274. CREATE TABLE `drives` (
  275. `DriveID` int(10) NOT NULL AUTO_INCREMENT,
  276. `Name` varchar(50) NOT NULL,
  277. `Offset` varchar(10) NOT NULL,
  278. PRIMARY KEY (`DriveID`),
  279. KEY `Name` (`Name`)
  280. ) ENGINE=InnoDB CHARSET=utf8mb4;
  281. CREATE TABLE `dupe_groups` (
  282. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  283. `Comments` text,
  284. PRIMARY KEY (`ID`)
  285. ) ENGINE=InnoDB CHARSET=utf8mb4;
  286. CREATE TABLE `email_blacklist` (
  287. `ID` int(10) NOT NULL AUTO_INCREMENT,
  288. `UserID` int(10) NOT NULL,
  289. `Email` varchar(255) NOT NULL,
  290. `Time` datetime,
  291. `Comment` text,
  292. PRIMARY KEY (`ID`)
  293. ) ENGINE=InnoDB CHARSET=utf8mb4;
  294. CREATE TABLE `deletion_requests` (
  295. `UserID` int(10) unsigned NOT NULL,
  296. `Value` varchar(255) NOT NULL,
  297. `Type` varchar(255) NOT NULL,
  298. `Reason` text,
  299. `Time` datetime,
  300. PRIMARY KEY (`UserID`,`Value`)
  301. ) ENGINE=InnoDB CHARSET=utf8mb4;
  302. CREATE TABLE `featured_albums` (
  303. `GroupID` int(10) NOT NULL DEFAULT '0',
  304. `ThreadID` int(10) NOT NULL DEFAULT '0',
  305. `Title` varchar(35) NOT NULL DEFAULT '',
  306. `Started` datetime,
  307. `Ended` datetime
  308. ) ENGINE=InnoDB CHARSET=utf8mb4;
  309. CREATE TABLE `featured_merch` (
  310. `ProductID` int(10) NOT NULL DEFAULT '0',
  311. `Title` varchar(35) NOT NULL DEFAULT '',
  312. `Image` varchar(255) NOT NULL DEFAULT '',
  313. `Started` datetime,
  314. `Ended` datetime,
  315. `ArtistID` int(10) unsigned DEFAULT '0'
  316. ) ENGINE=InnoDB CHARSET=utf8mb4;
  317. CREATE TABLE `forums` (
  318. `ID` int(6) unsigned NOT NULL AUTO_INCREMENT,
  319. `CategoryID` tinyint(2) NOT NULL DEFAULT '0',
  320. `Sort` int(6) unsigned NOT NULL,
  321. `Name` varchar(40) NOT NULL DEFAULT '',
  322. `Description` varchar(255) DEFAULT '',
  323. `MinClassRead` int(4) NOT NULL DEFAULT '0',
  324. `MinClassWrite` int(4) NOT NULL DEFAULT '0',
  325. `MinClassCreate` int(4) NOT NULL DEFAULT '0',
  326. `NumTopics` int(10) NOT NULL DEFAULT '0',
  327. `NumPosts` int(10) NOT NULL DEFAULT '0',
  328. `LastPostID` int(10) NOT NULL DEFAULT '0',
  329. `LastPostAuthorID` int(10) NOT NULL DEFAULT '0',
  330. `LastPostTopicID` int(10) NOT NULL DEFAULT '0',
  331. `LastPostTime` datetime,
  332. PRIMARY KEY (`ID`),
  333. KEY `Sort` (`Sort`),
  334. KEY `MinClassRead` (`MinClassRead`)
  335. ) ENGINE=InnoDB CHARSET=utf8mb4;
  336. CREATE TABLE `forums_categories` (
  337. `ID` tinyint(2) NOT NULL AUTO_INCREMENT,
  338. `Name` varchar(40) NOT NULL DEFAULT '',
  339. `Sort` int(6) unsigned NOT NULL DEFAULT '0',
  340. PRIMARY KEY (`ID`),
  341. KEY `Sort` (`Sort`)
  342. ) ENGINE=InnoDB CHARSET=utf8mb4;
  343. CREATE TABLE `forums_last_read_topics` (
  344. `UserID` int(10) NOT NULL,
  345. `TopicID` int(10) NOT NULL,
  346. `PostID` int(10) NOT NULL,
  347. PRIMARY KEY (`UserID`,`TopicID`),
  348. KEY `TopicID` (`TopicID`)
  349. ) ENGINE=InnoDB CHARSET=utf8mb4;
  350. CREATE TABLE `forums_polls` (
  351. `TopicID` int(10) unsigned NOT NULL,
  352. `Question` varchar(255) NOT NULL,
  353. `Answers` text,
  354. `Featured` datetime,
  355. `Closed` enum('0','1') NOT NULL DEFAULT '0',
  356. PRIMARY KEY (`TopicID`)
  357. ) ENGINE=InnoDB CHARSET=utf8mb4;
  358. CREATE TABLE `forums_polls_votes` (
  359. `TopicID` int(10) unsigned NOT NULL,
  360. `UserID` int(10) unsigned NOT NULL,
  361. `Vote` tinyint(3) unsigned NOT NULL,
  362. PRIMARY KEY (`TopicID`,`UserID`)
  363. ) ENGINE=InnoDB CHARSET=utf8mb4;
  364. CREATE TABLE `forums_posts` (
  365. `ID` int(10) NOT NULL AUTO_INCREMENT,
  366. `TopicID` int(10) NOT NULL,
  367. `AuthorID` int(10) NOT NULL,
  368. `AddedTime` datetime,
  369. `Body` mediumtext,
  370. `EditedUserID` int(10) DEFAULT NULL,
  371. `EditedTime` datetime DEFAULT NULL,
  372. PRIMARY KEY (`ID`),
  373. KEY `TopicID` (`TopicID`),
  374. KEY `AuthorID` (`AuthorID`)
  375. ) ENGINE=InnoDB CHARSET=utf8mb4;
  376. CREATE TABLE `forums_specific_rules` (
  377. `ForumID` int(6) unsigned DEFAULT NULL,
  378. `ThreadID` int(10) DEFAULT NULL
  379. ) ENGINE=InnoDB CHARSET=utf8mb4;
  380. CREATE TABLE `forums_topic_notes` (
  381. `ID` int(10) NOT NULL AUTO_INCREMENT,
  382. `TopicID` int(10) NOT NULL,
  383. `AuthorID` int(10) NOT NULL,
  384. `AddedTime` datetime,
  385. `Body` mediumtext,
  386. PRIMARY KEY (`ID`),
  387. KEY `TopicID` (`TopicID`),
  388. KEY `AuthorID` (`AuthorID`)
  389. ) ENGINE=InnoDB CHARSET=utf8mb4;
  390. CREATE TABLE `forums_topics` (
  391. `ID` int(10) NOT NULL AUTO_INCREMENT,
  392. `Title` varchar(150) NOT NULL,
  393. `AuthorID` int(10) NOT NULL,
  394. `IsLocked` enum('0','1') NOT NULL DEFAULT '0',
  395. `IsSticky` enum('0','1') NOT NULL DEFAULT '0',
  396. `ForumID` int(3) NOT NULL,
  397. `NumPosts` int(10) NOT NULL DEFAULT '0',
  398. `LastPostID` int(10) NOT NULL DEFAULT '0',
  399. `LastPostTime` datetime,
  400. `LastPostAuthorID` int(10) NOT NULL,
  401. `StickyPostID` int(10) NOT NULL DEFAULT '0',
  402. `Ranking` tinyint(2) DEFAULT '0',
  403. `CreatedTime` datetime,
  404. PRIMARY KEY (`ID`),
  405. KEY `AuthorID` (`AuthorID`),
  406. KEY `ForumID` (`ForumID`),
  407. KEY `IsSticky` (`IsSticky`),
  408. KEY `LastPostID` (`LastPostID`),
  409. KEY `Title` (`Title`),
  410. KEY `CreatedTime` (`CreatedTime`)
  411. ) ENGINE=InnoDB CHARSET=utf8mb4;
  412. CREATE TABLE `friends` (
  413. `UserID` int(10) unsigned NOT NULL,
  414. `FriendID` int(10) unsigned NOT NULL,
  415. `Comment` text,
  416. PRIMARY KEY (`UserID`,`FriendID`),
  417. KEY `UserID` (`UserID`),
  418. KEY `FriendID` (`FriendID`)
  419. ) ENGINE=InnoDB CHARSET=utf8mb4;
  420. CREATE TABLE `geoip_country` (
  421. `StartIP` decimal(39,0) NOT NULL,
  422. `EndIP` decimal(39,0) NOT NULL,
  423. `Code` varchar(2) NOT NULL,
  424. PRIMARY KEY (`StartIP`,`EndIP`)
  425. ) ENGINE=InnoDB CHARSET=utf8mb4;
  426. CREATE TABLE `geoip_asn` (
  427. `StartIP` varbinary(16) NOT NULL,
  428. `EndIP` varbinary(16) NOT NULL,
  429. `ASN` decimal(10,0) NOT NULL,
  430. PRIMARY KEY (`StartIP`,`EndIP`)
  431. ) ENGINE=InnoDB CHARSET=utf8mb4;
  432. CREATE TABLE `group_log` (
  433. `ID` int(10) NOT NULL AUTO_INCREMENT,
  434. `GroupID` int(10) NOT NULL,
  435. `TorrentID` int(10) NOT NULL,
  436. `UserID` int(10) NOT NULL DEFAULT '0',
  437. `Info` mediumtext,
  438. `Time` datetime,
  439. `Hidden` tinyint(4) NOT NULL DEFAULT '0',
  440. PRIMARY KEY (`ID`),
  441. KEY `GroupID` (`GroupID`),
  442. KEY `TorrentID` (`TorrentID`),
  443. KEY `UserID` (`UserID`)
  444. ) ENGINE=InnoDB CHARSET=utf8mb4;
  445. CREATE TABLE `invite_tree` (
  446. `UserID` int(10) NOT NULL DEFAULT '0',
  447. `InviterID` int(10) NOT NULL DEFAULT '0',
  448. `TreePosition` int(8) NOT NULL DEFAULT '1',
  449. `TreeID` int(10) NOT NULL DEFAULT '1',
  450. `TreeLevel` int(3) NOT NULL DEFAULT '0',
  451. PRIMARY KEY (`UserID`),
  452. KEY `InviterID` (`InviterID`),
  453. KEY `TreePosition` (`TreePosition`),
  454. KEY `TreeID` (`TreeID`),
  455. KEY `TreeLevel` (`TreeLevel`)
  456. ) ENGINE=InnoDB CHARSET=utf8mb4;
  457. CREATE TABLE `invites` (
  458. `InviterID` int(10) NOT NULL DEFAULT '0',
  459. `InviteKey` char(32) NOT NULL,
  460. `Email` varchar(255) NOT NULL,
  461. `Expires` datetime,
  462. `Reason` varchar(255) NOT NULL DEFAULT '',
  463. PRIMARY KEY (`InviteKey`),
  464. KEY `Expires` (`Expires`),
  465. KEY `InviterID` (`InviterID`)
  466. ) ENGINE=InnoDB CHARSET=utf8mb4;
  467. CREATE TABLE `ip_bans` (
  468. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  469. `FromIP` int(11) unsigned NOT NULL,
  470. `ToIP` int(11) unsigned NOT NULL,
  471. `Reason` varchar(255) DEFAULT NULL,
  472. PRIMARY KEY (`ID`),
  473. UNIQUE KEY `FromIP_2` (`FromIP`,`ToIP`),
  474. KEY `ToIP` (`ToIP`)
  475. ) ENGINE=InnoDB CHARSET=utf8mb4;
  476. CREATE TABLE `label_aliases` (
  477. `ID` int(10) NOT NULL AUTO_INCREMENT,
  478. `BadLabel` varchar(100) NOT NULL,
  479. `AliasLabel` varchar(100) NOT NULL,
  480. PRIMARY KEY (`ID`),
  481. KEY `BadLabel` (`BadLabel`),
  482. KEY `AliasLabel` (`AliasLabel`)
  483. ) ENGINE=InnoDB CHARSET=utf8mb4;
  484. CREATE TABLE `last_sent_email` (
  485. `UserID` int(10) NOT NULL,
  486. PRIMARY KEY (`UserID`)
  487. ) ENGINE=InnoDB CHARSET=utf8mb4;
  488. CREATE TABLE `library_contest` (
  489. `UserID` int(10) NOT NULL,
  490. `TorrentID` int(10) NOT NULL,
  491. `Points` int(10) NOT NULL DEFAULT '0',
  492. PRIMARY KEY (`UserID`,`TorrentID`)
  493. ) ENGINE=InnoDB CHARSET=utf8mb4;
  494. CREATE TABLE `locked_accounts` (
  495. `UserID` int(10) unsigned NOT NULL,
  496. `Type` tinyint(1) NOT NULL,
  497. PRIMARY KEY (`UserID`),
  498. CONSTRAINT `fk_user_id` FOREIGN KEY (`UserID`) REFERENCES `users_main` (`ID`) ON DELETE CASCADE
  499. ) ENGINE=InnoDB CHARSET=utf8mb4;
  500. CREATE TABLE `log` (
  501. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  502. `Message` varchar(400) NOT NULL,
  503. `Time` datetime,
  504. PRIMARY KEY (`ID`),
  505. KEY `Time` (`Time`)
  506. ) ENGINE=InnoDB CHARSET=utf8mb4;
  507. CREATE TABLE `new_info_hashes` (
  508. `TorrentID` int(11) NOT NULL,
  509. `InfoHash` binary(20) DEFAULT NULL,
  510. PRIMARY KEY (`TorrentID`),
  511. KEY `InfoHash` (`InfoHash`)
  512. ) ENGINE=InnoDB CHARSET=utf8mb4;
  513. CREATE TABLE `news` (
  514. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  515. `UserID` int(10) unsigned NOT NULL,
  516. `Title` varchar(255) NOT NULL,
  517. `Body` text,
  518. `Time` datetime,
  519. PRIMARY KEY (`ID`),
  520. KEY `UserID` (`UserID`),
  521. KEY `Time` (`Time`)
  522. ) ENGINE=InnoDB CHARSET=utf8mb4;
  523. CREATE TABLE `ocelot_query_times` (
  524. `buffer` enum('users','torrents','snatches','peers') NOT NULL,
  525. `starttime` datetime,
  526. `ocelotinstance` datetime,
  527. `querylength` int(11) NOT NULL,
  528. `timespent` int(11) NOT NULL,
  529. UNIQUE KEY `starttime` (`starttime`)
  530. ) ENGINE=InnoDB CHARSET=utf8mb4;
  531. CREATE TABLE `permissions` (
  532. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  533. `Level` int(10) unsigned NOT NULL,
  534. `Name` varchar(25) NOT NULL,
  535. `Values` text,
  536. `DisplayStaff` enum('0','1') NOT NULL DEFAULT '0',
  537. `PermittedForums` varchar(150) NOT NULL DEFAULT '',
  538. `Secondary` tinyint(4) NOT NULL DEFAULT '0',
  539. `Abbreviation` varchar(5) NOT NULL DEFAULT '',
  540. PRIMARY KEY (`ID`),
  541. UNIQUE KEY `Level` (`Level`),
  542. KEY `DisplayStaff` (`DisplayStaff`)
  543. ) ENGINE=InnoDB CHARSET=utf8mb4;
  544. CREATE TABLE `pm_conversations` (
  545. `ID` int(12) NOT NULL AUTO_INCREMENT,
  546. `Subject` varchar(255) DEFAULT NULL,
  547. PRIMARY KEY (`ID`)
  548. ) ENGINE=InnoDB CHARSET=utf8mb4;
  549. CREATE TABLE `pm_conversations_users` (
  550. `UserID` int(10) NOT NULL DEFAULT '0',
  551. `ConvID` int(12) NOT NULL DEFAULT '0',
  552. `InInbox` enum('1','0') NOT NULL,
  553. `InSentbox` enum('1','0') NOT NULL,
  554. `SentDate` datetime,
  555. `ReceivedDate` datetime,
  556. `UnRead` enum('1','0') NOT NULL DEFAULT '1',
  557. `Sticky` enum('1','0') NOT NULL DEFAULT '0',
  558. `ForwardedTo` int(12) NOT NULL DEFAULT '0',
  559. PRIMARY KEY (`UserID`,`ConvID`),
  560. KEY `InInbox` (`InInbox`),
  561. KEY `InSentbox` (`InSentbox`),
  562. KEY `ConvID` (`ConvID`),
  563. KEY `UserID` (`UserID`),
  564. KEY `SentDate` (`SentDate`),
  565. KEY `ReceivedDate` (`ReceivedDate`),
  566. KEY `Sticky` (`Sticky`),
  567. KEY `ForwardedTo` (`ForwardedTo`)
  568. ) ENGINE=InnoDB CHARSET=utf8mb4;
  569. CREATE TABLE `pm_messages` (
  570. `ID` int(12) NOT NULL AUTO_INCREMENT,
  571. `ConvID` int(12) NOT NULL DEFAULT '0',
  572. `SentDate` datetime,
  573. `SenderID` int(10) NOT NULL DEFAULT '0',
  574. `Body` text,
  575. PRIMARY KEY (`ID`),
  576. KEY `ConvID` (`ConvID`)
  577. ) ENGINE=InnoDB CHARSET=utf8mb4;
  578. CREATE TABLE `reports` (
  579. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  580. `UserID` int(10) unsigned NOT NULL DEFAULT '0',
  581. `ThingID` int(10) unsigned NOT NULL DEFAULT '0',
  582. `Type` varchar(30) DEFAULT NULL,
  583. `Comment` text,
  584. `ResolverID` int(10) unsigned NOT NULL DEFAULT '0',
  585. `Status` enum('New','InProgress','Resolved') DEFAULT 'New',
  586. `ResolvedTime` datetime,
  587. `ReportedTime` datetime,
  588. `Reason` text,
  589. `ClaimerID` int(10) unsigned NOT NULL DEFAULT '0',
  590. `Notes` text,
  591. PRIMARY KEY (`ID`),
  592. KEY `Status` (`Status`),
  593. KEY `Type` (`Type`),
  594. KEY `ResolvedTime` (`ResolvedTime`),
  595. KEY `ResolverID` (`ResolverID`)
  596. ) ENGINE=InnoDB CHARSET=utf8mb4;
  597. CREATE TABLE `reports_email_blacklist` (
  598. `ID` int(10) NOT NULL AUTO_INCREMENT,
  599. `Type` tinyint(4) NOT NULL DEFAULT '0',
  600. `UserID` int(10) NOT NULL,
  601. `Time` datetime,
  602. `Checked` tinyint(4) NOT NULL DEFAULT '0',
  603. `ResolverID` int(10) DEFAULT '0',
  604. `Email` varchar(255) NOT NULL DEFAULT '',
  605. PRIMARY KEY (`ID`),
  606. KEY `Time` (`Time`),
  607. KEY `UserID` (`UserID`)
  608. ) ENGINE=InnoDB CHARSET=utf8mb4;
  609. CREATE TABLE `reportsv2` (
  610. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  611. `ReporterID` int(10) unsigned NOT NULL DEFAULT '0',
  612. `TorrentID` int(10) unsigned NOT NULL DEFAULT '0',
  613. `Type` varchar(20) DEFAULT '',
  614. `UserComment` text,
  615. `ResolverID` int(10) unsigned NOT NULL DEFAULT '0',
  616. `Status` enum('New','InProgress','Resolved') DEFAULT 'New',
  617. `ReportedTime` datetime,
  618. `LastChangeTime` datetime,
  619. `ModComment` text,
  620. `Track` text,
  621. `Image` text,
  622. `ExtraID` text,
  623. `Link` text,
  624. `LogMessage` text,
  625. PRIMARY KEY (`ID`),
  626. KEY `Status` (`Status`),
  627. KEY `Type` (`Type`(1)),
  628. KEY `LastChangeTime` (`LastChangeTime`),
  629. KEY `TorrentID` (`TorrentID`),
  630. KEY `ResolverID` (`ResolverID`)
  631. ) ENGINE=InnoDB CHARSET=utf8mb4;
  632. CREATE TABLE `requests` (
  633. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  634. `UserID` int(10) unsigned NOT NULL DEFAULT '0',
  635. `TimeAdded` datetime,
  636. `LastVote` datetime DEFAULT NULL,
  637. `CategoryID` int(3) NOT NULL,
  638. `Title` varchar(255) DEFAULT NULL,
  639. `TitleRJ` varchar(255) DEFAULT NULL,
  640. `TitleJP` varchar(255) DEFAULT NULL,
  641. `Image` varchar(255) DEFAULT NULL,
  642. `Description` text,
  643. `CatalogueNumber` varchar(50) NOT NULL,
  644. `DLsiteID` varchar(50) DEFAULT NULL,
  645. `FillerID` int(10) unsigned NOT NULL DEFAULT '0',
  646. `TorrentID` int(10) unsigned NOT NULL DEFAULT '0',
  647. `TimeFilled` datetime,
  648. `Visible` binary(1) NOT NULL DEFAULT '1',
  649. `GroupID` int(10) DEFAULT NULL,
  650. PRIMARY KEY (`ID`),
  651. KEY `Userid` (`UserID`),
  652. KEY `Name` (`Title`),
  653. KEY `Filled` (`TorrentID`),
  654. KEY `FillerID` (`FillerID`),
  655. KEY `TimeAdded` (`TimeAdded`),
  656. KEY `TimeFilled` (`TimeFilled`),
  657. KEY `LastVote` (`LastVote`),
  658. KEY `GroupID` (`GroupID`),
  659. KEY `NameJP` (`TitleJP`)
  660. ) ENGINE=InnoDB CHARSET=utf8mb4;
  661. CREATE TABLE `requests_artists` (
  662. `RequestID` int(10) unsigned NOT NULL,
  663. `ArtistID` int(10) NOT NULL,
  664. PRIMARY KEY (`RequestID`)
  665. ) ENGINE=InnoDB CHARSET=utf8mb4;
  666. CREATE TABLE `requests_tags` (
  667. `TagID` int(10) NOT NULL DEFAULT '0',
  668. `RequestID` int(10) NOT NULL DEFAULT '0',
  669. PRIMARY KEY (`TagID`,`RequestID`),
  670. KEY `TagID` (`TagID`),
  671. KEY `RequestID` (`RequestID`)
  672. ) ENGINE=InnoDB CHARSET=utf8mb4;
  673. CREATE TABLE `requests_votes` (
  674. `RequestID` int(10) NOT NULL DEFAULT '0',
  675. `UserID` int(10) NOT NULL DEFAULT '0',
  676. `Bounty` bigint(20) unsigned NOT NULL,
  677. PRIMARY KEY (`RequestID`,`UserID`),
  678. KEY `RequestID` (`RequestID`),
  679. KEY `UserID` (`UserID`),
  680. KEY `Bounty` (`Bounty`)
  681. ) ENGINE=InnoDB CHARSET=utf8mb4;
  682. CREATE TABLE `schedule` (
  683. `NextHour` int(2) NOT NULL DEFAULT '0',
  684. `NextDay` int(2) NOT NULL DEFAULT '0',
  685. `NextBiWeekly` int(2) NOT NULL DEFAULT '0'
  686. ) ENGINE=InnoDB CHARSET=utf8mb4;
  687. CREATE TABLE `shop_freeleeches` (
  688. `TorrentID` int(10) NOT NULL,
  689. `ExpiryTime` datetime,
  690. PRIMARY KEY (`TorrentID`),
  691. KEY `ExpiryTime` (`ExpiryTime`)
  692. ) ENGINE=InnoDB CHARSET=utf8mb4;
  693. CREATE TABLE `site_history` (
  694. `ID` int(10) NOT NULL AUTO_INCREMENT,
  695. `Title` varchar(255) DEFAULT NULL,
  696. `Url` varchar(255) NOT NULL DEFAULT '',
  697. `Category` tinyint(2) DEFAULT NULL,
  698. `SubCategory` tinyint(2) DEFAULT NULL,
  699. `Tags` mediumtext,
  700. `AddedBy` int(10) DEFAULT NULL,
  701. `Date` datetime DEFAULT NULL,
  702. `Body` mediumtext,
  703. PRIMARY KEY (`ID`)
  704. ) ENGINE=InnoDB CHARSET=utf8mb4;
  705. CREATE TABLE `misc` (
  706. `ID` int(11) NOT NULL AUTO_INCREMENT,
  707. `Name` varchar(64) NOT NULL,
  708. `First` text,
  709. `Second` text,
  710. PRIMARY KEY (`ID`),
  711. UNIQUE KEY `Name` (`Name`),
  712. KEY `name_index` (`Name`)
  713. ) ENGINE=InnoDB CHARSET=utf8mb4;
  714. CREATE TABLE `slaves` (
  715. `UserID` int(11) NOT NULL DEFAULT '0',
  716. `OwnerID` int(11) NOT NULL DEFAULT '0',
  717. PRIMARY KEY (`UserID`)
  718. ) ENGINE=InnoDB CHARSET=utf8mb4 COLLATE=utf8mb4_swedish_ci;
  719. CREATE TABLE `sphinx_a` (
  720. `gid` int(11) DEFAULT NULL,
  721. `aname` text,
  722. KEY `gid` (`gid`)
  723. ) ENGINE=InnoDB CHARSET=utf8mb4;
  724. CREATE TABLE `sphinx_delta` (
  725. `ID` int(10) NOT NULL,
  726. `GroupID` int(10) NOT NULL DEFAULT '0',
  727. `GroupName` varchar(255) DEFAULT NULL,
  728. `GroupNameRJ` varchar(255) DEFAULT NULL,
  729. `GroupNameJP` varchar(255) DEFAULT NULL,
  730. `ArtistName` varchar(2048) DEFAULT NULL,
  731. `TagList` varchar(728) DEFAULT NULL,
  732. `Year` int(4) DEFAULT NULL,
  733. `CatalogueNumber` varchar(50) DEFAULT NULL,
  734. `CategoryID` tinyint(2) DEFAULT NULL,
  735. `Time` int(12) DEFAULT NULL,
  736. `Size` bigint(20) DEFAULT NULL,
  737. `Snatched` int(10) DEFAULT NULL,
  738. `Seeders` int(10) DEFAULT NULL,
  739. `Leechers` int(10) DEFAULT NULL,
  740. `FreeTorrent` tinyint(1) DEFAULT NULL,
  741. `Media` varchar(255) DEFAULT NULL,
  742. `Container` varchar(255) DEFAULT NULL,
  743. `Codec` varchar(255) DEFAULT NULL,
  744. `Resolution` varchar(255) DEFAULT NULL,
  745. `AudioFormat` varchar(255) DEFAULT NULL,
  746. `Subbing` varchar(255) DEFAULT NULL,
  747. `Studio` varchar(80) DEFAULT NULL,
  748. `Series` varchar(80) DEFAULT NULL,
  749. `DLsiteID` varchar(20) DEFAULT NULL,
  750. `Language` varchar(255) DEFAULT NULL,
  751. `Censored` tinyint(1) NOT NULL DEFAULT '1',
  752. `FileList` mediumtext,
  753. `Description` text,
  754. `VoteScore` float NOT NULL DEFAULT '0',
  755. `LastChanged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  756. PRIMARY KEY (`ID`),
  757. KEY `GroupID` (`GroupID`),
  758. KEY `Size` (`Size`)
  759. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
  760. CREATE TABLE `sphinx_index_last_pos` (
  761. `Type` varchar(16) NOT NULL DEFAULT '',
  762. `ID` int(11) DEFAULT NULL,
  763. PRIMARY KEY (`Type`)
  764. ) ENGINE=InnoDB CHARSET=utf8mb4;
  765. CREATE TABLE `sphinx_requests` (
  766. `ID` int(10) unsigned NOT NULL,
  767. `UserID` int(10) unsigned NOT NULL DEFAULT '0',
  768. `TimeAdded` int(12) unsigned NOT NULL,
  769. `LastVote` int(12) unsigned NOT NULL,
  770. `CategoryID` int(3) NOT NULL,
  771. `Title` varchar(255) DEFAULT NULL,
  772. `TitleRJ` varchar(255) DEFAULT NULL,
  773. `TitleJP` varchar(255) DEFAULT NULL,
  774. `Year` int(4) DEFAULT NULL,
  775. `ArtistList` varchar(2048) DEFAULT NULL,
  776. `CatalogueNumber` varchar(50) NOT NULL,
  777. `DLSiteID` varchar(50) NOT NULL,
  778. `FillerID` int(10) unsigned NOT NULL DEFAULT '0',
  779. `TorrentID` int(10) unsigned NOT NULL DEFAULT '0',
  780. `TimeFilled` int(12) unsigned NOT NULL,
  781. `Visible` binary(1) NOT NULL DEFAULT '1',
  782. `Bounty` bigint(20) unsigned NOT NULL DEFAULT '0',
  783. `Votes` int(10) unsigned NOT NULL DEFAULT '0',
  784. PRIMARY KEY (`ID`),
  785. KEY `Userid` (`UserID`),
  786. KEY `Name` (`Title`),
  787. KEY `Filled` (`TorrentID`),
  788. KEY `FillerID` (`FillerID`),
  789. KEY `TimeAdded` (`TimeAdded`),
  790. KEY `Year` (`Year`),
  791. KEY `TimeFilled` (`TimeFilled`),
  792. KEY `LastVote` (`LastVote`)
  793. ) ENGINE=InnoDB CHARSET=utf8mb4;
  794. CREATE TABLE `sphinx_requests_delta` (
  795. `ID` int(10) unsigned NOT NULL,
  796. `UserID` int(10) unsigned NOT NULL DEFAULT '0',
  797. `TimeAdded` int(12) unsigned DEFAULT NULL,
  798. `LastVote` int(12) unsigned DEFAULT NULL,
  799. `CategoryID` tinyint(4) DEFAULT NULL,
  800. `Title` varchar(255) DEFAULT NULL,
  801. `TitleRJ` varchar(255) DEFAULT NULL,
  802. `TitleJP` varchar(255) DEFAULT NULL,
  803. `TagList` varchar(728) NOT NULL DEFAULT '',
  804. `ArtistList` varchar(2048) DEFAULT NULL,
  805. `CatalogueNumber` varchar(50) DEFAULT NULL,
  806. `DLSiteID` varchar(50) DEFAULT NULL,
  807. `FillerID` int(10) unsigned NOT NULL DEFAULT '0',
  808. `TorrentID` int(10) unsigned NOT NULL DEFAULT '0',
  809. `TimeFilled` int(12) unsigned DEFAULT NULL,
  810. `Visible` binary(1) NOT NULL DEFAULT '1',
  811. `Bounty` bigint(20) unsigned NOT NULL DEFAULT '0',
  812. `Votes` int(10) unsigned NOT NULL DEFAULT '0',
  813. PRIMARY KEY (`ID`),
  814. KEY `Userid` (`UserID`),
  815. KEY `Name` (`Title`),
  816. KEY `Filled` (`TorrentID`),
  817. KEY `FillerID` (`FillerID`),
  818. KEY `TimeAdded` (`TimeAdded`),
  819. KEY `TimeFilled` (`TimeFilled`),
  820. KEY `LastVote` (`LastVote`)
  821. ) ENGINE=InnoDB CHARSET=utf8mb4;
  822. CREATE TABLE `sphinx_t` (
  823. `id` int(11) NOT NULL,
  824. `gid` int(11) NOT NULL,
  825. `uid` int(11) NOT NULL,
  826. `size` bigint(20) NOT NULL,
  827. `snatched` int(11) NOT NULL,
  828. `seeders` int(11) NOT NULL,
  829. `leechers` int(11) NOT NULL,
  830. `time` int(11) NOT NULL,
  831. `freetorrent` tinyint(4) NOT NULL,
  832. `media` varchar(15) NOT NULL,
  833. `container` varchar(15) NOT NULL,
  834. `resolution` varchar(15) NOT NULL,
  835. `codec` varchar(15) NOT NULL,
  836. `audioformat` varchar(15) NOT NULL,
  837. `subbing` varchar(15) NOT NULL,
  838. `language` varchar(15) NOT NULL,
  839. `filelist` mediumtext,
  840. `description` text,
  841. `subber` varchar(30) NOT NULL,
  842. `censored` tinyint(1) NOT NULL,
  843. PRIMARY KEY (`id`),
  844. KEY `gid` (`gid`)
  845. ) ENGINE=InnoDB CHARSET=utf8mb4;
  846. CREATE TABLE `sphinx_tg` (
  847. `id` int(11) NOT NULL,
  848. `name` varchar(300) DEFAULT NULL,
  849. `namerj` varchar(300) DEFAULT NULL,
  850. `namejp` varchar(500) DEFAULT NULL,
  851. `tags` varchar(500) DEFAULT NULL,
  852. `year` smallint(6) DEFAULT NULL,
  853. `cnumber` varchar(80) DEFAULT NULL,
  854. `studio` varchar(300) DEFAULT NULL,
  855. `series` varchar(300) DEFAULT NULL,
  856. `catid` smallint(6) DEFAULT NULL,
  857. `dlsid` varchar(15) NOT NULL,
  858. PRIMARY KEY (`id`)
  859. ) ENGINE=InnoDB CHARSET=utf8mb4;
  860. CREATE TABLE `staff_answers` (
  861. `QuestionID` int(10) NOT NULL,
  862. `UserID` int(10) NOT NULL,
  863. `Answer` mediumtext,
  864. `Date` datetime,
  865. PRIMARY KEY (`QuestionID`,`UserID`),
  866. KEY `UserID` (`UserID`)
  867. ) ENGINE=InnoDB CHARSET=utf8mb4;
  868. CREATE TABLE `staff_blog` (
  869. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  870. `UserID` int(10) unsigned NOT NULL,
  871. `Title` varchar(255) NOT NULL,
  872. `Body` text,
  873. `Time` datetime,
  874. PRIMARY KEY (`ID`),
  875. KEY `UserID` (`UserID`),
  876. KEY `Time` (`Time`)
  877. ) ENGINE=InnoDB CHARSET=utf8mb4;
  878. CREATE TABLE `staff_blog_visits` (
  879. `UserID` int(10) unsigned NOT NULL,
  880. `Time` datetime,
  881. UNIQUE KEY `UserID` (`UserID`),
  882. CONSTRAINT `staff_blog_visits_ibfk_1` FOREIGN KEY (`UserID`) REFERENCES `users_main` (`ID`) ON DELETE CASCADE
  883. ) ENGINE=InnoDB CHARSET=utf8mb4;
  884. CREATE TABLE `staff_ignored_questions` (
  885. `QuestionID` int(10) NOT NULL,
  886. `UserID` int(10) NOT NULL,
  887. PRIMARY KEY (`QuestionID`,`UserID`)
  888. ) ENGINE=InnoDB CHARSET=utf8mb4;
  889. CREATE TABLE `staff_pm_conversations` (
  890. `ID` int(11) NOT NULL AUTO_INCREMENT,
  891. `Subject` text,
  892. `UserID` int(11) DEFAULT NULL,
  893. `Status` enum('Open','Unanswered','Resolved') DEFAULT NULL,
  894. `Level` int(11) DEFAULT NULL,
  895. `AssignedToUser` int(11) DEFAULT NULL,
  896. `Date` datetime DEFAULT NULL,
  897. `Unread` tinyint(1) DEFAULT NULL,
  898. `ResolverID` int(11) DEFAULT NULL,
  899. PRIMARY KEY (`ID`),
  900. KEY `StatusAssigned` (`Status`,`AssignedToUser`),
  901. KEY `StatusLevel` (`Status`,`Level`)
  902. ) ENGINE=InnoDB CHARSET=utf8mb4;
  903. CREATE TABLE `staff_pm_messages` (
  904. `ID` int(11) NOT NULL AUTO_INCREMENT,
  905. `UserID` int(11) DEFAULT NULL,
  906. `SentDate` datetime DEFAULT NULL,
  907. `Message` text,
  908. `ConvID` int(11) DEFAULT NULL,
  909. PRIMARY KEY (`ID`)
  910. ) ENGINE=InnoDB CHARSET=utf8mb4;
  911. CREATE TABLE `staff_pm_responses` (
  912. `ID` int(11) NOT NULL AUTO_INCREMENT,
  913. `Message` text,
  914. `Name` text,
  915. PRIMARY KEY (`ID`)
  916. ) ENGINE=InnoDB CHARSET=utf8mb4;
  917. CREATE TABLE `styles_backup` (
  918. `UserID` int(10) NOT NULL DEFAULT '0',
  919. `StyleID` int(10) DEFAULT NULL,
  920. `StyleURL` varchar(255) DEFAULT NULL,
  921. PRIMARY KEY (`UserID`),
  922. KEY `StyleURL` (`StyleURL`)
  923. ) ENGINE=InnoDB CHARSET=utf8mb4;
  924. CREATE TABLE `stylesheets` (
  925. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  926. `Name` varchar(255) NOT NULL,
  927. `Description` varchar(255) NOT NULL,
  928. `Default` enum('0','1') NOT NULL DEFAULT '0',
  929. `Additions` text,
  930. `Color` varchar(7),
  931. PRIMARY KEY (`ID`)
  932. ) ENGINE=InnoDB CHARSET=utf8mb4;
  933. CREATE TABLE `tag_aliases` (
  934. `ID` int(10) NOT NULL AUTO_INCREMENT,
  935. `BadTag` varchar(255) DEFAULT NULL,
  936. `AliasTag` varchar(255) DEFAULT NULL,
  937. PRIMARY KEY (`ID`),
  938. KEY `BadTag` (`BadTag`),
  939. KEY `AliasTag` (`AliasTag`)
  940. ) ENGINE=InnoDB CHARSET=utf8mb4;
  941. CREATE TABLE `tags` (
  942. `ID` int(10) NOT NULL AUTO_INCREMENT,
  943. `Name` varchar(100) DEFAULT NULL,
  944. `TagType` enum('genre','other') NOT NULL DEFAULT 'other',
  945. `Uses` int(12) NOT NULL DEFAULT '1',
  946. `UserID` int(10) DEFAULT NULL,
  947. PRIMARY KEY (`ID`),
  948. UNIQUE KEY `Name_2` (`Name`),
  949. KEY `TagType` (`TagType`),
  950. KEY `Uses` (`Uses`),
  951. KEY `UserID` (`UserID`)
  952. ) ENGINE=InnoDB CHARSET=utf8mb4;
  953. CREATE TABLE `top10_history` (
  954. `ID` int(10) NOT NULL AUTO_INCREMENT,
  955. `Date` datetime,
  956. `Type` enum('Daily','Weekly') DEFAULT NULL,
  957. PRIMARY KEY (`ID`)
  958. ) ENGINE=InnoDB CHARSET=utf8mb4;
  959. CREATE TABLE `top10_history_torrents` (
  960. `HistoryID` int(10) NOT NULL DEFAULT '0',
  961. `Rank` tinyint(2) NOT NULL DEFAULT '0',
  962. `TorrentID` int(10) NOT NULL DEFAULT '0',
  963. `TitleString` varchar(150) NOT NULL DEFAULT '',
  964. `TagString` varchar(100) NOT NULL DEFAULT ''
  965. ) ENGINE=InnoDB CHARSET=utf8mb4;
  966. CREATE TABLE `top_snatchers` (
  967. `UserID` int(10) unsigned NOT NULL,
  968. PRIMARY KEY (`UserID`)
  969. ) ENGINE=InnoDB CHARSET=utf8mb4;
  970. CREATE TABLE `torrents` (
  971. `ID` int(10) NOT NULL AUTO_INCREMENT,
  972. `GroupID` int(10) NOT NULL,
  973. `UserID` int(10) DEFAULT NULL,
  974. `Media` varchar(20) DEFAULT NULL,
  975. `Container` varchar(20) DEFAULT NULL,
  976. `Codec` varchar(20) DEFAULT NULL,
  977. `Resolution` varchar(10) DEFAULT NULL,
  978. `AudioFormat` varchar(10) DEFAULT NULL,
  979. `Subbing` varchar(10) DEFAULT NULL,
  980. `Language` varchar(20) DEFAULT NULL,
  981. `Censored` tinyint(1) NOT NULL DEFAULT '1',
  982. `Anonymous` tinyint(1) NOT NULL DEFAULT '0',
  983. `info_hash` blob NOT NULL,
  984. `FileCount` int(6) NOT NULL,
  985. `FileList` mediumtext,
  986. `FilePath` varchar(255) NOT NULL DEFAULT '',
  987. `Size` bigint(12) NOT NULL,
  988. `Leechers` int(6) NOT NULL DEFAULT '0',
  989. `Seeders` int(6) NOT NULL DEFAULT '0',
  990. `last_action` datetime,
  991. `FreeTorrent` enum('0','1','2') NOT NULL DEFAULT '0',
  992. `FreeLeechType` enum('0','1','2','3','4') NOT NULL DEFAULT '0',
  993. `Time` datetime,
  994. `Description` text,
  995. `MediaInfo` text,
  996. `Snatched` int(10) unsigned NOT NULL DEFAULT '0',
  997. `balance` bigint(20) NOT NULL DEFAULT '0',
  998. `LastReseedRequest` datetime,
  999. `Subber` varchar(300) NOT NULL DEFAULT '',
  1000. `Archive` varchar(3) NOT NULL DEFAULT '',
  1001. PRIMARY KEY (`ID`),
  1002. UNIQUE KEY `InfoHash` (`info_hash`(40)),
  1003. KEY `GroupID` (`GroupID`),
  1004. KEY `UserID` (`UserID`),
  1005. KEY `Media` (`Media`),
  1006. KEY `Container` (`Container`),
  1007. KEY `Codec` (`Codec`),
  1008. KEY `Resolution` (`Resolution`),
  1009. KEY `AudioFormat` (`AudioFormat`),
  1010. KEY `Subbing` (`Subbing`),
  1011. KEY `Language` (`Language`),
  1012. KEY `FileCount` (`FileCount`),
  1013. KEY `Size` (`Size`),
  1014. KEY `Seeders` (`Seeders`),
  1015. KEY `Leechers` (`Leechers`),
  1016. KEY `last_action` (`last_action`),
  1017. KEY `Time` (`Time`),
  1018. KEY `FreeTorrent` (`FreeTorrent`)
  1019. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1020. CREATE TABLE `torrents_artists` (
  1021. `GroupID` int(10) NOT NULL,
  1022. `ArtistID` int(10) NOT NULL,
  1023. `UserID` int(10) unsigned NOT NULL DEFAULT '0',
  1024. PRIMARY KEY (`GroupID`,`ArtistID`),
  1025. KEY `ArtistID` (`ArtistID`),
  1026. KEY `GroupID` (`GroupID`),
  1027. KEY `UserID` (`UserID`)
  1028. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1029. CREATE TABLE `torrents_bad_files` (
  1030. `TorrentID` int(11) NOT NULL DEFAULT '0',
  1031. `UserID` int(11) NOT NULL DEFAULT '0',
  1032. `TimeAdded` datetime
  1033. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1034. CREATE TABLE `torrents_bad_folders` (
  1035. `TorrentID` int(11) NOT NULL,
  1036. `UserID` int(11) NOT NULL,
  1037. `TimeAdded` datetime,
  1038. PRIMARY KEY (`TorrentID`)
  1039. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1040. CREATE TABLE `torrents_bad_tags` (
  1041. `TorrentID` int(10) NOT NULL DEFAULT '0',
  1042. `UserID` int(10) NOT NULL DEFAULT '0',
  1043. `TimeAdded` datetime,
  1044. KEY `TimeAdded` (`TimeAdded`)
  1045. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1046. CREATE TABLE `torrents_group` (
  1047. `ID` int(10) NOT NULL AUTO_INCREMENT,
  1048. `CategoryID` int(10) DEFAULT NULL,
  1049. `Name` varchar(300) DEFAULT NULL,
  1050. `NameRJ` varchar(300) DEFAULT NULL,
  1051. `NameJP` varchar(300) DEFAULT NULL,
  1052. `Year` int(4) DEFAULT NULL,
  1053. `Studio` varchar(80) NOT NULL DEFAULT '',
  1054. `Series` varchar(80) NOT NULL DEFAULT '',
  1055. `CatalogueNumber` varchar(80) NOT NULL DEFAULT '',
  1056. `Pages` smallint(5) unsigned DEFAULT NULL,
  1057. `TagList` varchar(500) NOT NULL,
  1058. `Time` datetime,
  1059. `RevisionID` int(12) DEFAULT NULL,
  1060. `WikiBody` text,
  1061. `WikiImage` varchar(255) NOT NULL,
  1062. `DLsiteID` varchar(20) NOT NULL DEFAULT '',
  1063. PRIMARY KEY (`ID`),
  1064. KEY `CategoryID` (`CategoryID`),
  1065. KEY `Name` (`Name`(255)),
  1066. KEY `Year` (`Year`),
  1067. KEY `Time` (`Time`),
  1068. KEY `RevisionID` (`RevisionID`)
  1069. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1070. CREATE TABLE `torrents_logs_new` (
  1071. `LogID` int(10) NOT NULL AUTO_INCREMENT,
  1072. `TorrentID` int(10) NOT NULL DEFAULT '0',
  1073. `Log` mediumtext,
  1074. `Details` mediumtext,
  1075. `Score` int(3) NOT NULL,
  1076. `Revision` int(3) NOT NULL,
  1077. `Adjusted` enum('1','0') NOT NULL DEFAULT '0',
  1078. `AdjustedBy` int(10) NOT NULL DEFAULT '0',
  1079. `NotEnglish` enum('1','0') NOT NULL DEFAULT '0',
  1080. `AdjustmentReason` text,
  1081. PRIMARY KEY (`LogID`),
  1082. KEY `TorrentID` (`TorrentID`)
  1083. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1084. CREATE TABLE `torrents_peerlists` (
  1085. `TorrentID` int(11) NOT NULL,
  1086. `GroupID` int(11) DEFAULT NULL,
  1087. `Seeders` int(11) DEFAULT NULL,
  1088. `Leechers` int(11) DEFAULT NULL,
  1089. `Snatches` int(11) DEFAULT NULL,
  1090. PRIMARY KEY (`TorrentID`),
  1091. KEY `GroupID` (`GroupID`),
  1092. KEY `Stats` (`TorrentID`,`Seeders`,`Leechers`,`Snatches`)
  1093. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
  1094. CREATE TABLE `torrents_peerlists_compare` (
  1095. `TorrentID` int(11) NOT NULL,
  1096. `GroupID` int(11) DEFAULT NULL,
  1097. `Seeders` int(11) DEFAULT NULL,
  1098. `Leechers` int(11) DEFAULT NULL,
  1099. `Snatches` int(11) DEFAULT NULL,
  1100. PRIMARY KEY (`TorrentID`),
  1101. KEY `GroupID` (`GroupID`),
  1102. KEY `Stats` (`TorrentID`,`Seeders`,`Leechers`,`Snatches`)
  1103. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
  1104. CREATE TABLE `torrents_recommended` (
  1105. `GroupID` int(10) NOT NULL,
  1106. `UserID` int(10) NOT NULL,
  1107. `Time` datetime,
  1108. PRIMARY KEY (`GroupID`),
  1109. KEY `Time` (`Time`)
  1110. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1111. CREATE TABLE `torrents_screenshots` (
  1112. `ID` int(10) NOT NULL AUTO_INCREMENT,
  1113. `GroupID` int(10) NOT NULL,
  1114. `UserID` int(10) NOT NULL,
  1115. `Time` datetime,
  1116. `Image` varchar(255) NOT NULL,
  1117. PRIMARY KEY (`ID`,`GroupID`,`Image`)
  1118. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1119. CREATE TABLE `torrents_tags` (
  1120. `TagID` int(10) NOT NULL DEFAULT '0',
  1121. `GroupID` int(10) NOT NULL DEFAULT '0',
  1122. `UserID` int(10) DEFAULT NULL,
  1123. PRIMARY KEY (`TagID`,`GroupID`),
  1124. KEY `TagID` (`TagID`),
  1125. KEY `GroupID` (`GroupID`),
  1126. KEY `UserID` (`UserID`)
  1127. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1128. CREATE TABLE `u2f` (
  1129. `UserID` int(10) NOT NULL,
  1130. `KeyHandle` varchar(255) NOT NULL,
  1131. `PublicKey` varchar(255) NOT NULL,
  1132. `Certificate` text,
  1133. `Counter` int(10) NOT NULL DEFAULT '-1',
  1134. `Valid` enum('0','1') NOT NULL DEFAULT '1',
  1135. PRIMARY KEY (`UserID`,`KeyHandle`)
  1136. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1137. CREATE TABLE `user_questions` (
  1138. `ID` int(10) NOT NULL AUTO_INCREMENT,
  1139. `Question` mediumtext,
  1140. `UserID` int(10) NOT NULL,
  1141. `Date` datetime,
  1142. PRIMARY KEY (`ID`),
  1143. KEY `Date` (`Date`)
  1144. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1145. CREATE TABLE `users_badges` (
  1146. `UserID` int(10) NOT NULL,
  1147. `BadgeID` int(10) NOT NULL,
  1148. `Displayed` tinyint(1) DEFAULT '0',
  1149. PRIMARY KEY (`UserID`,`BadgeID`)
  1150. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1151. CREATE TABLE `users_collage_subs` (
  1152. `UserID` int(10) NOT NULL,
  1153. `CollageID` int(10) NOT NULL,
  1154. `LastVisit` datetime DEFAULT NULL,
  1155. PRIMARY KEY (`UserID`,`CollageID`),
  1156. KEY `CollageID` (`CollageID`)
  1157. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1158. CREATE TABLE `users_comments_last_read` (
  1159. `UserID` int(10) NOT NULL,
  1160. `Page` enum('artist','collages','requests','torrents') NOT NULL,
  1161. `PageID` int(10) NOT NULL,
  1162. `PostID` int(10) NOT NULL,
  1163. PRIMARY KEY (`UserID`,`Page`,`PageID`),
  1164. KEY `Page` (`Page`,`PageID`)
  1165. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1166. CREATE TABLE `users_donor_ranks` (
  1167. `UserID` int(10) NOT NULL DEFAULT '0',
  1168. `Rank` tinyint(2) NOT NULL DEFAULT '0',
  1169. `DonationTime` datetime DEFAULT NULL,
  1170. `Hidden` tinyint(2) NOT NULL DEFAULT '0',
  1171. `TotalRank` int(10) NOT NULL DEFAULT '0',
  1172. `SpecialRank` tinyint(2) DEFAULT '0',
  1173. `InvitesRecievedRank` tinyint(4) DEFAULT '0',
  1174. `RankExpirationTime` datetime DEFAULT NULL,
  1175. PRIMARY KEY (`UserID`),
  1176. KEY `DonationTime` (`DonationTime`),
  1177. KEY `SpecialRank` (`SpecialRank`),
  1178. KEY `Rank` (`Rank`),
  1179. KEY `TotalRank` (`TotalRank`)
  1180. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1181. CREATE TABLE `users_downloads` (
  1182. `UserID` int(10) NOT NULL,
  1183. `TorrentID` int(1) NOT NULL,
  1184. `Time` datetime,
  1185. PRIMARY KEY (`UserID`,`TorrentID`,`Time`),
  1186. KEY `TorrentID` (`TorrentID`),
  1187. KEY `UserID` (`UserID`)
  1188. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1189. CREATE TABLE `users_dupes` (
  1190. `GroupID` int(10) unsigned NOT NULL,
  1191. `UserID` int(10) unsigned NOT NULL,
  1192. UNIQUE KEY `UserID` (`UserID`),
  1193. KEY `GroupID` (`GroupID`),
  1194. CONSTRAINT `users_dupes_ibfk_1` FOREIGN KEY (`UserID`) REFERENCES `users_main` (`ID`) ON DELETE CASCADE,
  1195. CONSTRAINT `users_dupes_ibfk_2` FOREIGN KEY (`GroupID`) REFERENCES `dupe_groups` (`ID`) ON DELETE CASCADE
  1196. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1197. CREATE TABLE `users_enable_recommendations` (
  1198. `ID` int(10) NOT NULL,
  1199. `Enable` tinyint(1) DEFAULT NULL,
  1200. PRIMARY KEY (`ID`),
  1201. KEY `Enable` (`Enable`)
  1202. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1203. CREATE TABLE `users_enable_requests` (
  1204. `ID` int(11) NOT NULL AUTO_INCREMENT,
  1205. `UserID` int(10) unsigned NOT NULL,
  1206. `Email` varchar(255) NOT NULL,
  1207. `IP` varchar(255) NOT NULL DEFAULT 'mIbUEUEmV93bF6C5i6cITAlcw3H7TKcaPzZZIMIZQNQ=',
  1208. `UserAgent` text,
  1209. `Timestamp` datetime,
  1210. `HandledTimestamp` datetime DEFAULT NULL,
  1211. `Token` char(32) DEFAULT NULL,
  1212. `CheckedBy` int(10) unsigned DEFAULT NULL,
  1213. `Outcome` tinyint(1) DEFAULT NULL COMMENT '1 for approved, 2 for denied, 3 for discarded',
  1214. PRIMARY KEY (`ID`),
  1215. KEY `UserId` (`UserID`),
  1216. KEY `CheckedBy` (`CheckedBy`),
  1217. CONSTRAINT `users_enable_requests_ibfk_1` FOREIGN KEY (`UserID`) REFERENCES `users_main` (`ID`),
  1218. CONSTRAINT `users_enable_requests_ibfk_2` FOREIGN KEY (`CheckedBy`) REFERENCES `users_main` (`ID`)
  1219. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1220. CREATE TABLE `users_freeleeches` (
  1221. `UserID` int(10) NOT NULL,
  1222. `TorrentID` int(10) NOT NULL,
  1223. `Time` datetime,
  1224. `Expired` tinyint(1) NOT NULL DEFAULT '0',
  1225. `Downloaded` bigint(20) NOT NULL DEFAULT '0',
  1226. `Uses` int(10) NOT NULL DEFAULT '1',
  1227. PRIMARY KEY (`UserID`,`TorrentID`),
  1228. KEY `Time` (`Time`),
  1229. KEY `Expired_Time` (`Expired`,`Time`)
  1230. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1231. CREATE TABLE `users_geodistribution` (
  1232. `Code` varchar(2) NOT NULL,
  1233. `Users` int(10) NOT NULL
  1234. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1235. CREATE TABLE `users_history_emails` (
  1236. `UserID` int(10) NOT NULL,
  1237. `Email` varchar(255) DEFAULT NULL,
  1238. `Time` datetime DEFAULT NULL,
  1239. `IP` varchar(90) DEFAULT NULL,
  1240. KEY `UserID` (`UserID`)
  1241. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1242. CREATE TABLE `users_history_ips` (
  1243. `UserID` int(10) NOT NULL,
  1244. `IP` varchar(90) NOT NULL DEFAULT '0.0.0.0',
  1245. `StartTime` datetime,
  1246. `EndTime` datetime DEFAULT NULL,
  1247. PRIMARY KEY (`UserID`,`IP`,`StartTime`),
  1248. KEY `UserID` (`UserID`),
  1249. KEY `IP` (`IP`),
  1250. KEY `StartTime` (`StartTime`),
  1251. KEY `EndTime` (`EndTime`)
  1252. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1253. CREATE TABLE `users_history_passkeys` (
  1254. `UserID` int(10) NOT NULL,
  1255. `OldPassKey` varchar(32) DEFAULT NULL,
  1256. `NewPassKey` varchar(32) DEFAULT NULL,
  1257. `ChangeTime` datetime DEFAULT NULL,
  1258. `ChangerIP` varchar(90) DEFAULT NULL
  1259. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1260. CREATE TABLE `users_history_passwords` (
  1261. `UserID` int(10) NOT NULL,
  1262. `ChangeTime` datetime DEFAULT NULL,
  1263. `ChangerIP` varchar(90) DEFAULT NULL,
  1264. KEY `User_Time` (`UserID`,`ChangeTime`)
  1265. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1266. CREATE TABLE `users_info` (
  1267. `UserID` int(10) unsigned NOT NULL,
  1268. `StyleID` int(10) unsigned NOT NULL,
  1269. `StyleURL` varchar(255) DEFAULT NULL,
  1270. `Info` text,
  1271. `Avatar` varchar(255),
  1272. `AdminComment` text,
  1273. `SiteOptions` text,
  1274. `ViewAvatars` enum('0','1') NOT NULL DEFAULT '1',
  1275. `Donor` enum('0','1') NOT NULL DEFAULT '0',
  1276. `Artist` enum('0','1') NOT NULL DEFAULT '0',
  1277. `Warned` datetime,
  1278. `SupportFor` varchar(255),
  1279. `TorrentGrouping` enum('0','1','2') NOT NULL COMMENT '0=Open,1=Closed,2=Off',
  1280. `ShowTags` enum('0','1') NOT NULL DEFAULT '1',
  1281. `NotifyOnQuote` enum('0','1','2') NOT NULL DEFAULT '0',
  1282. `AuthKey` varchar(32) NOT NULL DEFAULT '',
  1283. `ResetKey` varchar(32) NOT NULL DEFAULT '',
  1284. `ResetExpires` datetime,
  1285. `JoinDate` datetime,
  1286. `Inviter` int(10) DEFAULT NULL,
  1287. `BitcoinAddress` varchar(34) DEFAULT NULL,
  1288. `WarnedTimes` int(2) NOT NULL DEFAULT '0',
  1289. `DisableAvatar` enum('0','1') NOT NULL DEFAULT '0',
  1290. `DisableInvites` enum('0','1') NOT NULL DEFAULT '0',
  1291. `DisablePosting` enum('0','1') NOT NULL DEFAULT '0',
  1292. `DisableForums` enum('0','1') NOT NULL DEFAULT '0',
  1293. `DisableIRC` enum('0','1') DEFAULT '0',
  1294. `DisableTagging` enum('0','1') NOT NULL DEFAULT '0',
  1295. `DisableUpload` enum('0','1') NOT NULL DEFAULT '0',
  1296. `DisableWiki` enum('0','1') NOT NULL DEFAULT '0',
  1297. `DisablePM` enum('0','1') NOT NULL DEFAULT '0',
  1298. `DisablePoints` enum('0','1') NOT NULL DEFAULT '0',
  1299. `DisablePromotion` enum('0','1') NOT NULL DEFAULT '0',
  1300. `DisableRequests` enum('0','1') NOT NULL DEFAULT '0',
  1301. `RatioWatchEnds` datetime,
  1302. `RatioWatchDownload` bigint(20) unsigned NOT NULL DEFAULT '0',
  1303. `RatioWatchTimes` tinyint(1) unsigned NOT NULL DEFAULT '0',
  1304. `BanDate` datetime,
  1305. `BanReason` enum('0','1','2','3','4') NOT NULL DEFAULT '0',
  1306. `CatchupTime` datetime DEFAULT NULL,
  1307. `LastReadNews` int(10) NOT NULL DEFAULT '0',
  1308. `HideCountryChanges` enum('0','1') NOT NULL DEFAULT '0',
  1309. `RestrictedForums` varchar(150) NOT NULL DEFAULT '',
  1310. `PermittedForums` varchar(150) NOT NULL DEFAULT '',
  1311. `UnseededAlerts` enum('0','1') NOT NULL DEFAULT '0',
  1312. `LastReadBlog` int(10) NOT NULL DEFAULT '0',
  1313. `InfoTitle` varchar(255) NOT NULL DEFAULT '',
  1314. UNIQUE KEY `UserID` (`UserID`),
  1315. KEY `SupportFor` (`SupportFor`),
  1316. KEY `DisableInvites` (`DisableInvites`),
  1317. KEY `Donor` (`Donor`),
  1318. KEY `Warned` (`Warned`),
  1319. KEY `JoinDate` (`JoinDate`),
  1320. KEY `Inviter` (`Inviter`),
  1321. KEY `RatioWatchEnds` (`RatioWatchEnds`),
  1322. KEY `RatioWatchDownload` (`RatioWatchDownload`),
  1323. KEY `BitcoinAddress` (`BitcoinAddress`(4)),
  1324. KEY `AuthKey` (`AuthKey`),
  1325. KEY `ResetKey` (`ResetKey`)
  1326. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1327. CREATE TABLE `users_levels` (
  1328. `UserID` int(10) unsigned NOT NULL,
  1329. `PermissionID` int(10) unsigned NOT NULL,
  1330. PRIMARY KEY (`UserID`,`PermissionID`),
  1331. KEY `PermissionID` (`PermissionID`)
  1332. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1333. CREATE TABLE `users_main` (
  1334. `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1335. `Username` varchar(20) NOT NULL,
  1336. `Email` varchar(255) NOT NULL,
  1337. `PassHash` varchar(60) NOT NULL,
  1338. `TwoFactor` varchar(255) DEFAULT NULL,
  1339. `PublicKey` text,
  1340. `IRCKey` char(32) DEFAULT NULL,
  1341. `LastLogin` datetime,
  1342. `LastAccess` datetime,
  1343. `IP` varchar(90) NOT NULL DEFAULT '0.0.0.0',
  1344. `Class` tinyint(2) NOT NULL DEFAULT '5',
  1345. `Uploaded` bigint(20) unsigned NOT NULL DEFAULT '0',
  1346. `Downloaded` bigint(20) unsigned NOT NULL DEFAULT '0',
  1347. `Title` text,
  1348. `Enabled` enum('0','1','2') NOT NULL DEFAULT '0',
  1349. `Paranoia` text,
  1350. `Visible` enum('1','0') NOT NULL DEFAULT '1',
  1351. `Invites` int(10) unsigned NOT NULL DEFAULT '0',
  1352. `PermissionID` int(10) unsigned NOT NULL,
  1353. `CustomPermissions` text,
  1354. `can_leech` tinyint(4) NOT NULL DEFAULT '1',
  1355. `torrent_pass` char(32) NOT NULL,
  1356. `RequiredRatio` double(10,8) NOT NULL DEFAULT '0.00000000',
  1357. `RequiredRatioWork` double(10,8) NOT NULL DEFAULT '0.00000000',
  1358. `ipcc` varchar(2) NOT NULL DEFAULT '',
  1359. `FLTokens` int(10) NOT NULL DEFAULT '0',
  1360. `BonusPoints` int(10) unsigned NOT NULL DEFAULT '0',
  1361. `IRCLines` int(10) unsigned NOT NULL DEFAULT '0',
  1362. `HnR` int(10) NOT NULL DEFAULT '0',
  1363. PRIMARY KEY (`ID`),
  1364. UNIQUE KEY `Username` (`Username`),
  1365. KEY `Email` (`Email`),
  1366. KEY `PassHash` (`PassHash`),
  1367. KEY `LastAccess` (`LastAccess`),
  1368. KEY `IP` (`IP`),
  1369. KEY `Class` (`Class`),
  1370. KEY `Uploaded` (`Uploaded`),
  1371. KEY `Downloaded` (`Downloaded`),
  1372. KEY `Enabled` (`Enabled`),
  1373. KEY `Invites` (`Invites`),
  1374. KEY `torrent_pass` (`torrent_pass`),
  1375. KEY `RequiredRatio` (`RequiredRatio`),
  1376. KEY `cc_index` (`ipcc`),
  1377. KEY `PermissionID` (`PermissionID`)
  1378. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1379. CREATE TABLE `users_notifications_settings` (
  1380. `UserID` int(10) NOT NULL DEFAULT '0',
  1381. `Inbox` tinyint(1) DEFAULT '1',
  1382. `StaffPM` tinyint(1) DEFAULT '1',
  1383. `News` tinyint(1) DEFAULT '1',
  1384. `Blog` tinyint(1) DEFAULT '1',
  1385. `Torrents` tinyint(1) DEFAULT '1',
  1386. `Collages` tinyint(1) DEFAULT '1',
  1387. `Quotes` tinyint(1) DEFAULT '1',
  1388. `Subscriptions` tinyint(1) DEFAULT '1',
  1389. `SiteAlerts` tinyint(1) DEFAULT '1',
  1390. `RequestAlerts` tinyint(1) DEFAULT '1',
  1391. `CollageAlerts` tinyint(1) DEFAULT '1',
  1392. `TorrentAlerts` tinyint(1) DEFAULT '1',
  1393. `ForumAlerts` tinyint(1) DEFAULT '1',
  1394. PRIMARY KEY (`UserID`)
  1395. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1396. CREATE TABLE `users_notify_filters` (
  1397. `ID` int(12) NOT NULL AUTO_INCREMENT,
  1398. `UserID` int(10) NOT NULL,
  1399. `Label` varchar(128) NOT NULL DEFAULT '',
  1400. `Artists` mediumtext,
  1401. `RecordLabels` mediumtext,
  1402. `Users` mediumtext,
  1403. `Tags` varchar(500) NOT NULL DEFAULT '',
  1404. `NotTags` varchar(500) NOT NULL DEFAULT '',
  1405. `Categories` varchar(500) NOT NULL DEFAULT '',
  1406. `Formats` varchar(500) NOT NULL DEFAULT '',
  1407. `Encodings` varchar(500) NOT NULL DEFAULT '',
  1408. `Media` varchar(500) NOT NULL DEFAULT '',
  1409. `FromYear` int(4) NOT NULL DEFAULT '0',
  1410. `ToYear` int(4) NOT NULL DEFAULT '0',
  1411. `ExcludeVA` enum('1','0') NOT NULL DEFAULT '0',
  1412. `NewGroupsOnly` enum('1','0') NOT NULL DEFAULT '0',
  1413. `ReleaseTypes` varchar(500) NOT NULL DEFAULT '',
  1414. PRIMARY KEY (`ID`),
  1415. KEY `UserID` (`UserID`),
  1416. KEY `FromYear` (`FromYear`),
  1417. KEY `ToYear` (`ToYear`)
  1418. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1419. CREATE TABLE `users_notify_quoted` (
  1420. `UserID` int(10) NOT NULL,
  1421. `QuoterID` int(10) NOT NULL,
  1422. `Page` enum('forums','artist','collages','requests','torrents') NOT NULL,
  1423. `PageID` int(10) NOT NULL,
  1424. `PostID` int(10) NOT NULL,
  1425. `UnRead` tinyint(1) NOT NULL DEFAULT '1',
  1426. `Date` datetime,
  1427. PRIMARY KEY (`UserID`,`Page`,`PostID`)
  1428. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1429. CREATE TABLE `users_notify_torrents` (
  1430. `UserID` int(10) NOT NULL,
  1431. `FilterID` int(10) NOT NULL,
  1432. `GroupID` int(10) NOT NULL,
  1433. `TorrentID` int(10) NOT NULL,
  1434. `UnRead` tinyint(4) NOT NULL DEFAULT '1',
  1435. PRIMARY KEY (`UserID`,`TorrentID`),
  1436. KEY `TorrentID` (`TorrentID`),
  1437. KEY `UserID_Unread` (`UserID`,`UnRead`)
  1438. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1439. CREATE TABLE `users_points` (
  1440. `UserID` int(10) NOT NULL,
  1441. `GroupID` int(10) NOT NULL,
  1442. `Points` tinyint(1) NOT NULL DEFAULT '1',
  1443. PRIMARY KEY (`UserID`,`GroupID`),
  1444. KEY `UserID` (`UserID`),
  1445. KEY `GroupID` (`GroupID`)
  1446. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1447. CREATE TABLE `users_points_requests` (
  1448. `UserID` int(10) NOT NULL,
  1449. `RequestID` int(10) NOT NULL,
  1450. `Points` tinyint(1) NOT NULL DEFAULT '1',
  1451. PRIMARY KEY (`RequestID`),
  1452. KEY `UserID` (`UserID`),
  1453. KEY `RequestID` (`RequestID`)
  1454. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1455. CREATE TABLE `users_seedtime` (
  1456. `UserID` int(10) unsigned NOT NULL,
  1457. `TorrentID` int(10) unsigned NOT NULL,
  1458. `SeedTime` int(10) unsigned NOT NULL DEFAULT '0',
  1459. `Uploaded` bigint(20) NOT NULL DEFAULT '0',
  1460. `LastUpdate` datetime NOT NULL,
  1461. `Downloaded` int(10) unsigned NOT NULL DEFAULT '0',
  1462. PRIMARY KEY (`UserID`,`TorrentID`)
  1463. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  1464. CREATE TABLE `users_sessions` (
  1465. `UserID` int(10) NOT NULL,
  1466. `SessionID` char(64) NOT NULL,
  1467. `KeepLogged` enum('0','1') NOT NULL DEFAULT '0',
  1468. `Browser` varchar(40) DEFAULT NULL,
  1469. `OperatingSystem` varchar(13) DEFAULT NULL,
  1470. `IP` varchar(90) NOT NULL,
  1471. `LastUpdate` datetime,
  1472. `Active` tinyint(4) NOT NULL DEFAULT '1',
  1473. `FullUA` text,
  1474. PRIMARY KEY (`UserID`,`SessionID`),
  1475. KEY `UserID` (`UserID`),
  1476. KEY `LastUpdate` (`LastUpdate`),
  1477. KEY `Active` (`Active`),
  1478. KEY `ActiveAgeKeep` (`Active`,`LastUpdate`,`KeepLogged`)
  1479. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1480. CREATE TABLE `users_subscriptions` (
  1481. `UserID` int(10) NOT NULL,
  1482. `TopicID` int(10) NOT NULL,
  1483. PRIMARY KEY (`UserID`,`TopicID`)
  1484. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1485. CREATE TABLE `users_subscriptions_comments` (
  1486. `UserID` int(10) NOT NULL,
  1487. `Page` enum('artist','collages','requests','torrents') NOT NULL,
  1488. `PageID` int(10) NOT NULL,
  1489. PRIMARY KEY (`UserID`,`Page`,`PageID`)
  1490. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1491. CREATE TABLE `users_torrent_history` (
  1492. `UserID` int(10) unsigned NOT NULL,
  1493. `NumTorrents` int(6) unsigned NOT NULL,
  1494. `Date` int(8) unsigned NOT NULL,
  1495. `Time` int(11) unsigned NOT NULL DEFAULT '0',
  1496. `LastTime` int(11) unsigned NOT NULL DEFAULT '0',
  1497. `Finished` enum('1','0') NOT NULL DEFAULT '1',
  1498. `Weight` bigint(20) unsigned NOT NULL DEFAULT '0',
  1499. PRIMARY KEY (`UserID`,`NumTorrents`,`Date`),
  1500. KEY `Finished` (`Finished`),
  1501. KEY `Date` (`Date`)
  1502. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1503. CREATE TABLE `users_torrent_history_snatch` (
  1504. `UserID` int(10) unsigned NOT NULL,
  1505. `NumSnatches` int(10) unsigned NOT NULL DEFAULT '0',
  1506. PRIMARY KEY (`UserID`),
  1507. KEY `NumSnatches` (`NumSnatches`)
  1508. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1509. CREATE TABLE `users_torrent_history_temp` (
  1510. `UserID` int(10) unsigned NOT NULL,
  1511. `NumTorrents` int(6) unsigned NOT NULL DEFAULT '0',
  1512. `SumTime` bigint(20) unsigned NOT NULL DEFAULT '0',
  1513. `SeedingAvg` int(6) unsigned NOT NULL DEFAULT '0',
  1514. PRIMARY KEY (`UserID`)
  1515. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1516. CREATE TABLE `users_warnings_forums` (
  1517. `UserID` int(10) unsigned NOT NULL,
  1518. `Comment` text,
  1519. PRIMARY KEY (`UserID`)
  1520. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1521. CREATE TABLE `wiki_aliases` (
  1522. `Alias` varchar(50) NOT NULL,
  1523. `UserID` int(10) NOT NULL,
  1524. `ArticleID` int(10) DEFAULT NULL,
  1525. PRIMARY KEY (`Alias`)
  1526. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1527. CREATE TABLE `wiki_articles` (
  1528. `ID` int(10) NOT NULL AUTO_INCREMENT,
  1529. `Revision` int(10) NOT NULL DEFAULT '1',
  1530. `Title` varchar(100) DEFAULT NULL,
  1531. `Body` mediumtext,
  1532. `MinClassRead` int(4) DEFAULT NULL,
  1533. `MinClassEdit` int(4) DEFAULT NULL,
  1534. `Date` datetime DEFAULT NULL,
  1535. `Author` int(10) DEFAULT NULL,
  1536. PRIMARY KEY (`ID`)
  1537. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1538. CREATE TABLE `wiki_artists` (
  1539. `RevisionID` int(12) NOT NULL AUTO_INCREMENT,
  1540. `PageID` int(10) NOT NULL DEFAULT '0',
  1541. `Body` text,
  1542. `UserID` int(10) NOT NULL DEFAULT '0',
  1543. `Summary` varchar(100) DEFAULT NULL,
  1544. `Time` datetime,
  1545. `Image` varchar(255) DEFAULT NULL,
  1546. PRIMARY KEY (`RevisionID`),
  1547. KEY `PageID` (`PageID`),
  1548. KEY `UserID` (`UserID`),
  1549. KEY `Time` (`Time`)
  1550. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1551. CREATE TABLE `wiki_revisions` (
  1552. `ID` int(10) NOT NULL,
  1553. `Revision` int(10) NOT NULL,
  1554. `Title` varchar(100) DEFAULT NULL,
  1555. `Body` mediumtext,
  1556. `Date` datetime DEFAULT NULL,
  1557. `Author` int(10) DEFAULT NULL,
  1558. KEY `ID_Revision` (`ID`,`Revision`)
  1559. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1560. CREATE TABLE `wiki_torrents` (
  1561. `RevisionID` int(12) NOT NULL AUTO_INCREMENT,
  1562. `PageID` int(10) NOT NULL DEFAULT '0',
  1563. `Body` text,
  1564. `UserID` int(10) NOT NULL DEFAULT '0',
  1565. `Summary` varchar(100) DEFAULT NULL,
  1566. `Time` datetime,
  1567. `Image` varchar(255) DEFAULT NULL,
  1568. PRIMARY KEY (`RevisionID`),
  1569. KEY `PageID` (`PageID`),
  1570. KEY `UserID` (`UserID`),
  1571. KEY `Time` (`Time`)
  1572. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1573. CREATE TABLE `xbt_client_whitelist` (
  1574. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1575. `peer_id` varchar(20) DEFAULT NULL,
  1576. `vstring` varchar(200) DEFAULT '',
  1577. PRIMARY KEY (`id`),
  1578. UNIQUE KEY `peer_id` (`peer_id`)
  1579. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1580. CREATE TABLE `xbt_files_users` (
  1581. `uid` int(11) NOT NULL,
  1582. `active` tinyint(1) NOT NULL,
  1583. `announced` int(11) NOT NULL,
  1584. `completed` tinyint(1) NOT NULL DEFAULT '0',
  1585. `downloaded` bigint(20) NOT NULL,
  1586. `remaining` bigint(20) NOT NULL,
  1587. `uploaded` bigint(20) NOT NULL,
  1588. `upspeed` int(10) unsigned NOT NULL,
  1589. `downspeed` int(10) unsigned NOT NULL,
  1590. `corrupt` bigint(20) NOT NULL DEFAULT '0',
  1591. `timespent` int(10) unsigned NOT NULL,
  1592. `useragent` varchar(51) NOT NULL,
  1593. `connectable` tinyint(4) NOT NULL DEFAULT '1',
  1594. `peer_id` binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  1595. `fid` int(11) NOT NULL,
  1596. `mtime` int(11) NOT NULL,
  1597. `ip` varchar(15) NOT NULL DEFAULT '',
  1598. `seeder` tinyint(1) NOT NULL DEFAULT '0',
  1599. PRIMARY KEY (`peer_id`,`fid`,`uid`),
  1600. KEY `remaining_idx` (`remaining`),
  1601. KEY `fid_idx` (`fid`),
  1602. KEY `mtime_idx` (`mtime`),
  1603. KEY `uid_active` (`uid`,`active`)
  1604. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1605. CREATE TABLE `xbt_snatched` (
  1606. `uid` int(11) NOT NULL DEFAULT '0',
  1607. `tstamp` int(11) NOT NULL,
  1608. `fid` int(11) NOT NULL,
  1609. `IP` varchar(15) NOT NULL,
  1610. `seedtime` int(11) NOT NULL DEFAULT '0',
  1611. KEY `fid` (`fid`),
  1612. KEY `tstamp` (`tstamp`),
  1613. KEY `uid_tstamp` (`uid`,`tstamp`)
  1614. ) ENGINE=InnoDB CHARSET=utf8mb4;
  1615. SET FOREIGN_KEY_CHECKS = 1;
  1616. INSERT INTO permissions (ID, Level, Name, `Values`, DisplayStaff) VALUES (15, 1000, 'Sysop', 'a:100:{s:10:\"site_leech\";i:1;s:11:\"site_upload\";i:1;s:9:\"site_vote\";i:1;s:20:\"site_submit_requests\";i:1;s:20:\"site_advanced_search\";i:1;s:10:\"site_top10\";i:1;s:19:\"site_advanced_top10\";i:1;s:16:\"site_album_votes\";i:1;s:20:\"site_torrents_notify\";i:1;s:20:\"site_collages_create\";i:1;s:20:\"site_collages_manage\";i:1;s:20:\"site_collages_delete\";i:1;s:23:\"site_collages_subscribe\";i:1;s:22:\"site_collages_personal\";i:1;s:28:\"site_collages_renamepersonal\";i:1;s:19:\"site_make_bookmarks\";i:1;s:14:\"site_edit_wiki\";i:1;s:22:\"site_can_invite_always\";i:1;s:27:\"site_send_unlimited_invites\";i:1;s:22:\"site_moderate_requests\";i:1;s:18:\"site_delete_artist\";i:1;s:20:\"site_moderate_forums\";i:1;s:17:\"site_admin_forums\";i:1;s:23:\"site_forums_double_post\";i:1;s:14:\"site_view_flow\";i:1;s:18:\"site_view_full_log\";i:1;s:28:\"site_view_torrent_snatchlist\";i:1;s:18:\"site_recommend_own\";i:1;s:27:\"site_manage_recommendations\";i:1;s:15:\"site_delete_tag\";i:1;s:23:\"site_disable_ip_history\";i:1;s:14:\"zip_downloader\";i:1;s:10:\"site_debug\";i:1;s:17:\"site_proxy_images\";i:1;s:16:\"site_search_many\";i:1;s:20:\"users_edit_usernames\";i:1;s:16:\"users_edit_ratio\";i:1;s:20:\"users_edit_own_ratio\";i:1;s:17:\"users_edit_titles\";i:1;s:18:\"users_edit_avatars\";i:1;s:18:\"users_edit_invites\";i:1;s:22:\"users_edit_watch_hours\";i:1;s:21:\"users_edit_reset_keys\";i:1;s:19:\"users_edit_profiles\";i:1;s:18:\"users_view_friends\";i:1;s:20:\"users_reset_own_keys\";i:1;s:19:\"users_edit_password\";i:1;s:19:\"users_promote_below\";i:1;s:16:\"users_promote_to\";i:1;s:16:\"users_give_donor\";i:1;s:10:\"users_warn\";i:1;s:19:\"users_disable_users\";i:1;s:19:\"users_disable_posts\";i:1;s:17:\"users_disable_any\";i:1;s:18:\"users_delete_users\";i:1;s:18:\"users_view_invites\";i:1;s:20:\"users_view_seedleech\";i:1;s:19:\"users_view_uploaded\";i:1;s:15:\"users_view_keys\";i:1;s:14:\"users_view_ips\";i:1;s:16:\"users_view_email\";i:1;s:18:\"users_invite_notes\";i:1;s:23:\"users_override_paranoia\";i:1;s:12:\"users_logout\";i:1;s:20:\"users_make_invisible\";i:1;s:9:\"users_mod\";i:1;s:13:\"torrents_edit\";i:1;s:15:\"torrents_delete\";i:1;s:20:\"torrents_delete_fast\";i:1;s:18:\"torrents_freeleech\";i:1;s:20:\"torrents_search_fast\";i:1;s:17:\"torrents_hide_dnu\";i:1;s:19:\"torrents_fix_ghosts\";i:1;s:17:\"admin_manage_news\";i:1;s:17:\"admin_manage_blog\";i:1;s:18:\"admin_manage_polls\";i:1;s:19:\"admin_manage_forums\";i:1;s:16:\"admin_manage_fls\";i:1;s:13:\"admin_reports\";i:1;s:26:\"admin_advanced_user_search\";i:1;s:18:\"admin_create_users\";i:1;s:15:\"admin_donor_log\";i:1;s:19:\"admin_manage_ipbans\";i:1;s:9:\"admin_dnu\";i:1;s:17:\"admin_clear_cache\";i:1;s:15:\"admin_whitelist\";i:1;s:24:\"admin_manage_permissions\";i:1;s:14:\"admin_schedule\";i:1;s:17:\"admin_login_watch\";i:1;s:17:\"admin_manage_wiki\";i:1;s:18:\"admin_update_geoip\";i:1;s:21:\"site_collages_recover\";i:1;s:19:\"torrents_add_artist\";i:1;s:13:\"edit_unknowns\";i:1;s:19:\"forums_polls_create\";i:1;s:21:\"forums_polls_moderate\";i:1;s:12:\"project_team\";i:1;s:25:\"torrents_edit_vanityhouse\";i:1;s:23:\"artist_edit_vanityhouse\";i:1;s:21:\"site_tag_aliases_read\";i:1;}', '1'), (11, 800, 'Moderator', 'a:89:{s:26:\"admin_advanced_user_search\";i:1;s:17:\"admin_clear_cache\";i:1;s:18:\"admin_create_users\";i:1;s:9:\"admin_dnu\";i:1;s:15:\"admin_donor_log\";i:1;s:17:\"admin_login_watch\";i:1;s:17:\"admin_manage_blog\";i:1;s:19:\"admin_manage_ipbans\";i:1;s:17:\"admin_manage_news\";i:1;s:18:\"admin_manage_polls\";i:1;s:17:\"admin_manage_wiki\";i:1;s:13:\"admin_reports\";i:1;s:23:\"artist_edit_vanityhouse\";i:1;s:13:\"edit_unknowns\";i:1;s:19:\"forums_polls_create\";i:1;s:21:\"forums_polls_moderate\";i:1;s:12:\"project_team\";i:1;s:17:\"site_admin_forums\";i:1;s:20:\"site_advanced_search\";i:1;s:19:\"site_advanced_top10\";i:1;s:16:\"site_album_votes\";i:1;s:22:\"site_can_invite_always\";i:1;s:20:\"site_collages_create\";i:1;s:20:\"site_collages_delete\";i:1;s:20:\"site_collages_manage\";i:1;s:22:\"site_collages_personal\";i:1;s:21:\"site_collages_recover\";i:1;s:28:\"site_collages_renamepersonal\";i:1;s:23:\"site_collages_subscribe\";i:1;s:18:\"site_delete_artist\";i:1;s:15:\"site_delete_tag\";i:1;s:23:\"site_disable_ip_history\";i:1;s:14:\"site_edit_wiki\";i:1;s:23:\"site_forums_double_post\";i:1;s:10:\"site_leech\";i:1;s:19:\"site_make_bookmarks\";i:1;s:27:\"site_manage_recommendations\";i:1;s:20:\"site_moderate_forums\";i:1;s:22:\"site_moderate_requests\";i:1;s:17:\"site_proxy_images\";i:1;s:18:\"site_recommend_own\";i:1;s:16:\"site_search_many\";i:1;s:27:\"site_send_unlimited_invites\";i:1;s:20:\"site_submit_requests\";i:1;s:21:\"site_tag_aliases_read\";i:1;s:10:\"site_top10\";i:1;s:20:\"site_torrents_notify\";i:1;s:11:\"site_upload\";i:1;s:14:\"site_view_flow\";i:1;s:18:\"site_view_full_log\";i:1;s:28:\"site_view_torrent_snatchlist\";i:1;s:9:\"site_vote\";i:1;s:19:\"torrents_add_artist\";i:1;s:15:\"torrents_delete\";i:1;s:20:\"torrents_delete_fast\";i:1;s:13:\"torrents_edit\";i:1;s:25:\"torrents_edit_vanityhouse\";i:1;s:19:\"torrents_fix_ghosts\";i:1;s:18:\"torrents_freeleech\";i:1;s:17:\"torrents_hide_dnu\";i:1;s:20:\"torrents_search_fast\";i:1;s:18:\"users_delete_users\";i:1;s:17:\"users_disable_any\";i:1;s:19:\"users_disable_posts\";i:1;s:19:\"users_disable_users\";i:1;s:18:\"users_edit_avatars\";i:1;s:18:\"users_edit_invites\";i:1;s:20:\"users_edit_own_ratio\";i:1;s:19:\"users_edit_password\";i:1;s:19:\"users_edit_profiles\";i:1;s:16:\"users_edit_ratio\";i:1;s:21:\"users_edit_reset_keys\";i:1;s:17:\"users_edit_titles\";i:1;s:16:\"users_give_donor\";i:1;s:12:\"users_logout\";i:1;s:20:\"users_make_invisible\";i:1;s:9:\"users_mod\";i:1;s:23:\"users_override_paranoia\";i:1;s:19:\"users_promote_below\";i:1;s:20:\"users_reset_own_keys\";i:1;s:10:\"users_warn\";i:1;s:16:\"users_view_email\";i:1;s:18:\"users_view_friends\";i:1;s:18:\"users_view_invites\";i:1;s:14:\"users_view_ips\";i:1;s:15:\"users_view_keys\";i:1;s:20:\"users_view_seedleech\";i:1;s:19:\"users_view_uploaded\";i:1;s:14:\"zip_downloader\";i:1;}', '1'), (2, 100, 'User', 'a:7:{s:10:\"site_leech\";i:1;s:11:\"site_upload\";i:1;s:9:\"site_vote\";i:1;s:20:\"site_advanced_search\";i:1;s:10:\"site_top10\";i:1;s:14:\"site_edit_wiki\";i:1;s:19:\"torrents_add_artist\";i:1;}', '0'), (3, 150, 'Member', 'a:10:{s:10:\"site_leech\";i:1;s:11:\"site_upload\";i:1;s:9:\"site_vote\";i:1;s:20:\"site_submit_requests\";i:1;s:20:\"site_advanced_search\";i:1;s:10:\"site_top10\";i:1;s:20:\"site_collages_manage\";i:1;s:19:\"site_make_bookmarks\";i:1;s:14:\"site_edit_wiki\";i:1;s:19:\"torrents_add_artist\";i:1;}', '0'), (4, 200, 'Power User', 'a:14:{s:10:\"site_leech\";i:1;s:11:\"site_upload\";i:1;s:9:\"site_vote\";i:1;s:20:\"site_submit_requests\";i:1;s:20:\"site_advanced_search\";i:1;s:10:\"site_top10\";i:1;s:20:\"site_torrents_notify\";i:1;s:20:\"site_collages_create\";i:1;s:20:\"site_collages_manage\";i:1;s:19:\"site_make_bookmarks\";i:1;s:14:\"site_edit_wiki\";i:1;s:14:\"zip_downloader\";i:1;s:19:\"forums_polls_create\";i:1;s:19:\"torrents_add_artist\";i:1;} ', '0'), (5, 250, 'Elite', 'a:18:{s:10:\"site_leech\";i:1;s:11:\"site_upload\";i:1;s:9:\"site_vote\";i:1;s:20:\"site_submit_requests\";i:1;s:20:\"site_advanced_search\";i:1;s:10:\"site_top10\";i:1;s:20:\"site_torrents_notify\";i:1;s:20:\"site_collages_create\";i:1;s:20:\"site_collages_manage\";i:1;s:19:\"site_advanced_top10\";i:1;s:19:\"site_make_bookmarks\";i:1;s:14:\"site_edit_wiki\";i:1;s:15:\"site_delete_tag\";i:1;s:14:\"zip_downloader\";i:1;s:19:\"forums_polls_create\";i:1;s:13:\"torrents_edit\";i:1;s:19:\"torrents_add_artist\";i:1;s:17:\"admin_clear_cache\";i:1;}', '0'), (20, 202, 'Donor', 'a:9:{s:9:\"site_vote\";i:1;s:20:\"site_submit_requests\";i:1;s:20:\"site_advanced_search\";i:1;s:10:\"site_top10\";i:1;s:20:\"site_torrents_notify\";i:1;s:20:\"site_collages_create\";i:1;s:20:\"site_collages_manage\";i:1;s:14:\"zip_downloader\";i:1;s:19:\"forums_polls_create\";i:1;}', '0'), (19, 201, 'Artist', 'a:9:{s:10:\"site_leech\";s:1:\"1\";s:11:\"site_upload\";s:1:\"1\";s:9:\"site_vote\";s:1:\"1\";s:20:\"site_submit_requests\";s:1:\"1\";s:20:\"site_advanced_search\";s:1:\"1\";s:10:\"site_top10\";s:1:\"1\";s:19:\"site_make_bookmarks\";s:1:\"1\";s:14:\"site_edit_wiki\";s:1:\"1\";s:18:\"site_recommend_own\";s:1:\"1\";}', '0');
  1617. INSERT INTO stylesheets (ID, Name, Description, `Default`, Additions, Color) VALUES (1, 'Oppai', 'Oppaitime Stylesheet', '1', NULL, '#FBC2E5'), (2, 'Beluga', 'Beluga', '0', 'Pink|Haze', '#23252A'), (3, 'Genaviv', 'Genaviv Stylesheet', '0', 'Fixed Header', '#0A0A0A');
  1618. INSERT INTO wiki_articles (ID, Revision, Title, Body, MinClassRead, MinClassEdit, Date, Author) VALUES (1, 1, 'Wiki', 'Welcome to your new wiki! Hope this works.', 100, 475, NOW(), 1);
  1619. INSERT INTO wiki_aliases (Alias, UserID, ArticleID) VALUES ('wiki', 1, 1);
  1620. INSERT INTO wiki_revisions (ID, Revision, Title, Body, Date, Author) VALUES (1, 1, 'Wiki', 'Welcome to your new wiki! Hope this works.', NOW(), 1);
  1621. INSERT INTO forums (ID, CategoryID, Sort, Name, Description, MinClassRead, MinClassWrite, MinClassCreate, NumTopics, NumPosts, LastPostID, LastPostAuthorID, LastPostTopicID, LastPostTime) VALUES (1, 1, 20, 'Your Site', 'Totally rad forum', 100, 100, 100, 0, 0, 0, 0, 0, NULL), (2, 5, 30, 'Chat', 'Expect this to fill up with spam', 100, 100, 100, 0, 0, 0, 0, 0, NULL), (3, 10, 40, 'Help!', 'I fell down and I cant get up', 100, 100, 100, 0, 0, 0, 0, 0, NULL), (4, 20, 100, 'Trash', 'Every thread ends up here eventually', 100, 500, 500, 0, 0, 0, 0, 0, NULL);
  1622. INSERT INTO tags (ID, Name, TagType, Uses, UserID) VALUES (1, 'foo', 'genre', 0, 1),(2, 'bar', 'genre', 0, 1),(3, 'baz', 'genre', 0, 1);
  1623. INSERT INTO schedule (NextHour, NextDay, NextBiWeekly) VALUES (0,0,0);
  1624. INSERT INTO forums_categories (ID, Sort, Name) VALUES (1,1,'Site');
  1625. INSERT INTO forums_categories (ID, Sort, Name) VALUES (5,5,'Community');
  1626. INSERT INTO forums_categories (ID, Sort, Name) VALUES (10,10,'Help');
  1627. INSERT INTO forums_categories (ID, Sort, Name) VALUES (8,8,'Music');
  1628. INSERT INTO forums_categories (ID, Sort, Name) VALUES (20,20,'Trash');
  1629. DELIMITER ;;
  1630. CREATE TRIGGER update_seedtime
  1631. AFTER UPDATE ON `xbt_files_users`
  1632. FOR EACH ROW BEGIN
  1633. IF ( (OLD.timespent < NEW.timespent) AND (OLD.active = 1) AND (NEW.active = 1) ) THEN
  1634. INSERT INTO users_seedtime
  1635. (UserID, TorrentID, SeedTime, Uploaded, Downloaded, LastUpdate)
  1636. VALUES
  1637. (NEW.uid, NEW.fid, NEW.timespent, NEW.uploaded, NEW.downloaded, NOW())
  1638. ON DUPLICATE KEY UPDATE
  1639. SeedTime = SeedTime + (NEW.timespent - OLD.timespent),
  1640. Uploaded = Uploaded + (NEW.uploaded - OLD.uploaded),
  1641. Downloaded = Downloaded + (NEW.downloaded - OLD.downloaded),
  1642. LastUpdate = NOW();
  1643. END IF;
  1644. END;;
  1645. DELIMITER ;