BioTorrents.de’s version of Gazelle
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.

gazelle.sql 67KB

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