Prep for MS Teams plugin API (#25565)
* - columns added to ShareChannelRemotes: lastpostcreateat, lastpostupdateat - SyncMsg and SyncResponse moved to `model` package - field added to RemoteCluster struct: PluginID * sync new posts before updated posts to ensure post order in MS Teams * add plugid to remoteclusters table and store * don't sync history by default
Этот коммит содержится в:
@@ -230,6 +230,8 @@ channels/db/migrations/mysql/000115_user_reporting_changes.down.sql
|
||||
channels/db/migrations/mysql/000115_user_reporting_changes.up.sql
|
||||
channels/db/migrations/mysql/000116_create_outgoing_oauth_connections.down.sql
|
||||
channels/db/migrations/mysql/000116_create_outgoing_oauth_connections.up.sql
|
||||
channels/db/migrations/mysql/000117_msteams_shared_channels.down.sql
|
||||
channels/db/migrations/mysql/000117_msteams_shared_channels.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
|
||||
@@ -460,3 +462,5 @@ channels/db/migrations/postgres/000115_user_reporting_changes.down.sql
|
||||
channels/db/migrations/postgres/000115_user_reporting_changes.up.sql
|
||||
channels/db/migrations/postgres/000116_create_outgoing_oauth_connections.down.sql
|
||||
channels/db/migrations/postgres/000116_create_outgoing_oauth_connections.up.sql
|
||||
channels/db/migrations/postgres/000117_msteams_shared_channels.down.sql
|
||||
channels/db/migrations/postgres/000117_msteams_shared_channels.up.sql
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE table_name = 'RemoteClusters'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'PluginID'
|
||||
),
|
||||
'ALTER TABLE RemoteClusters DROP COLUMN PluginID;',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE removeColumnIfExists FROM @preparedStatement;
|
||||
EXECUTE removeColumnIfExists;
|
||||
DEALLOCATE PREPARE removeColumnIfExists;
|
||||
|
||||
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE table_name = 'SharedChannelRemotes'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'LastPostCreateAt'
|
||||
),
|
||||
'ALTER TABLE SharedChannelRemotes DROP COLUMN LastPostCreateAt;',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE removeColumnIfExists FROM @preparedStatement;
|
||||
EXECUTE removeColumnIfExists;
|
||||
DEALLOCATE PREPARE removeColumnIfExists;
|
||||
|
||||
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE table_name = 'SharedChannelRemotes'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'LastPostCreateID'
|
||||
),
|
||||
'ALTER TABLE SharedChannelRemotes DROP COLUMN LastPostCreateID;',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE removeColumnIfExists FROM @preparedStatement;
|
||||
EXECUTE removeColumnIfExists;
|
||||
DEALLOCATE PREPARE removeColumnIfExists;
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
NOT EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'RemoteClusters'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'PluginID'
|
||||
),
|
||||
'ALTER TABLE RemoteClusters ADD COLUMN PluginID varchar(190) NOT NULL DEFAULT \'\';',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE addColumnIfNotExists FROM @preparedStatement;
|
||||
EXECUTE addColumnIfNotExists;
|
||||
DEALLOCATE PREPARE addColumnIfNotExists;
|
||||
|
||||
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
NOT EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'SharedChannelRemotes'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'LastPostCreateAt'
|
||||
),
|
||||
'ALTER TABLE SharedChannelRemotes ADD COLUMN LastPostCreateAt bigint NOT NULL DEFAULT 0;',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE addColumnIfNotExists FROM @preparedStatement;
|
||||
EXECUTE addColumnIfNotExists;
|
||||
DEALLOCATE PREPARE addColumnIfNotExists;
|
||||
|
||||
|
||||
SET @preparedStatement = (SELECT IF(
|
||||
NOT EXISTS(
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'SharedChannelRemotes'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'LastPostCreateID'
|
||||
),
|
||||
'ALTER TABLE SharedChannelRemotes ADD COLUMN LastPostCreateID varchar(26);',
|
||||
'SELECT 1;'
|
||||
));
|
||||
|
||||
PREPARE addColumnIfNotExists FROM @preparedStatement;
|
||||
EXECUTE addColumnIfNotExists;
|
||||
DEALLOCATE PREPARE addColumnIfNotExists;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE RemoteClusters DROP COLUMN IF EXISTS PluginID;
|
||||
|
||||
ALTER TABLE SharedChannelRemotes DROP COLUMN IF EXISTS LastPostCreateAt;
|
||||
|
||||
ALTER TABLE SharedChannelRemotes DROP COLUMN IF EXISTS LastPostCreateID;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE RemoteClusters ADD COLUMN IF NOT EXISTS PluginID VARCHAR(190) NOT NULL DEFAULT '';
|
||||
|
||||
ALTER TABLE SharedChannelRemotes ADD COLUMN IF NOT EXISTS LastPostCreateAt bigint NOT NULL DEFAULT 0;
|
||||
|
||||
ALTER TABLE SharedChannelRemotes ADD COLUMN IF NOT EXISTS LastPostCreateID VARCHAR(26);
|
||||
|
||||
Ссылка в новой задаче
Block a user