   BEGIN
     BEGIN
       CREATE SEQUENCE "integration"."integration_id_seq" INCREMENT 1 START 1 MAXVALUE 9223372036854775807 MINVALUE 1 CACHE 1;
+    EXCEPTION WHEN duplicate_table THEN
+      RAISE NOTICE 'integration.integration_id_seq sequence already exists';
     END;
+  END;
+$$;
+
+DO $$
+  BEGIN
+    BEGIN
       CREATE SEQUENCE "integration"."channel_integration_id_seq" INCREMENT 1 START 1 MAXVALUE 9223372036854775807 MINVALUE 1 CACHE 1;
+    EXCEPTION WHEN duplicate_table THEN
+      RAISE NOTICE 'integration.channel_integration_id_seq sequence already exists';
+    END;
   END;
 $$;
 

DO $$
  BEGIN
    BEGIN
      CREATE SCHEMA integration;

    END;
  END;
$$;


GRANT SELECT, INSERT, UPDATE ON "integration"."channel_integration" TO "social";

DO $$
  BEGIN
    BEGIN
      CREATE INDEX  "channel_integration_token_idx" ON integration.channel_integration USING btree(token DESC NULLS LAST);
    EXCEPTION WHEN duplicate_table THEN
      RAISE NOTICE 'channel_integration_token_idx index already exists';
    END;
  END;
$$;



--
