Update flake with postgres server
This commit is contained in:
@@ -2,7 +2,13 @@ alter table role_privileges drop constraint role_privileges_privileges_check;
|
||||
alter table role_privileges add constraint role_privileges_privileges_check
|
||||
check (privileges in ('LIST_USERS','ADD_USERS','LIST_QUIZZ','CREATE_QUIZZ','VIEW_ALL_FORMS'));
|
||||
|
||||
insert into role_privileges VALUES
|
||||
((select id from roles where "name" = 'ADMIN'),'CREATE_QUIZZ');
|
||||
insert into role_privileges VALUES
|
||||
((select id from roles where "name" = 'ADMIN'),'VIEW_ALL_FORMS');
|
||||
do $$
|
||||
begin
|
||||
if exists (select id from roles where "name" = 'ADMIN')
|
||||
then
|
||||
insert into role_privileges VALUES
|
||||
((select id from roles where "name" = 'ADMIN'),'CREATE_QUIZZ'),
|
||||
((select id from roles where "name" = 'ADMIN'),'VIEW_ALL_FORMS');
|
||||
end if;
|
||||
end
|
||||
$$
|
||||
Reference in New Issue
Block a user