1
0

myanimebot-init.sql 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. -- --------------------------------------------------------
  2. -- Server version: 10.5.6-MariaDB-log - FreeBSD Ports
  3. -- Server OS: FreeBSD12.2
  4. -- --------------------------------------------------------
  5. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  6. /*!40101 SET NAMES utf8 */;
  7. /*!50503 SET NAMES utf8mb4 */;
  8. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  9. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  10. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  11. -- Dumping database structure for myanimebot
  12. CREATE DATABASE IF NOT EXISTS `myanimebot` /*!40100 DEFAULT CHARACTER SET utf8 */;
  13. USE `myanimebot`;
  14. -- Dumping structure for view myanimebot.check_DuplicateFeeds
  15. -- Creating temporary table to overcome VIEW dependency errors
  16. CREATE TABLE `check_DuplicateFeeds` (
  17. `published` DATETIME NOT NULL,
  18. `service` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci',
  19. `title` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci',
  20. `user` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  21. `total` BIGINT(21) NOT NULL
  22. ) ENGINE=MyISAM;
  23. -- Dumping structure for view myanimebot.check_DuplicateMedia
  24. -- Creating temporary table to overcome VIEW dependency errors
  25. CREATE TABLE `check_DuplicateMedia` (
  26. `guid` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_general_ci',
  27. `title` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci',
  28. `total` BIGINT(21) NOT NULL
  29. ) ENGINE=MyISAM;
  30. -- Dumping structure for view myanimebot.check_EmptyThumbnail
  31. -- Creating temporary table to overcome VIEW dependency errors
  32. CREATE TABLE `check_EmptyThumbnail` (
  33. `id` INT(11) UNSIGNED NOT NULL,
  34. `guid` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_general_ci',
  35. `title` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci',
  36. `thumbnail` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci'
  37. ) ENGINE=MyISAM;
  38. -- Dumping structure for view myanimebot.check_EventExecution
  39. -- Creating temporary table to overcome VIEW dependency errors
  40. CREATE TABLE `check_EventExecution` (
  41. `table` VARCHAR(64) NOT NULL COLLATE 'utf8_general_ci',
  42. `refreshed` DATETIME NULL
  43. ) ENGINE=MyISAM;
  44. -- Dumping structure for view myanimebot.check_Index
  45. -- Creating temporary table to overcome VIEW dependency errors
  46. CREATE TABLE `check_Index` (
  47. `table` VARCHAR(192) NOT NULL COLLATE 'utf8_general_ci',
  48. `index` VARCHAR(192) NOT NULL COLLATE 'utf8_general_ci',
  49. `read` BIGINT(21) NOT NULL
  50. ) ENGINE=MyISAM;
  51. -- Dumping structure for view myanimebot.check_OrphanMedias
  52. -- Creating temporary table to overcome VIEW dependency errors
  53. CREATE TABLE `check_OrphanMedias` (
  54. `id` INT(11) UNSIGNED NOT NULL,
  55. `media` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci'
  56. ) ENGINE=MyISAM;
  57. -- Dumping structure for view myanimebot.check_TablesDiskUsage
  58. -- Creating temporary table to overcome VIEW dependency errors
  59. CREATE TABLE `check_TablesDiskUsage` (
  60. `table` VARCHAR(64) NOT NULL COLLATE 'utf8_general_ci',
  61. `dataMB` DECIMAL(24,2) NULL,
  62. `indexMB` DECIMAL(24,2) NULL,
  63. `totalMB` DECIMAL(25,2) NULL,
  64. `total` BIGINT(22) UNSIGNED NULL
  65. ) ENGINE=MyISAM;
  66. -- Dumping structure for event myanimebot.event_generate_DailyAveragePerUser
  67. DELIMITER //
  68. CREATE EVENT `event_generate_DailyAveragePerUser` ON SCHEDULE EVERY 1 DAY STARTS '2020-01-05 01:30:00' ON COMPLETION PRESERVE ENABLE DO BEGIN
  69. # Create job_DailyAveragePerUser
  70. # We drop the curent table
  71. DROP TABLE IF EXISTS job_DailyAveragePerUser;
  72. # We recreate the table with the current result of the view
  73. CREATE TABLE job_DailyAveragePerUser IGNORE AS
  74. SELECT user, AVG(count) AS 'average'
  75. FROM (
  76. SELECT user, DATE(published) AS 'date', COUNT(*) AS 'count'
  77. FROM t_feeds
  78. WHERE DATE(published) != DATE(NOW())
  79. GROUP BY user, DATE
  80. ) AS temp_DailyAveragePerUser
  81. GROUP BY user
  82. ORDER BY average DESC
  83. ;
  84. # We apply the right configuration for the new table
  85. ALTER TABLE job_DailyAveragePerUser
  86. COMMENT="Autogenerated - Average daily medias per user"
  87. COLLATE='utf8mb4_general_ci'
  88. ENGINE=InnoDB
  89. ;
  90. # We create an ID column for the table
  91. ALTER TABLE job_DailyAveragePerUser
  92. ADD COLUMN `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
  93. ADD PRIMARY KEY (`id`)
  94. ;
  95. # We create indexes for the table
  96. CREATE INDEX idx_user ON job_DailyAveragePerUser(user);
  97. # And we analyze the created table
  98. ANALYZE TABLE job_DailyAveragePerUser;
  99. END//
  100. DELIMITER ;
  101. -- Dumping structure for event myanimebot.event_generate_TopAnimes
  102. DELIMITER //
  103. CREATE EVENT `event_generate_TopAnimes` ON SCHEDULE EVERY 1 DAY STARTS '2019-12-08 05:00:00' ON COMPLETION PRESERVE ENABLE DO BEGIN
  104. # Create job_TopAnimes
  105. # We drop the curent table
  106. DROP TABLE IF EXISTS job_TopAnimes;
  107. # We recreate the table with the current result of the view
  108. CREATE TABLE job_TopAnimes AS SELECT * FROM v_TopAnimes;
  109. # We apply the right configuration for the new table
  110. ALTER TABLE job_TopAnimes
  111. COMMENT="Autogenerated - Top listed animes and number of users"
  112. COLLATE='utf8mb4_general_ci'
  113. ENGINE=InnoDB
  114. ;
  115. # We create an ID column for the table
  116. ALTER TABLE job_TopAnimes
  117. ADD COLUMN `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
  118. ADD PRIMARY KEY (`id`)
  119. ;
  120. # We create indexes for the table
  121. CREATE INDEX idx_anime ON job_TopAnimes(anime);
  122. # And we analyze the created table
  123. ANALYZE TABLE job_TopAnimes;
  124. END//
  125. DELIMITER ;
  126. -- Dumping structure for event myanimebot.event_generate_TopUniqueAnimePerUsers
  127. DELIMITER //
  128. CREATE EVENT `event_generate_TopUniqueAnimePerUsers` ON SCHEDULE EVERY 1 DAY STARTS '2019-11-05 05:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Daily job' DO BEGIN
  129. # Create job_TopUniqueAnimePerUsers
  130. # We drop the curent table
  131. DROP TABLE IF EXISTS job_TopUniqueAnimePerUsers;
  132. # We recreate the table with the current result of the view
  133. CREATE TABLE job_TopUniqueAnimePerUsers AS SELECT * FROM v_TopUniqueAnimePerUsers;
  134. # We apply the right configuration for the new table
  135. ALTER TABLE job_TopUniqueAnimePerUsers
  136. COMMENT="Autogenerated - Unique Anime feeds per users"
  137. COLLATE='utf8mb4_general_ci'
  138. ENGINE=InnoDB
  139. ;
  140. # We create an ID column for the table
  141. ALTER TABLE job_TopUniqueAnimePerUsers
  142. ADD COLUMN `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
  143. ADD PRIMARY KEY (`id`)
  144. ;
  145. # We create indexes for the table
  146. CREATE INDEX idx_user ON job_TopUniqueAnimePerUsers(user);
  147. CREATE INDEX idx_title ON job_TopUniqueAnimePerUsers(title);
  148. # And we analyze the created table
  149. ANALYZE TABLE job_TopUniqueAnimePerUsers;
  150. END//
  151. DELIMITER ;
  152. -- Dumping structure for event myanimebot.event_generate_TotalDifferentAnimesPerUser
  153. DELIMITER //
  154. CREATE EVENT `event_generate_TotalDifferentAnimesPerUser` ON SCHEDULE EVERY 1 HOUR STARTS '2019-11-05 03:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Daily job' DO BEGIN
  155. # Create job_TotalDifferentAnimesPerUser
  156. # We drop the curent table
  157. DROP TABLE IF EXISTS job_TotalDifferentAnimesPerUser;
  158. # We recreate the table with the current result of the view
  159. CREATE TABLE job_TotalDifferentAnimesPerUser AS SELECT * FROM v_TotalDifferentAnimesPerUser;
  160. # We apply the right configuration for the new table
  161. ALTER TABLE job_TotalDifferentAnimesPerUser
  162. COMMENT="Autogenerated - Total of different media per users"
  163. COLLATE='utf8mb4_general_ci'
  164. ENGINE=InnoDB
  165. ;
  166. # We create an ID column for the table
  167. ALTER TABLE job_TotalDifferentAnimesPerUser
  168. ADD COLUMN `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT FIRST,
  169. ADD PRIMARY KEY (`id`)
  170. ;
  171. # We create indexes for the table
  172. CREATE INDEX idx_user ON job_TotalDifferentAnimesPerUser(user);
  173. # And we analyze the created table
  174. ANALYZE TABLE job_TotalDifferentAnimesPerUser;
  175. END//
  176. DELIMITER ;
  177. -- Dumping structure for event myanimebot.event_history
  178. DELIMITER //
  179. CREATE EVENT `event_history` ON SCHEDULE EVERY 10 MINUTE STARTS '2019-11-15 00:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Update the history table every 10 minutes' DO BEGIN
  180. # Initialization of my time variable
  181. SET @date = NOW();
  182. # We get the values that we want to store
  183. SELECT @totalFeeds := total FROM v_TotalFeeds;
  184. SELECT @totalUniqueFeeds := COUNT(0) FROM job_TopUniqueAnimePerUsers;
  185. SELECT @totalMedia := total FROM v_TotalAnimes;
  186. SELECT @totalUsers := COUNT(0) FROM t_users;
  187. SELECT @totalServers := COUNT(0) FROM t_servers;
  188. SELECT @totalDuplicateFeeds := COUNT(0) FROM check_DuplicateFeeds;
  189. SELECT @totalDuplicateMedia := COUNT(0) FROM check_DuplicateMedia;
  190. SELECT @totalEmptyThumbnail := COUNT(0) FROM check_EmptyThumbnail;
  191. SELECT @totalInactiveUsers := COUNT(0) FROM v_ActiveUsers WHERE active = '0';
  192. SELECT @spaceFeedsTable := total FROM check_TablesDiskUsage WHERE check_TablesDiskUsage.table = "t_feeds";
  193. SELECT @spaceAnimesTable := total FROM check_TablesDiskUsage WHERE check_TablesDiskUsage.table = "t_animes";
  194. SELECT @spaceUsersTable := total FROM check_TablesDiskUsage WHERE check_TablesDiskUsage.table = "t_users";
  195. SELECT @spaceServersTable := total FROM check_TablesDiskUsage WHERE check_TablesDiskUsage.table = "t_servers";
  196. SELECT @dailyAveragePerUser := ROUND(AVG(average), 3) FROM job_DailyAveragePerUser;
  197. SELECT @totalOrphanMedias := COUNT(0) FROM check_OrphanMedias;
  198. SELECT @nbMediaManga := total FROM v_CountMediaType WHERE v_CountMediaType.media = "manga";
  199. SELECT @nbMediaAnime := total FROM v_CountMediaType WHERE v_CountMediaType.media = "anime";
  200. SELECT @nbLog := COUNT(0) FROM t_logs;
  201. SELECT @nbErrorLog := COUNT(0) FROM t_logs WHERE LEVEL >= 30;
  202. # We insert tour values
  203. INSERT INTO t_history (date, nbFeeds, nbUniqueFeeds, nbMedia, nbUsers, nbServers, nbDuplicateFeeds, nbDuplicateMedia, nbEmptyThumbnail, nbInactiveUsers, spaceFeedsTable, spaceAnimesTable, spaceUsersTable, spaceServersTable, dailyAveragePerUser, orphanMedias, nbMediaManga, nbMediaAnime, nbLog, nbErrorLog)
  204. VALUES (@date, @totalFeeds, @totalUniqueFeeds, @totalMedia, @totalUsers, @totalServers, @totalDuplicateFeeds, @totalDuplicateMedia, @totalEmptyThumbnail, @totalInactiveUsers, @spaceFeedsTable, @spaceAnimesTable, @spaceServersTable, @spaceServersTable, @dailyAveragePerUser, @totalOrphanMedias, @nbMediaManga, @nbMediaAnime, @nbLog, @nbErrorLog);
  205. END//
  206. DELIMITER ;
  207. -- Dumping structure for event myanimebot.event_maintenance
  208. DELIMITER //
  209. CREATE EVENT `event_maintenance` ON SCHEDULE EVERY 1 DAY STARTS '2019-11-17 06:00:00' ON COMPLETION PRESERVE ENABLE COMMENT 'Executed at 6am, analyze the SQL tables' DO BEGIN
  210. # Using the stored procedure.
  211. CALL myanimebot.sp_Maintenance();
  212. END//
  213. DELIMITER ;
  214. -- Dumping structure for table myanimebot.job_DailyAveragePerUser
  215. CREATE TABLE IF NOT EXISTS `job_DailyAveragePerUser` (
  216. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  217. `user` tinytext DEFAULT NULL,
  218. `average` decimal(24,4) DEFAULT NULL,
  219. PRIMARY KEY (`id`),
  220. KEY `idx_user` (`user`(255))
  221. ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COMMENT='Autogenerated - Average daily medias per user';
  222. -- Data exporting was unselected.
  223. -- Dumping structure for table myanimebot.job_TopAnimes
  224. CREATE TABLE IF NOT EXISTS `job_TopAnimes` (
  225. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  226. `anime` mediumtext DEFAULT NULL,
  227. `nbUser` bigint(21) NOT NULL DEFAULT 0,
  228. `total` bigint(21) NOT NULL DEFAULT 0,
  229. PRIMARY KEY (`id`),
  230. KEY `idx_anime` (`anime`(768))
  231. ) ENGINE=InnoDB AUTO_INCREMENT=3187 DEFAULT CHARSET=utf8mb4 COMMENT='Autogenerated - Top listed animes and number of users';
  232. -- Data exporting was unselected.
  233. -- Dumping structure for table myanimebot.job_TopUniqueAnimePerUsers
  234. CREATE TABLE IF NOT EXISTS `job_TopUniqueAnimePerUsers` (
  235. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  236. `user` tinytext DEFAULT NULL,
  237. `title` mediumtext DEFAULT NULL,
  238. `count` bigint(21) NOT NULL DEFAULT 0,
  239. PRIMARY KEY (`id`),
  240. KEY `idx_user` (`user`(255)),
  241. KEY `idx_title` (`title`(768))
  242. ) ENGINE=InnoDB AUTO_INCREMENT=4768 DEFAULT CHARSET=utf8mb4 COMMENT='Autogenerated - Unique Anime feeds per users';
  243. -- Data exporting was unselected.
  244. -- Dumping structure for table myanimebot.job_TotalDifferentAnimesPerUser
  245. CREATE TABLE IF NOT EXISTS `job_TotalDifferentAnimesPerUser` (
  246. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  247. `user` tinytext DEFAULT NULL,
  248. `total` bigint(21) NOT NULL DEFAULT 0,
  249. PRIMARY KEY (`id`),
  250. KEY `idx_user` (`user`(255))
  251. ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COMMENT='Autogenerated - Total of different media per users';
  252. -- Data exporting was unselected.
  253. -- Dumping structure for procedure myanimebot.sp_AnimeCountPerKeyword
  254. DELIMITER //
  255. CREATE PROCEDURE `sp_AnimeCountPerKeyword`(
  256. IN `anime_var` TINYTEXT,
  257. IN `limit_var` INT
  258. )
  259. SQL SECURITY INVOKER
  260. COMMENT 'Procédure pour récupèrer les statistiques d''animés répondant à un mot clef'
  261. BEGIN
  262. -- Default value is infinite for limit_var
  263. IF limit_var = ''
  264. THEN SET limit_var = '-1';
  265. END IF;
  266. -- Procedure to get animes statistics linked to a keyword
  267. SELECT title AS 'title', COUNT(0) AS 'total'
  268. FROM t_feeds
  269. WHERE MATCH(title) AGAINST (anime_var)
  270. GROUP BY title
  271. ORDER BY COUNT(id) DESC
  272. LIMIT limit_var
  273. ;
  274. END//
  275. DELIMITER ;
  276. -- Dumping structure for procedure myanimebot.sp_AnimesPerUser
  277. DELIMITER //
  278. CREATE PROCEDURE `sp_AnimesPerUser`(
  279. IN `user_var` TINYTEXT,
  280. IN `limit_var` INT
  281. )
  282. SQL SECURITY INVOKER
  283. COMMENT 'Procédure pour récupèrer les statistiques d''animés sur un utilisateur'
  284. BEGIN
  285. -- Default value is infinite for limit_var
  286. IF limit_var = ''
  287. THEN SET limit_var = '-1';
  288. END IF;
  289. -- Procedure to get the statistics of user's animes
  290. SELECT
  291. title AS "title",
  292. COUNT(title) AS "total"
  293. FROM t_feeds
  294. WHERE user = user_var
  295. GROUP BY title
  296. ORDER BY COUNT(title) DESC
  297. LIMIT limit_var
  298. ;
  299. END//
  300. DELIMITER ;
  301. -- Dumping structure for procedure myanimebot.sp_Maintenance
  302. DELIMITER //
  303. CREATE PROCEDURE `sp_Maintenance`()
  304. BEGIN
  305. # Analyzing database's tables.
  306. ANALYZE TABLE t_animes, t_feeds, t_history, t_servers, t_sys, t_users, t_logs, t_availability;
  307. END//
  308. DELIMITER ;
  309. -- Dumping structure for procedure myanimebot.sp_RenameUser
  310. DELIMITER //
  311. CREATE PROCEDURE `sp_RenameUser`(
  312. IN `old_name_var` TINYTEXT,
  313. IN `new_name_var` TINYTEXT
  314. )
  315. MODIFIES SQL DATA
  316. SQL SECURITY INVOKER
  317. COMMENT 'Rename a user in the database.'
  318. BEGIN
  319. -- Rename a user in the database.
  320. -- For the table t_users
  321. UPDATE t_users
  322. SET t_users.mal_user = new_name_var
  323. WHERE t_users.mal_user = old_name_var;
  324. -- For the table t_animes
  325. UPDATE t_animes
  326. SET t_animes.discoverer = new_name_var
  327. WHERE t_animes.discoverer = old_name_var;
  328. -- For the table t_feeds
  329. UPDATE t_feeds
  330. SET t_feeds.user = new_name_var
  331. WHERE t_feeds.user = old_name_var;
  332. END//
  333. DELIMITER ;
  334. -- Dumping structure for procedure myanimebot.sp_TotalForKeyword
  335. DELIMITER //
  336. CREATE PROCEDURE `sp_TotalForKeyword`(
  337. IN `anime_var` TINYTEXT
  338. )
  339. SQL SECURITY INVOKER
  340. COMMENT 'Total des animés répondants à un mot clef'
  341. BEGIN
  342. -- Total of animés that contains a specific keyword
  343. SELECT COUNT(0) AS 'total'
  344. FROM t_feeds
  345. WHERE MATCH(title) AGAINST (anime_var)
  346. ;
  347. END//
  348. DELIMITER ;
  349. -- Dumping structure for procedure myanimebot.sp_UsersPerKeyword
  350. DELIMITER //
  351. CREATE PROCEDURE `sp_UsersPerKeyword`(
  352. IN `anime_var` TINYTEXT,
  353. IN `limit_var` INT
  354. )
  355. READS SQL DATA
  356. SQL SECURITY INVOKER
  357. COMMENT 'Statistiques des utilisateurs par rapport à un mot clef'
  358. BEGIN
  359. -- Default value is infinite for limit_var
  360. IF limit_var = ''
  361. THEN SET limit_var = '-1';
  362. END IF;
  363. -- Statistics of users according to a specific keyword
  364. SELECT user AS 'user', COUNT(title) AS 'total'
  365. FROM t_feeds
  366. WHERE MATCH(title) AGAINST(anime_var)
  367. GROUP BY user
  368. ORDER BY COUNT(title) DESC
  369. LIMIT limit_var
  370. ;
  371. END//
  372. DELIMITER ;
  373. -- Dumping structure for table myanimebot.t_animes
  374. CREATE TABLE IF NOT EXISTS `t_animes` (
  375. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  376. `guid` mediumtext NOT NULL,
  377. `service` tinytext NOT NULL DEFAULT 'mal',
  378. `title` mediumtext DEFAULT NULL,
  379. `thumbnail` mediumtext DEFAULT NULL,
  380. `found` datetime NOT NULL DEFAULT current_timestamp(),
  381. `discoverer` tinytext DEFAULT 'Anonymous',
  382. `media` tinytext DEFAULT 'unknown',
  383. PRIMARY KEY (`id`),
  384. UNIQUE KEY `idx_guid` (`guid`(768)) USING BTREE,
  385. KEY `idx_title` (`title`(768)),
  386. KEY `idx_discoverer` (`discoverer`(255)),
  387. KEY `idx_media` (`media`(255)),
  388. KEY `idx_service` (`service`(255)),
  389. FULLTEXT KEY `idx_title_str` (`title`)
  390. ) ENGINE=InnoDB AUTO_INCREMENT=3177 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=224;
  391. -- Data exporting was unselected.
  392. -- Dumping structure for table myanimebot.t_availability
  393. CREATE TABLE IF NOT EXISTS `t_availability` (
  394. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  395. `date` datetime NOT NULL DEFAULT current_timestamp(),
  396. `service` tinytext CHARACTER SET latin1 NOT NULL DEFAULT 'mal',
  397. `code` smallint(6) NOT NULL DEFAULT 0,
  398. PRIMARY KEY (`id`),
  399. KEY `idx_date` (`date`),
  400. KEY `idx_service` (`service`(255))
  401. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  402. -- Data exporting was unselected.
  403. -- Dumping structure for table myanimebot.t_feeds
  404. CREATE TABLE IF NOT EXISTS `t_feeds` (
  405. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  406. `published` datetime NOT NULL,
  407. `title` mediumtext DEFAULT NULL,
  408. `service` tinytext NOT NULL DEFAULT 'mal',
  409. `url` mediumtext NOT NULL,
  410. `user` tinytext DEFAULT NULL,
  411. `found` datetime NOT NULL DEFAULT current_timestamp(),
  412. `type` tinytext DEFAULT 'N/A',
  413. PRIMARY KEY (`id`),
  414. KEY `idx_user` (`user`(255)),
  415. KEY `idx_title` (`title`(768)),
  416. KEY `idx_published` (`published`),
  417. KEY `idx_type` (`type`(255)),
  418. KEY `idx_service` (`service`(255)),
  419. FULLTEXT KEY `idx_title_str` (`title`)
  420. ) ENGINE=InnoDB AUTO_INCREMENT=14151 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=172;
  421. -- Data exporting was unselected.
  422. -- Dumping structure for table myanimebot.t_history
  423. CREATE TABLE IF NOT EXISTS `t_history` (
  424. `date` datetime NOT NULL,
  425. `nbFeeds` int(11) unsigned NOT NULL DEFAULT 0,
  426. `nbUniqueFeeds` int(11) unsigned NOT NULL DEFAULT 0,
  427. `nbMedia` int(11) unsigned NOT NULL DEFAULT 0,
  428. `nbUsers` int(11) unsigned NOT NULL DEFAULT 0,
  429. `nbServers` int(11) unsigned NOT NULL DEFAULT 0,
  430. `nbDuplicateFeeds` int(11) unsigned NOT NULL DEFAULT 0,
  431. `nbDuplicateMedia` int(11) unsigned NOT NULL DEFAULT 0,
  432. `nbEmptyThumbnail` int(11) unsigned NOT NULL DEFAULT 0,
  433. `nbInactiveUsers` int(11) unsigned NOT NULL DEFAULT 0,
  434. `spaceFeedsTable` int(11) unsigned NOT NULL DEFAULT 0,
  435. `spaceAnimesTable` int(11) unsigned NOT NULL DEFAULT 0,
  436. `spaceUsersTable` int(11) unsigned NOT NULL DEFAULT 0,
  437. `spaceServersTable` int(11) unsigned NOT NULL DEFAULT 0,
  438. `dailyAveragePerUser` float unsigned NOT NULL DEFAULT 0,
  439. `orphanMedias` int(11) unsigned NOT NULL DEFAULT 0,
  440. `nbMediaManga` int(11) unsigned NOT NULL DEFAULT 0,
  441. `nbMediaAnime` int(11) unsigned NOT NULL DEFAULT 0,
  442. `nbLog` int(11) NOT NULL DEFAULT 0,
  443. `nbErrorLog` int(11) NOT NULL DEFAULT 0,
  444. PRIMARY KEY (`date`) USING BTREE
  445. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='History of database';
  446. -- Data exporting was unselected.
  447. -- Dumping structure for table myanimebot.t_logs
  448. CREATE TABLE IF NOT EXISTS `t_logs` (
  449. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  450. `host` tinytext CHARACTER SET latin1 NOT NULL DEFAULT 'unspecified.host',
  451. `level` int(11) DEFAULT NULL,
  452. `type` text CHARACTER SET latin1 DEFAULT NULL,
  453. `log` mediumtext DEFAULT NULL,
  454. `date` datetime NOT NULL DEFAULT current_timestamp(),
  455. `source` tinytext CHARACTER SET latin1 NOT NULL DEFAULT 'unknown',
  456. PRIMARY KEY (`id`),
  457. KEY `idx_level` (`level`) USING BTREE,
  458. KEY `idx_date` (`date`) USING BTREE,
  459. KEY `idx_host` (`host`(255)),
  460. KEY `idx_by` (`source`(255)) USING BTREE,
  461. FULLTEXT KEY `idx_log` (`log`)
  462. ) ENGINE=InnoDB AUTO_INCREMENT=229107 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED;
  463. -- Data exporting was unselected.
  464. -- Dumping structure for table myanimebot.t_servers
  465. CREATE TABLE IF NOT EXISTS `t_servers` (
  466. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  467. `server` tinytext NOT NULL,
  468. `channel` tinytext DEFAULT NULL,
  469. `admin_group` tinytext DEFAULT NULL,
  470. PRIMARY KEY (`id`),
  471. UNIQUE KEY `idx_server` (`server`(255)) USING BTREE
  472. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=5461;
  473. -- Data exporting was unselected.
  474. -- Dumping structure for table myanimebot.t_sys
  475. CREATE TABLE IF NOT EXISTS `t_sys` (
  476. `param` tinytext NOT NULL,
  477. `value` text DEFAULT NULL,
  478. PRIMARY KEY (`param`(100)) USING BTREE
  479. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  480. -- Data exporting was unselected.
  481. -- Dumping structure for table myanimebot.t_users
  482. CREATE TABLE IF NOT EXISTS `t_users` (
  483. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  484. `mal_user` tinytext NOT NULL,
  485. `service` tinytext NOT NULL DEFAULT 'mal',
  486. `servers` text DEFAULT NULL,
  487. `added` datetime NOT NULL DEFAULT current_timestamp(),
  488. PRIMARY KEY (`id`),
  489. KEY `idx_servers` (`servers`(768)),
  490. KEY `idx_service` (`service`(255)),
  491. KEY `idx_user` (`mal_user`(255)) USING BTREE,
  492. FULLTEXT KEY `idx_servers_str` (`servers`)
  493. ) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=1820 COMMENT='Table where are stored the users of this bot.';
  494. -- Data exporting was unselected.
  495. -- Dumping structure for view myanimebot.v_ActiveUsers
  496. -- Creating temporary table to overcome VIEW dependency errors
  497. CREATE TABLE `v_ActiveUsers` (
  498. `user` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci',
  499. `active` VARCHAR(1) NOT NULL COLLATE 'utf8mb4_general_ci'
  500. ) ENGINE=MyISAM;
  501. -- Dumping structure for view myanimebot.v_CountFeedsType
  502. -- Creating temporary table to overcome VIEW dependency errors
  503. CREATE TABLE `v_CountFeedsType` (
  504. `type` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  505. `total` BIGINT(21) NOT NULL
  506. ) ENGINE=MyISAM;
  507. -- Dumping structure for view myanimebot.v_CountMediaType
  508. -- Creating temporary table to overcome VIEW dependency errors
  509. CREATE TABLE `v_CountMediaType` (
  510. `media` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  511. `total` BIGINT(21) NOT NULL
  512. ) ENGINE=MyISAM;
  513. -- Dumping structure for view myanimebot.v_DailyHistory
  514. -- Creating temporary table to overcome VIEW dependency errors
  515. CREATE TABLE `v_DailyHistory` (
  516. `date` DATE NULL,
  517. `nbFeeds` INT(11) UNSIGNED NULL,
  518. `nbUniqueFeeds` INT(11) UNSIGNED NULL,
  519. `nbMedia` INT(11) UNSIGNED NULL,
  520. `nbUsers` INT(11) UNSIGNED NULL,
  521. `nbServers` INT(11) UNSIGNED NULL,
  522. `nbDuplacteFeeds` DECIMAL(12,0) NULL,
  523. `nbDuplicateMedia` DECIMAL(12,0) NULL,
  524. `nbEmptyThumbnail` DECIMAL(12,0) NULL,
  525. `nbInactiveUsers` DECIMAL(12,0) NULL,
  526. `spaceFeedsTable` DECIMAL(12,0) NULL,
  527. `spaceAnimesTable` DECIMAL(12,0) NULL,
  528. `SpaceUsersTable` DECIMAL(12,0) NULL,
  529. `SpaceServersTable` DECIMAL(12,0) NULL,
  530. `dailyAveragePerUser` DOUBLE(17,0) NULL,
  531. `orphanMedias` DECIMAL(12,0) NULL,
  532. `nbMediaManga` DECIMAL(12,0) NULL,
  533. `nbMediaAnime` DECIMAL(12,0) NULL,
  534. `nbLog` DECIMAL(11,0) NULL,
  535. `nbErrorLog` DECIMAL(11,0) NULL
  536. ) ENGINE=MyISAM;
  537. -- Dumping structure for view myanimebot.v_Top
  538. -- Creating temporary table to overcome VIEW dependency errors
  539. CREATE TABLE `v_Top` (
  540. `user` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  541. `total` BIGINT(21) NOT NULL
  542. ) ENGINE=MyISAM;
  543. -- Dumping structure for view myanimebot.v_TopAnimes
  544. -- Creating temporary table to overcome VIEW dependency errors
  545. CREATE TABLE `v_TopAnimes` (
  546. `anime` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci',
  547. `nbUser` BIGINT(21) NOT NULL,
  548. `total` BIGINT(21) NOT NULL
  549. ) ENGINE=MyISAM;
  550. -- Dumping structure for view myanimebot.v_TopUniqueAnimePerUsers
  551. -- Creating temporary table to overcome VIEW dependency errors
  552. CREATE TABLE `v_TopUniqueAnimePerUsers` (
  553. `user` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  554. `title` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci',
  555. `count` BIGINT(21) NOT NULL
  556. ) ENGINE=MyISAM;
  557. -- Dumping structure for view myanimebot.v_TotalAnimes
  558. -- Creating temporary table to overcome VIEW dependency errors
  559. CREATE TABLE `v_TotalAnimes` (
  560. `total` BIGINT(21) NOT NULL
  561. ) ENGINE=MyISAM;
  562. -- Dumping structure for view myanimebot.v_TotalDifferentAnimesPerUser
  563. -- Creating temporary table to overcome VIEW dependency errors
  564. CREATE TABLE `v_TotalDifferentAnimesPerUser` (
  565. `user` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  566. `total` BIGINT(21) NOT NULL
  567. ) ENGINE=MyISAM;
  568. -- Dumping structure for view myanimebot.v_TotalFeeds
  569. -- Creating temporary table to overcome VIEW dependency errors
  570. CREATE TABLE `v_TotalFeeds` (
  571. `total` BIGINT(21) NOT NULL
  572. ) ENGINE=MyISAM;
  573. -- Dumping structure for view myanimebot.check_DuplicateFeeds
  574. -- Removing temporary table and create final VIEW structure
  575. DROP TABLE IF EXISTS `check_DuplicateFeeds`;
  576. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `check_DuplicateFeeds` AS select `t_feeds`.`published` AS `published`,`t_feeds`.`service` AS `service`,`t_feeds`.`title` AS `title`,`t_feeds`.`user` AS `user`,count(0) AS `total` from `t_feeds` group by `t_feeds`.`published`,`t_feeds`.`title`,`t_feeds`.`user` having count(0) > 1;
  577. -- Dumping structure for view myanimebot.check_DuplicateMedia
  578. -- Removing temporary table and create final VIEW structure
  579. DROP TABLE IF EXISTS `check_DuplicateMedia`;
  580. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `check_DuplicateMedia` AS select `t_animes`.`guid` AS `guid`,`t_animes`.`title` AS `title`,count(0) AS `total` from `t_animes` group by `t_animes`.`guid`,`t_animes`.`title` having count(0) > 1;
  581. -- Dumping structure for view myanimebot.check_EmptyThumbnail
  582. -- Removing temporary table and create final VIEW structure
  583. DROP TABLE IF EXISTS `check_EmptyThumbnail`;
  584. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `check_EmptyThumbnail` AS select `t_animes`.`id` AS `id`,`t_animes`.`guid` AS `guid`,`t_animes`.`title` AS `title`,`t_animes`.`thumbnail` AS `thumbnail` from `t_animes` where `t_animes`.`thumbnail` = '' or `t_animes`.`thumbnail` is null;
  585. -- Dumping structure for view myanimebot.check_EventExecution
  586. -- Removing temporary table and create final VIEW structure
  587. DROP TABLE IF EXISTS `check_EventExecution`;
  588. CREATE ALGORITHM=MERGE SQL SECURITY DEFINER VIEW `check_EventExecution` AS select `information_schema`.`TABLES`.`TABLE_NAME` AS `table`,`information_schema`.`TABLES`.`CREATE_TIME` AS `refreshed` from `information_schema`.`TABLES` where `information_schema`.`TABLES`.`TABLE_NAME` like 'job\\_%' and `information_schema`.`TABLES`.`TABLE_SCHEMA` = 'myanimebot';
  589. -- Dumping structure for view myanimebot.check_Index
  590. -- Removing temporary table and create final VIEW structure
  591. DROP TABLE IF EXISTS `check_Index`;
  592. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `check_Index` AS select `information_schema`.`INDEX_STATISTICS`.`TABLE_NAME` AS `table`,`information_schema`.`INDEX_STATISTICS`.`INDEX_NAME` AS `index`,`information_schema`.`INDEX_STATISTICS`.`ROWS_READ` AS `read` from `information_schema`.`INDEX_STATISTICS` where `information_schema`.`INDEX_STATISTICS`.`TABLE_SCHEMA` = 'myanimebot' and `information_schema`.`INDEX_STATISTICS`.`INDEX_NAME` <> 'PRIMARY' order by `information_schema`.`INDEX_STATISTICS`.`ROWS_READ` desc;
  593. -- Dumping structure for view myanimebot.check_OrphanMedias
  594. -- Removing temporary table and create final VIEW structure
  595. DROP TABLE IF EXISTS `check_OrphanMedias`;
  596. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `check_OrphanMedias` AS select `t_animes`.`id` AS `id`,`t_animes`.`title` AS `media` from `t_animes` where !exists(select distinct `t_feeds`.`title` from `t_feeds` where `t_feeds`.`title` = `t_animes`.`title` limit 1);
  597. -- Dumping structure for view myanimebot.check_TablesDiskUsage
  598. -- Removing temporary table and create final VIEW structure
  599. DROP TABLE IF EXISTS `check_TablesDiskUsage`;
  600. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `check_TablesDiskUsage` AS select `information_schema`.`TABLES`.`TABLE_NAME` AS `table`,round(`information_schema`.`TABLES`.`DATA_LENGTH` / 1024 / 1024,2) AS `dataMB`,round(`information_schema`.`TABLES`.`INDEX_LENGTH` / 1024 / 1024,2) AS `indexMB`,round((`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH`) / 1024 / 1024,2) AS `totalMB`,`information_schema`.`TABLES`.`DATA_LENGTH` + `information_schema`.`TABLES`.`INDEX_LENGTH` AS `total` from `INFORMATION_SCHEMA`.`TABLES` where `information_schema`.`TABLES`.`TABLE_SCHEMA` = 'myanimebot' and `information_schema`.`TABLES`.`TABLE_TYPE` = 'BASE TABLE' and (`information_schema`.`TABLES`.`TABLE_NAME` like 't\\_%' or `information_schema`.`TABLES`.`TABLE_NAME` like 'job\\_%') order by `information_schema`.`TABLES`.`TABLE_NAME`;
  601. -- Dumping structure for view myanimebot.v_ActiveUsers
  602. -- Removing temporary table and create final VIEW structure
  603. DROP TABLE IF EXISTS `v_ActiveUsers`;
  604. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `v_ActiveUsers` AS select `t_users`.`mal_user` AS `user`,case when exists(select 1 from `t_feeds` where `t_feeds`.`user` = `t_users`.`mal_user` limit 1) then '1' else '0' end AS `active` from `t_users`;
  605. -- Dumping structure for view myanimebot.v_CountFeedsType
  606. -- Removing temporary table and create final VIEW structure
  607. DROP TABLE IF EXISTS `v_CountFeedsType`;
  608. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `v_CountFeedsType` AS select `t_feeds`.`type` AS `type`,count(`t_feeds`.`id`) AS `total` from `t_feeds` where `t_feeds`.`type` <> 'N/A' group by `t_feeds`.`type` order by count(`t_feeds`.`id`) desc;
  609. -- Dumping structure for view myanimebot.v_CountMediaType
  610. -- Removing temporary table and create final VIEW structure
  611. DROP TABLE IF EXISTS `v_CountMediaType`;
  612. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `v_CountMediaType` AS select `t_animes`.`media` AS `media`,count(`t_animes`.`media`) AS `total` from `t_animes` group by `t_animes`.`media`;
  613. -- Dumping structure for view myanimebot.v_DailyHistory
  614. -- Removing temporary table and create final VIEW structure
  615. DROP TABLE IF EXISTS `v_DailyHistory`;
  616. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `v_DailyHistory` AS select cast(`t_history`.`date` as date) AS `date`,max(`t_history`.`nbFeeds`) AS `nbFeeds`,max(`t_history`.`nbUniqueFeeds`) AS `nbUniqueFeeds`,max(`t_history`.`nbMedia`) AS `nbMedia`,max(`t_history`.`nbUsers`) AS `nbUsers`,max(`t_history`.`nbServers`) AS `nbServers`,round(avg(`t_history`.`nbDuplicateFeeds`),0) AS `nbDuplacteFeeds`,round(avg(`t_history`.`nbDuplicateMedia`),0) AS `nbDuplicateMedia`,round(avg(`t_history`.`nbEmptyThumbnail`),0) AS `nbEmptyThumbnail`,round(avg(`t_history`.`nbInactiveUsers`),0) AS `nbInactiveUsers`,round(avg(`t_history`.`spaceFeedsTable`),0) AS `spaceFeedsTable`,round(avg(`t_history`.`spaceAnimesTable`),0) AS `spaceAnimesTable`,round(avg(`t_history`.`spaceUsersTable`),0) AS `SpaceUsersTable`,round(avg(`t_history`.`spaceServersTable`),0) AS `SpaceServersTable`,round(avg(`t_history`.`dailyAveragePerUser`),0) AS `dailyAveragePerUser`,round(avg(`t_history`.`orphanMedias`),0) AS `orphanMedias`,round(avg(`t_history`.`nbMediaManga`),0) AS `nbMediaManga`,round(avg(`t_history`.`nbMediaAnime`),0) AS `nbMediaAnime`,round(avg(`t_history`.`nbLog`),0) AS `nbLog`,round(avg(`t_history`.`nbErrorLog`),0) AS `nbErrorLog` from `t_history` group by cast(`t_history`.`date` as date) order by cast(`t_history`.`date` as date) desc;
  617. -- Dumping structure for view myanimebot.v_Top
  618. -- Removing temporary table and create final VIEW structure
  619. DROP TABLE IF EXISTS `v_Top`;
  620. CREATE ALGORITHM=TEMPTABLE SQL SECURITY DEFINER VIEW `v_Top` AS select `t_feeds`.`user` AS `user`,count(`t_feeds`.`title`) AS `total` from `t_feeds` group by `t_feeds`.`user` order by count(`t_feeds`.`title`) desc;
  621. -- Dumping structure for view myanimebot.v_TopAnimes
  622. -- Removing temporary table and create final VIEW structure
  623. DROP TABLE IF EXISTS `v_TopAnimes`;
  624. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `v_TopAnimes` AS select `t_feeds`.`title` AS `anime`,count(distinct `t_feeds`.`user`) AS `nbUser`,count(0) AS `total` from `t_feeds` group by `t_feeds`.`title` order by count(0) desc;
  625. -- Dumping structure for view myanimebot.v_TopUniqueAnimePerUsers
  626. -- Removing temporary table and create final VIEW structure
  627. DROP TABLE IF EXISTS `v_TopUniqueAnimePerUsers`;
  628. CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW `v_TopUniqueAnimePerUsers` AS select `t_feeds`.`user` AS `user`,`t_feeds`.`title` AS `title`,count(`t_feeds`.`title`) AS `count` from `t_feeds` group by `t_feeds`.`title`,`t_feeds`.`user` order by count(`t_feeds`.`title`) desc;
  629. -- Dumping structure for view myanimebot.v_TotalAnimes
  630. -- Removing temporary table and create final VIEW structure
  631. DROP TABLE IF EXISTS `v_TotalAnimes`;
  632. CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW `v_TotalAnimes` AS select count(0) AS `total` from `t_animes`;
  633. -- Dumping structure for view myanimebot.v_TotalDifferentAnimesPerUser
  634. -- Removing temporary table and create final VIEW structure
  635. DROP TABLE IF EXISTS `v_TotalDifferentAnimesPerUser`;
  636. CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW `v_TotalDifferentAnimesPerUser` AS select `t_feeds`.`user` AS `user`,count(distinct `t_feeds`.`title`) AS `total` from `t_feeds` group by `t_feeds`.`user` order by count(distinct `t_feeds`.`title`) desc;
  637. -- Dumping structure for view myanimebot.v_TotalFeeds
  638. -- Removing temporary table and create final VIEW structure
  639. DROP TABLE IF EXISTS `v_TotalFeeds`;
  640. CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW `v_TotalFeeds` AS select count(0) AS `total` from `t_feeds`;
  641. /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
  642. /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
  643. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  644. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;