generated from VLADIMIR/template
add dev user script
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
|
||||
INSERT INTO users (username, email, password_hash, roles, is_active)
|
||||
VALUES (
|
||||
:'dev_username',
|
||||
:'dev_email',
|
||||
crypt(:'dev_password', gen_salt('bf')),
|
||||
'["admin", "author", "organizer", "user"]'::jsonb,
|
||||
TRUE
|
||||
)
|
||||
ON CONFLICT (email) DO UPDATE
|
||||
SET username = EXCLUDED.username,
|
||||
password_hash = EXCLUDED.password_hash,
|
||||
roles = EXCLUDED.roles,
|
||||
is_active = TRUE;
|
||||
|
||||
\echo 'Development user is ready.'
|
||||
\echo 'Login with the DEV_USER_EMAIL and DEV_USER_PASSWORD values passed to make.'
|
||||
Reference in New Issue
Block a user