From f50a6206b443a998c2bf31ce530c41ea895c8de9 Mon Sep 17 00:00:00 2001 From: ssl Date: Sun, 4 Feb 2024 21:00:25 +0100 Subject: [PATCH] Moves alter varchar length to indexes file --- app/sql/4.1-4.2.sql | 6 +----- app/sql/4.2-indexes.sql | 12 +++++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/sql/4.1-4.2.sql b/app/sql/4.1-4.2.sql index 34fcf1fb..5c74fdd9 100644 --- a/app/sql/4.1-4.2.sql +++ b/app/sql/4.1-4.2.sql @@ -84,8 +84,4 @@ ALTER TABLE sessions DROP COLUMN dom, DROP COLUMN localstorage, DROP COLUMN sessionstorage, -DROP COLUMN console; - -ALTER TABLE `reports` CHANGE `payload` `payload` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL; -ALTER TABLE `sessions` CHANGE `payload` `payload` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL; -ALTER TABLE `sessions` CHANGE `origin` `origin` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL; \ No newline at end of file +DROP COLUMN console; \ No newline at end of file diff --git a/app/sql/4.2-indexes.sql b/app/sql/4.2-indexes.sql index 01ba5000..266382c7 100644 --- a/app/sql/4.2-indexes.sql +++ b/app/sql/4.2-indexes.sql @@ -6,13 +6,19 @@ ALTER TABLE reports ENGINE INNODB; ALTER TABLE settings ENGINE INNODB; ALTER TABLE reports ADD INDEX(archive); -ALTER TABLE reports ADD INDEX(payload); ALTER TABLE reports ADD INDEX(id); ALTER TABLE reports ADD INDEX(shareid); ALTER TABLE reports_data ADD INDEX(reportid); ALTER TABLE sessions ADD INDEX(id); -ALTER TABLE sessions ADD INDEX(payload); ALTER TABLE sessions ADD INDEX(clientid); +ALTER TABLE sessions_data ADD INDEX(sessionid); + +ALTER TABLE `reports` CHANGE `payload` `payload` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL; +ALTER TABLE `sessions` CHANGE `payload` `payload` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL; +ALTER TABLE `sessions` CHANGE `origin` `origin` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL; + +ALTER TABLE reports ADD INDEX(payload); +ALTER TABLE sessions ADD INDEX(payload); ALTER TABLE sessions ADD INDEX(origin); -ALTER TABLE sessions_data ADD INDEX(sessionid); \ No newline at end of file +