mirror of
https://github.com/hanzoai/team.git
synced 2026-10-30 14:49:35 +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
18 lines
564 B
SQL
18 lines
564 B
SQL
-- While upgrading from 5.x to 6.x with manual queries, there is a chance that this
|
|
-- migration is skipped. In that case, we need to make sure that the column is dropped.
|
|
|
|
SET @preparedStatement = (SELECT IF(
|
|
(
|
|
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
|
|
WHERE table_name = 'Posts'
|
|
AND table_schema = DATABASE()
|
|
AND column_name = 'ParentId'
|
|
) > 0,
|
|
'ALTER TABLE Posts DROP COLUMN ParentId;',
|
|
'SELECT 1'
|
|
));
|
|
|
|
PREPARE alterIfExists FROM @preparedStatement;
|
|
EXECUTE alterIfExists;
|
|
DEALLOCATE PREPARE alterIfExists;
|