mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
db/migrations: drop nextsyncat and description columns from shared remotes (#25064)
This commit is contained in:
committed by
GitHub
parent
a4ece51391
commit
1cd439f8e0
@@ -224,6 +224,8 @@ channels/db/migrations/mysql/000112_rework_desktop_tokens.down.sql
|
||||
channels/db/migrations/mysql/000112_rework_desktop_tokens.up.sql
|
||||
channels/db/migrations/mysql/000113_create_retentionidsfordeletion_table.down.sql
|
||||
channels/db/migrations/mysql/000113_create_retentionidsfordeletion_table.up.sql
|
||||
channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql
|
||||
channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql
|
||||
channels/db/migrations/postgres/000001_create_teams.down.sql
|
||||
channels/db/migrations/postgres/000001_create_teams.up.sql
|
||||
channels/db/migrations/postgres/000002_create_team_members.down.sql
|
||||
@@ -448,3 +450,5 @@ channels/db/migrations/postgres/000112_rework_desktop_tokens.down.sql
|
||||
channels/db/migrations/postgres/000112_rework_desktop_tokens.up.sql
|
||||
channels/db/migrations/postgres/000113_create_retentionidsfordeletion_table.down.sql
|
||||
channels/db/migrations/postgres/000113_create_retentionidsfordeletion_table.up.sql
|
||||
channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql
|
||||
channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
-- It is intentionally to not have rollback for sharedchannelremotes_drop_nextsyncat_description
|
||||
@@ -0,0 +1,29 @@
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
(
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'SharedChannelRemotes'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'NextSyncAt'
|
||||
) > 0,
|
||||
'ALTER TABLE SharedChannelRemotes DROP COLUMN NextSyncAt;',
|
||||
'SELECT 1'
|
||||
));
|
||||
|
||||
PREPARE alterIfExists FROM @preparedStatement;
|
||||
EXECUTE alterIfExists;
|
||||
DEALLOCATE PREPARE alterIfExists;
|
||||
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
(
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'SharedChannelRemotes'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'Description'
|
||||
) > 0,
|
||||
'ALTER TABLE SharedChannelRemotes DROP COLUMN Description;',
|
||||
'SELECT 1'
|
||||
));
|
||||
|
||||
PREPARE alterIfExists FROM @preparedStatement;
|
||||
EXECUTE alterIfExists;
|
||||
DEALLOCATE PREPARE alterIfExists;
|
||||
@@ -0,0 +1 @@
|
||||
-- It is intentionally to not have rollback for sharedchannelremotes_drop_nextsyncat_description
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE sharedchannelremotes DROP COLUMN IF EXISTS nextsyncat;
|
||||
ALTER TABLE sharedchannelremotes DROP COLUMN IF EXISTS description;
|
||||
Reference in New Issue
Block a user