Summary
After upgrading to the latest Version 7.5.1 i wasn’t able to open the Mattermost boards.
When i take a look at the “Marcetplace” i see the following error message underneath the Mattermost Boards (7.5.1) entry:
Mattermost Boards(7.5.1)
cannot activate plugin: error initializing the DB: driver: mysql, message: failed when applying migration, command: apply_migration, originalError: Error 1050: Table 'focalboard_teams' already exists, query: RENAME TABLE focalboard_workspaces TO focalboard_teams; ALTER TABLE focalboard_blocks CHANGE workspace_id channel_id VARCHAR(36); ALTER TABLE focalboard_blocks_history CHANGE workspace_id channel_id VARCHAR(36); ALTER TABLE focalboard_blocks ADD COLUMN board_id VARCHAR(36); ALTER TABLE focalboard_blocks_history ADD COLUMN board_id VARCHAR(36); UPDATE focalboard_blocks SET fields = JSON_SET(fields, '$.columnCalculations', JSON_OBJECT()) WHERE JSON_EXTRACT(fields, '$.columnCalculations') = JSON_ARRAY(); UPDATE focalboard_blocks b JOIN ( SELECT id, JSON_EXTRACT(fields, '$.columnCalculations') as board_calculations from focalboard_blocks WHERE JSON_EXTRACT(fields, '$.columnCalculations') <> JSON_OBJECT() ) AS s on s.id = b.root_id SET fields = JSON_SET(fields, '$.columnCalculations', JSON_ARRAY(s.board_calculations)) WHERE JSON_EXTRACT(b.fields, '$.viewType') = 'table' AND b.type = 'view'; /* TODO: Migrate the columnCalculations at app level and remove it from the boards and boards_history tables */CREATE TABLE IF NOT EXISTS focalboard_boards ( id VARCHAR(36) NOT NULL PRIMARY KEY, insert_at DATETIME(6) NOT NULL DEFAULT NOW(6), team_id VARCHAR(36) NOT NULL, channel_id VARCHAR(36), created_by VARCHAR(36), modified_by VARCHAR(36), type VARCHAR(1) NOT NULL, title TEXT NOT NULL, description TEXT, icon VARCHAR(256), show_description BOOLEAN, is_template BOOLEAN, template_version INT DEFAULT 0, properties JSON, card_properties JSON, create_at BIGINT, update_at BIGINT, delete_at BIGINT ) DEFAULT CHARACTER SET utf8mb4; CREATE INDEX idx_board_team_id ON focalboard_boards(team_id, is_template); CREATE INDEX idx_board_channel_id ON focalboard_boards(channel_id); CREATE TABLE IF NOT EXISTS focalboard_boards_history ( id VARCHAR(36) NOT NULL, insert_at DATETIME(6) NOT NULL DEFAULT NOW(6), team_id VARCHAR(36) NOT NULL, channel_id VARCHAR(36), created_by VARCHAR(36), modified_by VARCHAR(36), type VARCHAR(1) NOT NULL, title TEXT NOT NULL, description TEXT, icon VARCHAR(256), show_description BOOLEAN, is_template BOOLEAN, template_version INT DEFAULT 0, properties JSON, card_properties JSON, create_at BIGINT, update_at BIGINT, delete_at BIGINT, PRIMARY KEY (id, insert_at) ) DEFAULT CHARACTER SET utf8mb4; INSERT INTO focalboard_boards ( SELECT B.id, B.insert_at, C.TeamId, B.channel_id, B.created_by, B.modified_by, C.Type, COALESCE(B.title, ''), COALESCE(JSON_UNQUOTE(JSON_EXTRACT(B.fields,'$.description')), ''), JSON_UNQUOTE(JSON_EXTRACT(B.fields,'$.icon')), COALESCE(JSON_EXTRACT(B.fields, '$.showDescription'), 'false') = 'true', COALESCE(JSON_EXTRACT(B.fields, '$.isTemplate'), 'false') = 'true', COALESCE(JSON_EXTRACT(B.fields, '$.templateVer'), 0), '{}', JSON_EXTRACT(B.fields, '$.cardProperties'), B.create_at, B.update_at, B.delete_at FROM focalboard_blocks AS B INNER JOIN Channels AS C ON C.Id=B.channel_id WHERE B.type='board' ); INSERT INTO focalboard_boards_history ( SELECT B.id, B.insert_at, C.TeamId, B.channel_id, B.created_by, B.modified_by, C.Type, COALESCE(B.title, ''), COALESCE(JSON_UNQUOTE(JSON_EXTRACT(B.fields,'$.description')), ''), JSON_UNQUOTE(JSON_EXTRACT(B.fields,'$.icon')), COALESCE(JSON_EXTRACT(B.fields, '$.showDescription'), 'false') = 'true', COALESCE(JSON_EXTRACT(B.fields, '$.isTemplate'), 'false') = 'true', COALESCE(JSON_EXTRACT(B.fields, '$.templateVer'), 0), '{}', JSON_EXTRACT(B.fields, '$.cardProperties'), B.create_at, B.update_at, B.delete_at FROM focalboard_blocks_history AS B INNER JOIN Channels AS C ON C.Id=B.channel_id WHERE B.type='board' ); UPDATE focalboard_blocks SET board_id=root_id; UPDATE focalboard_blocks_history SET board_id=root_id;DELETE FROM focalboard_blocks WHERE type = 'board'; DELETE FROM focalboard_blocks_history WHERE type = 'board';CREATE TABLE IF NOT EXISTS focalboard_board_members ( board_id VARCHAR(36) NOT NULL, user_id VARCHAR(36) NOT NULL, roles VARCHAR(64), scheme_admin BOOLEAN, scheme_editor BOOLEAN, scheme_commenter BOOLEAN, scheme_viewer BOOLEAN, PRIMARY KEY (board_id, user_id) ) DEFAULT CHARACTER SET utf8mb4; CREATE INDEX idx_boardmembers_user_id ON focalboard_board_members(user_id); INSERT INTO focalboard_board_members ( SELECT B.Id, CM.UserId, CM.Roles, TRUE, TRUE, FALSE, FALSE FROM focalboard_boards AS B INNER JOIN ChannelMembers as CM ON CM.ChannelId=B.channel_id WHERE CM.SchemeAdmin=True OR (CM.UserId=B.created_by) );
Steps to reproduce
Expected behavior
Observed behavior
I can’t open the boards any more.