nidus-sync/db/migrations/00065_user_roles.sql

12 lines
279 B
MySQL
Raw Permalink Normal View History

2026-02-18 07:02:36 +00:00
-- +goose Up
CREATE TYPE UserRole AS ENUM (
'root',
'account-owner'
);
ALTER TABLE user_ ADD COLUMN role UserRole;
UPDATE user_ SET role = 'account-owner';
ALTER TABLE user_ ALTER COLUMN role SET NOT NULL;
-- +goose Down
ALTER TABLE user_ DROP COLUMN role;
DROP TYPE UserRole;