Make migrations (mostly) idempotent.

This commit is contained in:
Andre Borie 2021-01-17 01:44:31 +00:00
parent c7e65ce795
commit ffa9e5dfab
10 changed files with 33 additions and 33 deletions

View file

@ -2,7 +2,7 @@
-- DROP TABLE public.users;
CREATE TABLE public.users
CREATE TABLE IF NOT EXISTS public.users
(
updated timestamp with time zone,
notifications text[],
@ -16,13 +16,13 @@ CREATE TABLE public.users
CONSTRAINT users_email_key UNIQUE (email)
);
GRANT ALL ON TABLE public.users TO kemal;
GRANT ALL ON TABLE public.users TO current_user;
-- Index: public.email_unique_idx
-- DROP INDEX public.email_unique_idx;
CREATE UNIQUE INDEX email_unique_idx
CREATE UNIQUE INDEX IF NOT EXISTS email_unique_idx
ON public.users
USING btree
(lower(email) COLLATE pg_catalog."default");