Add Options field to RemoteClusters (#25771)
* add Option flag to RemoteClusters * add Options column to RemoteClusters table
Этот коммит содержится в:
@@ -234,6 +234,8 @@ channels/db/migrations/mysql/000117_msteams_shared_channels.down.sql
|
||||
channels/db/migrations/mysql/000117_msteams_shared_channels.up.sql
|
||||
channels/db/migrations/mysql/000118_create_index_poststats.down.sql
|
||||
channels/db/migrations/mysql/000118_create_index_poststats.up.sql
|
||||
channels/db/migrations/mysql/000119_msteams_shared_channels_opts.down.sql
|
||||
channels/db/migrations/mysql/000119_msteams_shared_channels_opts.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
|
||||
@@ -468,3 +470,5 @@ channels/db/migrations/postgres/000117_msteams_shared_channels.down.sql
|
||||
channels/db/migrations/postgres/000117_msteams_shared_channels.up.sql
|
||||
channels/db/migrations/postgres/000118_create_index_poststats.down.sql
|
||||
channels/db/migrations/postgres/000118_create_index_poststats.up.sql
|
||||
channels/db/migrations/postgres/000119_msteams_shared_channels_opts.down.sql
|
||||
channels/db/migrations/postgres/000119_msteams_shared_channels_opts.up.sql
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE table_name = 'RemoteClusters'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'Options'
|
||||
),
|
||||
'ALTER TABLE RemoteClusters DROP COLUMN Options;',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE removeColumnIfExists FROM @preparedStatement;
|
||||
EXECUTE removeColumnIfExists;
|
||||
DEALLOCATE PREPARE removeColumnIfExists;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
NOT EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'RemoteClusters'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'Options'
|
||||
),
|
||||
'ALTER TABLE RemoteClusters ADD COLUMN Options smallint NOT NULL DEFAULT 0;',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE addColumnIfNotExists FROM @preparedStatement;
|
||||
EXECUTE addColumnIfNotExists;
|
||||
DEALLOCATE PREPARE addColumnIfNotExists;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE RemoteClusters DROP COLUMN IF EXISTS Options;
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE RemoteClusters ADD COLUMN IF NOT EXISTS Options SMALLINT NOT NULL DEFAULT 0;
|
||||
|
||||
Ссылка в новой задаче
Block a user