Summary
errors during the database schema migration of the PostgreSQL database when starting up the 6.0.0 version with a PostgreSQL 13.4 database.
mattermost_db_1 | 2021-10-13 13:09:20.210 UTC [332] ERROR: default for column "timezone" cannot be cast automatically to type jsonb
mattermost_db_1 | 2021-10-13 13:09:20.210 UTC [332] STATEMENT: ALTER TABLE users ALTER COLUMN timezone TYPE jsonb USING timezone::jsonb;
Steps to reproduce
using the PostgreSQL queries from
This step fails:
ALTER TABLE users ALTER COLUMN timezone TYPE jsonb USING timezone::jsonb;
Expected behavior
migration should work without errors
Observed behavior
ALTER TABLE users ALTER COLUMN timezone TYPE jsonb USING timezone::jsonb;
ERROR: default for column "timezone" cannot be cast automatically to type jsonb
I was able to get this working, but I would have the MM team verify this is a fix.
On the Mattermost database (PostgreSQL)
ALTER TABLE users ALTER COLUMN timezone DROP DEFAULT;
ALTER TABLE users ALTER COLUMN timezone TYPE jsonb USING timezone::jsonb;
ALTER TABLE users ALTER COLUMN timezone SET DEFAULT '{"automaticTimezone":"","manualTimezone":"","useAutomaticTimezone":"true"}';
The last one may not be correct, but after doing this I was able to get MM 6.0.0 running.