## Steps to reproduce the behavior
1. Upgraded Mattermost server from v7.2 to… v7.3
2. After the Mattermost service was restarted, boards within Mattermost were no longer listed as an option (in the Channel, Boards, Playbooks dropdown)
3. Disabled and reenabled the boards plugin following a similar issue from here https://community.mattermost.com/core/pl/rpttbwstwpbbxcrsgg3d68ikwc - nothing worked
4. While disabling and reenabling upgraded the boards plugin from v7.0.1 to v7.2.1, there's a migration error (listed below)
5. Followed the steps from here https://github.com/mattermost/focalboard/issues/3697#issuecomment-1220817563 to adjust some database items, and after trying a disable/re-enable of the plugin, the migration continued to fail
## Expected behavior
Upgrading the Mattermost server should upgrade the internal boards plugin as well. During that time, all migrations should perform correctly and have it upgrade the data to be compatible between the versions.
## Screenshots (optional)


## Edition and Platform
- Edition:
- Mattermost Server v7.3
- Boards Plugin - v7.2.1
- Self-hosted
- Browser and OS:
- Browser - Microsoft Edge Version 107.0.1379.1
- OS - Windows 11
- Server - Ubuntu
## Additional context (optional)
Output of error message
```
This plugin failed to start. 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', cast('{}' as json)) WHERE fields->'$.columnCalculations' = cast('[]' as json);
UPDATE focalboard_blocks b JOIN ( SELECT id, fields->'$.columnCalculations' as board_calculations from focalboard_blocks WHERE fields -> '$.columnCalculations' <> cast('{}' as json) ) AS s on s.id = b.root_id SET fields = JSON_SET(fields, '$.columnCalculations', cast(s.board_calculations as json)) WHERE 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(B.fields->'$.showDescription', 'false') = 'true', COALESCE(JSON_EXTRACT(B.fields, '$.isTemplate'), 'false') = 'true', COALESCE(B.fields->'$.templateVer', 0), '{}', 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(B.fields->'$.showDescription', 'false') = 'true', COALESCE(JSON_EXTRACT(B.fields, '$.isTemplate'), 'false') = 'true', COALESCE(B.fields->'$.templateVer', 0), '{}', 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) );
```
Add any other context about the problem here, and any notes about the severity:
* Sev 1: Affects critical functionality without a workaround