mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Version 9.0 adding some indexes on the database to speedup video queries
This commit is contained in:
parent
96b6c99150
commit
5b34e5bcdb
4 changed files with 29 additions and 3 deletions
|
@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$installationVersion = "8.9";
|
||||
$installationVersion = "9.0";
|
||||
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
|
|
@ -151,6 +151,8 @@ CREATE TABLE IF NOT EXISTS `videos` (
|
|||
INDEX `fk_videos_sites1_idx` (`sites_id` ASC),
|
||||
INDEX `clean_title_INDEX` (`clean_title` ASC),
|
||||
INDEX `video_filename_INDEX` (`filename` ASC),
|
||||
INDEX `video_status_idx` (`status` ASC),
|
||||
INDEX `video_type_idx` (`type` ASC) ,
|
||||
CONSTRAINT `fk_videos_sites1`
|
||||
FOREIGN KEY (`sites_id`)
|
||||
REFERENCES `sites` (`id`)
|
||||
|
@ -308,6 +310,7 @@ CREATE TABLE IF NOT EXISTS `likes` (
|
|||
PRIMARY KEY (`id`),
|
||||
INDEX `fk_likes_videos1_idx` (`videos_id` ASC),
|
||||
INDEX `fk_likes_users1_idx` (`users_id` ASC),
|
||||
INDEX `likes_likes_idx` (`like` ASC),
|
||||
CONSTRAINT `fk_likes_videos1`
|
||||
FOREIGN KEY (`videos_id`)
|
||||
REFERENCES `videos` (`id`)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var autoHidingNavbarTimeout;
|
||||
function autoHideNavbar() {
|
||||
console.log("autoHidingNavbar");
|
||||
//console.log("autoHidingNavbar");
|
||||
autoHidingNavbarTimeout = setTimeout(function () {
|
||||
$("#mainNavBar").autoHidingNavbar("hide");
|
||||
}, autoHidingNavbarTimeoutMiliseconds);
|
||||
|
@ -8,7 +8,7 @@ function autoHideNavbar() {
|
|||
$(function () {
|
||||
autoHideNavbar();
|
||||
$("#mainNavBar").mouseover(function () {
|
||||
console.log("clearTimeout autoHidingNavbar");
|
||||
//console.log("clearTimeout autoHidingNavbar");
|
||||
clearTimeout(autoHidingNavbarTimeout);
|
||||
});
|
||||
$("#mainNavBar").mouseout(function () {
|
||||
|
|
23
updatedb/updateDb.v9.0.sql
Normal file
23
updatedb/updateDb.v9.0.sql
Normal file
|
@ -0,0 +1,23 @@
|
|||
-- this update we had to update the sweet alert, you may need to update all your plugins
|
||||
-- the filepath, in case we want to store the videos in a subdirectory of videos dir
|
||||
-- filesize to start to count how much space the user is consuming.
|
||||
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
|
||||
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
|
||||
|
||||
ALTER TABLE `videos`
|
||||
DROP FOREIGN KEY `fk_videos_sites1`,
|
||||
DROP FOREIGN KEY `fk_videos_playlists1`;
|
||||
|
||||
ALTER TABLE `videos`
|
||||
ADD INDEX `video_status_idx` (`status` ASC),
|
||||
ADD INDEX `video_type_idx` (`type` ASC) ;
|
||||
|
||||
ALTER TABLE `likes`
|
||||
ADD INDEX `likes_likes_idx` (`like` ASC);
|
||||
|
||||
UPDATE configurations SET version = '9.0', modified = now() WHERE id = 1;
|
||||
|
||||
SET SQL_MODE=@OLD_SQL_MODE;
|
||||
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
|
||||
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
Loading…
Add table
Add a link
Reference in a new issue