Skip to content

Commit

Permalink
Moves alter varchar length to indexes file
Browse files Browse the repository at this point in the history
  • Loading branch information
ssl committed Feb 4, 2024
1 parent 5dcc7ef commit f50a620
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 1 addition & 5 deletions app/sql/4.1-4.2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
DROP COLUMN console;
12 changes: 9 additions & 3 deletions app/sql/4.2-indexes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit f50a620

Please sign in to comment.