mentorenwahl/docker/backend/db/migrations/20220120165204_create_user_roles.sql

15 lines
352 B
MySQL
Raw Normal View History

-- +micrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TYPE user_roles AS ENUM ('Admin', 'Teacher', 'Student');
ALTER TABLE
users
ADD
COLUMN role user_roles NOT NULL;
-- +micrate Down
-- SQL section 'Down' is executed when this migration is rolled back
ALTER TABLE
users DROP COLUMN role;
DROP TYPE user_roles;