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 63KB

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