Skip to content

Commit

Permalink
fix(roles): ajout du role admin pour dev (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr authored Nov 28, 2022
1 parent a806afe commit 0301d4b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .kube-workflow/sql/post-restore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ TRUNCATE TABLE "auth"."users" CASCADE;

ALTER TABLE auth.users DISABLE TRIGGER USER;

WITH admin_row AS (
INSERT INTO auth.users (email, PASSWORD, name, default_role, active, id)
VALUES ('[email protected]', '$argon2i$v=19$m=4096,t=3,p=1$n9eoWSv+5sCgc7SjB5hLig$iBQ7NzrHHLkJSku/dCetNs+n/JI1CMdkWaoZsUekLU8', 'Administrateur', 'super', TRUE, 'd8b11bd2-dd16-4632-b5de-0e7021faadeb')
RETURNING
id, default_role)
INSERT INTO auth.user_roles (ROLE, user_id)
SELECT
default_role,
id
FROM
admin_row;

WITH admin_row AS (
INSERT INTO auth.users (email, PASSWORD, name, default_role, active, id)
VALUES ('[email protected]', '$argon2i$v=19$m=4096,t=3,p=1$PqKPf9cxunVLLtEcINHhWQ$CwHKhk71fc8LGp6BWbcFPzQ2ftOiHa7vUkp1eAqVHSM', 'Utilisateur', 'user', TRUE, '3d6dddc4-e117-4772-9288-cd8a608693e4')
Expand Down

0 comments on commit 0301d4b

Please sign in to comment.