mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57: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
15 lines
373 B
SQL
15 lines
373 B
SQL
DO $$
|
|
DECLARE
|
|
column_exist boolean := false;
|
|
BEGIN
|
|
SELECT count(*) != 0 INTO column_exist
|
|
FROM information_schema.columns
|
|
WHERE table_name = 'sessions'
|
|
AND table_schema = current_schema()
|
|
AND column_name = 'roles'
|
|
AND NOT data_type = 'varchar(64)';
|
|
IF column_exist THEN
|
|
ALTER TABLE sessions ALTER COLUMN roles TYPE varchar(64);
|
|
END IF;
|
|
END $$;
|