diff --git a/server/channels/db/migrations/migrations.list b/server/channels/db/migrations/migrations.list index 559c7d0a266..d2c41d3f2e7 100644 --- a/server/channels/db/migrations/migrations.list +++ b/server/channels/db/migrations/migrations.list @@ -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 diff --git a/server/channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql b/server/channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql new file mode 100644 index 00000000000..b7ce52c9390 --- /dev/null +++ b/server/channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql @@ -0,0 +1 @@ +-- It is intentionally to not have rollback for sharedchannelremotes_drop_nextsyncat_description diff --git a/server/channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql b/server/channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql new file mode 100644 index 00000000000..90c3e833225 --- /dev/null +++ b/server/channels/db/migrations/mysql/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql @@ -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; diff --git a/server/channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql b/server/channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql new file mode 100644 index 00000000000..b7ce52c9390 --- /dev/null +++ b/server/channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.down.sql @@ -0,0 +1 @@ +-- It is intentionally to not have rollback for sharedchannelremotes_drop_nextsyncat_description diff --git a/server/channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql b/server/channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql new file mode 100644 index 00000000000..2bff90ba132 --- /dev/null +++ b/server/channels/db/migrations/postgres/000114_sharedchannelremotes_drop_nextsyncat_description.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE sharedchannelremotes DROP COLUMN IF EXISTS nextsyncat; +ALTER TABLE sharedchannelremotes DROP COLUMN IF EXISTS description;