1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-04-23 12:08:54 +02:00

43 lines
807 B
MySQL
Raw Normal View History

2018-11-19 11:55:41 +02:00
-- name: create_mailu_user!
2018-11-18 18:35:13 +02:00
-- Create the mailu user if it does not exist.
do $$
begin
create user mailu;
exception when others then
2018-11-19 11:55:41 +02:00
raise notice 'mailu user not created -- already exists';
end
$$;
-- name: create_health_user!
-- Create the mailu user if it does not exist.
do $$
begin
create user health;
exception when others then
raise notice 'health user not created -- already exists';
2018-11-18 18:35:13 +02:00
end
$$;
2018-11-30 13:54:12 +02:00
-- name: grant_health!
-- Grant connect permission for the health user
grant connect
on database postgres
to health;
2018-11-18 18:35:13 +02:00
-- name: update_pw!
alter
user mailu
password :pw;
-- name: check_db
-- check if the mailu db exists
select 1
from pg_database
where datname = 'mailu';
-- name: create_db!
-- create the mailu db
create
database mailu
owner mailu;