OpenMetadata/bootstrap/sql/mysql/v004__create_db_connection_info.sql
Matt bfcd97ed0b
Add support for default role (#2631)
- Add default field to role
- Amend GET /roles to query default roles
- Assign default role to new users being created
2022-02-06 15:28:15 -08:00

8 lines
305 B
SQL

-- Set default as false for all existing roles, to avoid unintended manipulation of roles during migration.
UPDATE role_entity
SET json = JSON_SET(json, '$.default', FALSE);
ALTER TABLE role_entity
ADD COLUMN `default` BOOLEAN GENERATED ALWAYS AS (JSON_EXTRACT(json, '$.default')),
ADD INDEX(`default`);