can successfully add new users
This commit is contained in:
@@ -7,7 +7,7 @@ CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
-- Create roles table
|
||||
CREATE TABLE IF NOT EXISTS public.roles (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
name TEXT UNIQUE NOT NULL CHECK (name IN ('admin', 'conductor', 'analyst')),
|
||||
name TEXT UNIQUE NOT NULL CHECK (name IN ('admin', 'conductor', 'analyst', 'data recorder')),
|
||||
description TEXT NOT NULL,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
|
||||
@@ -46,9 +46,10 @@ CREATE TRIGGER set_updated_at_user_profiles
|
||||
FOR EACH ROW
|
||||
EXECUTE FUNCTION public.handle_updated_at();
|
||||
|
||||
-- Insert the three required roles
|
||||
-- Insert the four required roles
|
||||
INSERT INTO public.roles (name, description) VALUES
|
||||
('admin', 'Full system access with user management capabilities'),
|
||||
('conductor', 'Operational access for conducting experiments and managing data'),
|
||||
('analyst', 'Read-only access for data analysis and reporting')
|
||||
('analyst', 'Read-only access for data analysis and reporting'),
|
||||
('data recorder', 'Data entry and recording capabilities')
|
||||
ON CONFLICT (name) DO NOTHING;
|
||||
|
||||
Reference in New Issue
Block a user