mirror of
https://github.com/hanzoai/team.git
synced 2026-11-01 07:55:31 +00:00
Combines the following repositories into one: https://github.com/mattermost/mattermost-server https://github.com/mattermost/mattermost-webapp https://github.com/mattermost/focalboard https://github.com/mattermost/mattermost-plugin-playbooks
30 lines
896 B
SQL
30 lines
896 B
SQL
SET @preparedStatement = (SELECT IF(
|
|
(
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS
|
|
WHERE table_name = 'Status'
|
|
AND table_schema = DATABASE()
|
|
AND index_name = 'idx_status_status_dndendtime'
|
|
) > 0,
|
|
'SELECT 1',
|
|
'CREATE INDEX idx_status_status_dndendtime ON Status(Status, DNDEndTime);'
|
|
));
|
|
|
|
PREPARE createIndexIfNotExists FROM @preparedStatement;
|
|
EXECUTE createIndexIfNotExists;
|
|
DEALLOCATE PREPARE createIndexIfNotExists;
|
|
|
|
SET @preparedStatement = (SELECT IF(
|
|
(
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS
|
|
WHERE table_name = 'Status'
|
|
AND table_schema = DATABASE()
|
|
AND index_name = 'idx_status_status'
|
|
) > 0,
|
|
'DROP INDEX idx_status_status ON Status;',
|
|
'SELECT 1'
|
|
));
|
|
|
|
PREPARE removeIndexIfExists FROM @preparedStatement;
|
|
EXECUTE removeIndexIfExists;
|
|
DEALLOCATE PREPARE removeIndexIfExists;
|