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/channels.sql | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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

diff --git a/config/sql/channels.sql b/config/sql/channels.sql
index b5a29b8f..55772da6 100644
--- a/config/sql/channels.sql
+++ b/config/sql/channels.sql
@@ -2,7 +2,7 @@
 
 -- DROP TABLE public.channels;
 
-CREATE TABLE public.channels
+CREATE TABLE IF NOT EXISTS public.channels
 (
   id text NOT NULL,
   author text,
@@ -12,13 +12,13 @@ CREATE TABLE public.channels
   CONSTRAINT channels_id_key UNIQUE (id)
 );
 
-GRANT ALL ON TABLE public.channels TO kemal;
+GRANT ALL ON TABLE public.channels TO current_user;
 
 -- Index: public.channels_id_idx
 
 -- DROP INDEX public.channels_id_idx;
 
-CREATE INDEX channels_id_idx
+CREATE INDEX IF NOT EXISTS channels_id_idx
   ON public.channels
   USING btree
   (id COLLATE pg_catalog."default");
-- 
cgit v1.2.3

