initDB.sql 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. -- --------------------------------------------------------
  2. -- Host: db.pentou.ovh
  3. -- Server version: 10.5.5-MariaDB - MariaDB Server
  4. -- Server OS: Linux
  5. -- HeidiSQL Version: 11.0.0.5919
  6. -- --------------------------------------------------------
  7. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  8. /*!40101 SET NAMES utf8 */;
  9. /*!50503 SET NAMES utf8mb4 */;
  10. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  11. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  12. -- Dumping database structure for myanimebot
  13. CREATE DATABASE IF NOT EXISTS `myanimebot` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
  14. USE `myanimebot`;
  15. -- Dumping structure for view myanimebot.check_DuplicateFeeds
  16. -- Creating temporary table to overcome VIEW dependency errors
  17. CREATE TABLE `check_DuplicateFeeds` (
  18. `published` DATETIME NOT NULL,
  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=3237 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=4883 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. FULLTEXT KEY `idx_title_str` (`title`)
  389. ) ENGINE=InnoDB AUTO_INCREMENT=3329 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=224;
  390. -- Data exporting was unselected.
  391. -- Dumping structure for table myanimebot.t_availability
  392. CREATE TABLE IF NOT EXISTS `t_availability` (
  393. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  394. `date` datetime NOT NULL DEFAULT current_timestamp(),
  395. `service` tinytext CHARACTER SET latin1 NOT NULL DEFAULT 'mal',
  396. `code` smallint(6) NOT NULL DEFAULT 0,
  397. PRIMARY KEY (`id`),
  398. KEY `idx_date` (`date`),
  399. KEY `idx_service` (`service`(255))
  400. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  401. -- Data exporting was unselected.
  402. -- Dumping structure for table myanimebot.t_feeds
  403. CREATE TABLE IF NOT EXISTS `t_feeds` (
  404. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  405. `published` datetime NOT NULL,
  406. `title` mediumtext DEFAULT NULL,
  407. `service` tinytext NOT NULL DEFAULT 'mal',
  408. `url` mediumtext NOT NULL,
  409. `user` tinytext DEFAULT NULL,
  410. `found` datetime NOT NULL DEFAULT current_timestamp(),
  411. `type` tinytext DEFAULT 'N/A',
  412. PRIMARY KEY (`id`),
  413. KEY `idx_user` (`user`(255)),
  414. KEY `idx_title` (`title`(768)),
  415. KEY `idx_published` (`published`),
  416. KEY `idx_type` (`type`(255)),
  417. FULLTEXT KEY `idx_title_str` (`title`)
  418. ) ENGINE=InnoDB AUTO_INCREMENT=14769 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=172;
  419. -- Data exporting was unselected.
  420. -- Dumping structure for table myanimebot.t_history
  421. CREATE TABLE IF NOT EXISTS `t_history` (
  422. `date` datetime NOT NULL,
  423. `nbFeeds` int(11) unsigned NOT NULL DEFAULT 0,
  424. `nbUniqueFeeds` int(11) unsigned NOT NULL DEFAULT 0,
  425. `nbMedia` int(11) unsigned NOT NULL DEFAULT 0,
  426. `nbUsers` int(11) unsigned NOT NULL DEFAULT 0,
  427. `nbServers` int(11) unsigned NOT NULL DEFAULT 0,
  428. `nbDuplicateFeeds` int(11) unsigned NOT NULL DEFAULT 0,
  429. `nbDuplicateMedia` int(11) unsigned NOT NULL DEFAULT 0,
  430. `nbEmptyThumbnail` int(11) unsigned NOT NULL DEFAULT 0,
  431. `nbInactiveUsers` int(11) unsigned NOT NULL DEFAULT 0,
  432. `spaceFeedsTable` int(11) unsigned NOT NULL DEFAULT 0,
  433. `spaceAnimesTable` int(11) unsigned NOT NULL DEFAULT 0,
  434. `spaceUsersTable` int(11) unsigned NOT NULL DEFAULT 0,
  435. `spaceServersTable` int(11) unsigned NOT NULL DEFAULT 0,
  436. `dailyAveragePerUser` float unsigned NOT NULL DEFAULT 0,
  437. `orphanMedias` int(11) unsigned NOT NULL DEFAULT 0,
  438. `nbMediaManga` int(11) unsigned NOT NULL DEFAULT 0,
  439. `nbMediaAnime` int(11) unsigned NOT NULL DEFAULT 0,
  440. `nbLog` int(11) NOT NULL DEFAULT 0,
  441. `nbErrorLog` int(11) NOT NULL DEFAULT 0,
  442. PRIMARY KEY (`date`) USING BTREE
  443. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='History of database';
  444. -- Data exporting was unselected.
  445. -- Dumping structure for table myanimebot.t_logs
  446. CREATE TABLE IF NOT EXISTS `t_logs` (
  447. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  448. `host` tinytext CHARACTER SET latin1 NOT NULL DEFAULT 'unspecified.host',
  449. `level` int(11) DEFAULT NULL,
  450. `type` mediumtext CHARACTER SET utf8 DEFAULT NULL,
  451. `log` text CHARACTER SET latin1 DEFAULT NULL,
  452. `date` datetime NOT NULL DEFAULT current_timestamp(),
  453. `source` tinytext CHARACTER SET latin1 NOT NULL DEFAULT 'unknown',
  454. PRIMARY KEY (`id`),
  455. KEY `idx_level` (`level`) USING BTREE,
  456. KEY `idx_date` (`date`) USING BTREE,
  457. KEY `idx_host` (`host`(255)),
  458. KEY `idx_by` (`source`(255)) USING BTREE,
  459. FULLTEXT KEY `idx_log` (`log`)
  460. ) ENGINE=InnoDB AUTO_INCREMENT=62280 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED;
  461. -- Data exporting was unselected.
  462. -- Dumping structure for table myanimebot.t_servers
  463. CREATE TABLE IF NOT EXISTS `t_servers` (
  464. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  465. `server` tinytext NOT NULL,
  466. `channel` tinytext DEFAULT NULL,
  467. `admin_group` tinytext DEFAULT NULL,
  468. PRIMARY KEY (`id`),
  469. UNIQUE KEY `idx_server` (`server`(255)) USING BTREE
  470. ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=5461;
  471. -- Data exporting was unselected.
  472. -- Dumping structure for table myanimebot.t_sys
  473. CREATE TABLE IF NOT EXISTS `t_sys` (
  474. `param` tinytext NOT NULL,
  475. `value` text DEFAULT NULL,
  476. PRIMARY KEY (`param`(100)) USING BTREE
  477. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  478. -- Data exporting was unselected.
  479. -- Dumping structure for table myanimebot.t_users
  480. CREATE TABLE IF NOT EXISTS `t_users` (
  481. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  482. `mal_user` tinytext NOT NULL,
  483. `service` tinytext NOT NULL DEFAULT 'mal',
  484. `servers` text DEFAULT NULL,
  485. `added` datetime NOT NULL DEFAULT current_timestamp(),
  486. PRIMARY KEY (`id`),
  487. UNIQUE KEY `idx_user` (`mal_user`(255)) USING BTREE,
  488. KEY `idx_servers` (`servers`(768)),
  489. KEY `idx_service` (`service`(255)),
  490. FULLTEXT KEY `idx_servers_str` (`servers`)
  491. ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4 AVG_ROW_LENGTH=1820 COMMENT='Table where are stored the users of this bot.';
  492. -- Data exporting was unselected.
  493. -- Dumping structure for view myanimebot.v_ActiveUsers
  494. -- Creating temporary table to overcome VIEW dependency errors
  495. CREATE TABLE `v_ActiveUsers` (
  496. `user` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci',
  497. `active` VARCHAR(1) NOT NULL COLLATE 'utf8mb4_general_ci'
  498. ) ENGINE=MyISAM;
  499. -- Dumping structure for view myanimebot.v_CountFeedsType
  500. -- Creating temporary table to overcome VIEW dependency errors
  501. CREATE TABLE `v_CountFeedsType` (
  502. `type` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  503. `total` BIGINT(21) NOT NULL
  504. ) ENGINE=MyISAM;
  505. -- Dumping structure for view myanimebot.v_CountMediaType
  506. -- Creating temporary table to overcome VIEW dependency errors
  507. CREATE TABLE `v_CountMediaType` (
  508. `media` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  509. `total` BIGINT(21) NOT NULL
  510. ) ENGINE=MyISAM;
  511. -- Dumping structure for view myanimebot.v_DailyHistory
  512. -- Creating temporary table to overcome VIEW dependency errors
  513. CREATE TABLE `v_DailyHistory` (
  514. `date` DATE NULL,
  515. `nbFeeds` INT(11) UNSIGNED NULL,
  516. `nbUniqueFeeds` INT(11) UNSIGNED NULL,
  517. `nbMedia` INT(11) UNSIGNED NULL,
  518. `nbUsers` INT(11) UNSIGNED NULL,
  519. `nbServers` INT(11) UNSIGNED NULL,
  520. `nbDuplacteFeeds` DECIMAL(12,0) NULL,
  521. `nbDuplicateMedia` DECIMAL(12,0) NULL,
  522. `nbEmptyThumbnail` DECIMAL(12,0) NULL,
  523. `nbInactiveUsers` DECIMAL(12,0) NULL,
  524. `spaceFeedsTable` DECIMAL(12,0) NULL,
  525. `spaceAnimesTable` DECIMAL(12,0) NULL,
  526. `SpaceUsersTable` DECIMAL(12,0) NULL,
  527. `SpaceServersTable` DECIMAL(12,0) NULL,
  528. `dailyAveragePerUser` DOUBLE(17,0) NULL,
  529. `orphanMedias` DECIMAL(12,0) NULL,
  530. `nbMediaManga` DECIMAL(12,0) NULL,
  531. `nbMediaAnime` DECIMAL(12,0) NULL,
  532. `nbLog` DECIMAL(11,0) NULL,
  533. `nbErrorLog` DECIMAL(11,0) NULL
  534. ) ENGINE=MyISAM;
  535. -- Dumping structure for view myanimebot.v_Top
  536. -- Creating temporary table to overcome VIEW dependency errors
  537. CREATE TABLE `v_Top` (
  538. `user` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  539. `total` BIGINT(21) NOT NULL
  540. ) ENGINE=MyISAM;
  541. -- Dumping structure for view myanimebot.v_TopAnimes
  542. -- Creating temporary table to overcome VIEW dependency errors
  543. CREATE TABLE `v_TopAnimes` (
  544. `anime` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci',
  545. `nbUser` BIGINT(21) NOT NULL,
  546. `total` BIGINT(21) NOT NULL
  547. ) ENGINE=MyISAM;
  548. -- Dumping structure for view myanimebot.v_TopUniqueAnimePerUsers
  549. -- Creating temporary table to overcome VIEW dependency errors
  550. CREATE TABLE `v_TopUniqueAnimePerUsers` (
  551. `user` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  552. `title` MEDIUMTEXT NULL COLLATE 'utf8mb4_general_ci',
  553. `count` BIGINT(21) NOT NULL
  554. ) ENGINE=MyISAM;
  555. -- Dumping structure for view myanimebot.v_TotalAnimes
  556. -- Creating temporary table to overcome VIEW dependency errors
  557. CREATE TABLE `v_TotalAnimes` (
  558. `total` BIGINT(21) NOT NULL
  559. ) ENGINE=MyISAM;
  560. -- Dumping structure for view myanimebot.v_TotalDifferentAnimesPerUser
  561. -- Creating temporary table to overcome VIEW dependency errors
  562. CREATE TABLE `v_TotalDifferentAnimesPerUser` (
  563. `user` TINYTEXT NULL COLLATE 'utf8mb4_general_ci',
  564. `total` BIGINT(21) NOT NULL
  565. ) ENGINE=MyISAM;
  566. -- Dumping structure for view myanimebot.v_TotalFeeds
  567. -- Creating temporary table to overcome VIEW dependency errors
  568. CREATE TABLE `v_TotalFeeds` (
  569. `total` BIGINT(21) NOT NULL
  570. ) ENGINE=MyISAM;
  571. -- Dumping structure for view myanimebot.check_DuplicateFeeds
  572. -- Removing temporary table and create final VIEW structure
  573. DROP TABLE IF EXISTS `check_DuplicateFeeds`;
  574. CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `check_DuplicateFeeds` AS select `t_feeds`.`published` AS `published`,`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;
  575. -- Dumping structure for view myanimebot.check_DuplicateMedia
  576. -- Removing temporary table and create final VIEW structure
  577. DROP TABLE IF EXISTS `check_DuplicateMedia`;
  578. 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;
  579. -- Dumping structure for view myanimebot.check_EmptyThumbnail
  580. -- Removing temporary table and create final VIEW structure
  581. DROP TABLE IF EXISTS `check_EmptyThumbnail`;
  582. 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;
  583. -- Dumping structure for view myanimebot.check_EventExecution
  584. -- Removing temporary table and create final VIEW structure
  585. DROP TABLE IF EXISTS `check_EventExecution`;
  586. 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';
  587. -- Dumping structure for view myanimebot.check_Index
  588. -- Removing temporary table and create final VIEW structure
  589. DROP TABLE IF EXISTS `check_Index`;
  590. 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;
  591. -- Dumping structure for view myanimebot.check_OrphanMedias
  592. -- Removing temporary table and create final VIEW structure
  593. DROP TABLE IF EXISTS `check_OrphanMedias`;
  594. 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);
  595. -- Dumping structure for view myanimebot.check_TablesDiskUsage
  596. -- Removing temporary table and create final VIEW structure
  597. DROP TABLE IF EXISTS `check_TablesDiskUsage`;
  598. 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`;
  599. -- Dumping structure for view myanimebot.v_ActiveUsers
  600. -- Removing temporary table and create final VIEW structure
  601. DROP TABLE IF EXISTS `v_ActiveUsers`;
  602. 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`;
  603. -- Dumping structure for view myanimebot.v_CountFeedsType
  604. -- Removing temporary table and create final VIEW structure
  605. DROP TABLE IF EXISTS `v_CountFeedsType`;
  606. 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;
  607. -- Dumping structure for view myanimebot.v_CountMediaType
  608. -- Removing temporary table and create final VIEW structure
  609. DROP TABLE IF EXISTS `v_CountMediaType`;
  610. 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`;
  611. -- Dumping structure for view myanimebot.v_DailyHistory
  612. -- Removing temporary table and create final VIEW structure
  613. DROP TABLE IF EXISTS `v_DailyHistory`;
  614. 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;
  615. -- Dumping structure for view myanimebot.v_Top
  616. -- Removing temporary table and create final VIEW structure
  617. DROP TABLE IF EXISTS `v_Top`;
  618. CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER 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;
  619. -- Dumping structure for view myanimebot.v_TopAnimes
  620. -- Removing temporary table and create final VIEW structure
  621. DROP TABLE IF EXISTS `v_TopAnimes`;
  622. 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;
  623. -- Dumping structure for view myanimebot.v_TopUniqueAnimePerUsers
  624. -- Removing temporary table and create final VIEW structure
  625. DROP TABLE IF EXISTS `v_TopUniqueAnimePerUsers`;
  626. 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;
  627. -- Dumping structure for view myanimebot.v_TotalAnimes
  628. -- Removing temporary table and create final VIEW structure
  629. DROP TABLE IF EXISTS `v_TotalAnimes`;
  630. CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW `v_TotalAnimes` AS select count(0) AS `total` from `t_animes`;
  631. -- Dumping structure for view myanimebot.v_TotalDifferentAnimesPerUser
  632. -- Removing temporary table and create final VIEW structure
  633. DROP TABLE IF EXISTS `v_TotalDifferentAnimesPerUser`;
  634. 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;
  635. -- Dumping structure for view myanimebot.v_TotalFeeds
  636. -- Removing temporary table and create final VIEW structure
  637. DROP TABLE IF EXISTS `v_TotalFeeds`;
  638. CREATE ALGORITHM=TEMPTABLE SQL SECURITY INVOKER VIEW `v_TotalFeeds` AS select count(0) AS `total` from `t_feeds`;
  639. /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
  640. /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
  641. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;