From 30b70b74668ba078ea53b6f6868a3f5853fecb10 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 16 Jun 2020 12:57:25 -0300 Subject: [PATCH] Version 9.1 adding some indexes on the database to speedup video queries --- install/checkConfiguration.php | 2 +- install/database.sql | 1 + updatedb/updateDb.v9.1.sql | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 updatedb/updateDb.v9.1.sql diff --git a/install/checkConfiguration.php b/install/checkConfiguration.php index 5fd43b305b..e9c9624826 100644 --- a/install/checkConfiguration.php +++ b/install/checkConfiguration.php @@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) { exit; } -$installationVersion = "9.0"; +$installationVersion = "9.1"; header('Content-Type: application/json'); diff --git a/install/database.sql b/install/database.sql index 00de23aa7f..3d0b999d6e 100644 --- a/install/database.sql +++ b/install/database.sql @@ -79,6 +79,7 @@ CREATE TABLE IF NOT EXISTS `categories` ( INDEX `fk_categories_users1_idx` (`users_id` ASC), INDEX `clean_name_INDEX2` (`clean_name` ASC), INDEX `sortcategoryOrderIndex` (`order` ASC), + INDEX `category_name_idx` (`name` ASC), UNIQUE INDEX `clean_name_UNIQUE` (`clean_name` ASC), CONSTRAINT `fk_categories_users1` FOREIGN KEY (`users_id`) diff --git a/updatedb/updateDb.v9.1.sql b/updatedb/updateDb.v9.1.sql new file mode 100644 index 0000000000..a79581c8e7 --- /dev/null +++ b/updatedb/updateDb.v9.1.sql @@ -0,0 +1,15 @@ +-- 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 `categories` +ADD INDEX `category_name_idx` (`name` ASC); + +UPDATE configurations SET version = '9.1', 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;