From ffa9e5dfab7a1d7ea84d88007107f9f40295c50a Mon Sep 17 00:00:00 2001
From: Andre Borie <hi@rjevski.io>
Date: Sun, 17 Jan 2021 01:44:31 +0000
Subject: Make migrations (mostly) idempotent.

---
 config/sql/session_ids.sql | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'config/sql/session_ids.sql')

diff --git a/config/sql/session_ids.sql b/config/sql/session_ids.sql
index afbabb67..c493769a 100644
--- a/config/sql/session_ids.sql
+++ b/config/sql/session_ids.sql
@@ -2,7 +2,7 @@
 
 -- DROP TABLE public.session_ids;
 
-CREATE TABLE public.session_ids
+CREATE TABLE IF NOT EXISTS public.session_ids
 (
   id text NOT NULL,
   email text,
@@ -10,13 +10,13 @@ CREATE TABLE public.session_ids
   CONSTRAINT session_ids_pkey PRIMARY KEY (id)
 );
 
-GRANT ALL ON TABLE public.session_ids TO kemal;
+GRANT ALL ON TABLE public.session_ids TO current_user;
 
 -- Index: public.session_ids_id_idx
 
 -- DROP INDEX public.session_ids_id_idx;
 
-CREATE INDEX session_ids_id_idx
+CREATE INDEX IF NOT EXISTS session_ids_id_idx
   ON public.session_ids
   USING btree
   (id COLLATE pg_catalog."default");
-- 
cgit v1.2.3

