From 232606fb57e3c74b62aa78d49225e2bb3c0c9ab4 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Mon, 3 Feb 2020 23:42:47 +0100
Subject: add IF NOT EXISTS for indices

---
 src/auditordb/0001.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/auditordb/0001.sql')

diff --git a/src/auditordb/0001.sql b/src/auditordb/0001.sql
index 7f47f0357..3e666519c 100644
--- a/src/auditordb/0001.sql
+++ b/src/auditordb/0001.sql
@@ -115,7 +115,7 @@ CREATE TABLE IF NOT EXISTS auditor_reserves
   ,auditor_reserves_rowid BIGSERIAL UNIQUE
   ,origin_account TEXT
   );
-CREATE INDEX auditor_reserves_by_reserve_pub
+CREATE INDEX IF NOT EXISTS auditor_reserves_by_reserve_pub
   ON auditor_reserves
   (reserve_pub);
 -- Table with the sum of the balances of all customer reserves
@@ -203,7 +203,7 @@ CREATE TABLE IF NOT EXISTS auditor_historic_reserve_summary
   ,reserve_profits_val INT8 NOT NULL
   ,reserve_profits_frac INT4 NOT NULL
   );
-CREATE INDEX auditor_historic_reserve_summary_by_master_pub_start_date
+CREATE INDEX IF NOT EXISTS auditor_historic_reserve_summary_by_master_pub_start_date
   ON auditor_historic_reserve_summary
   (master_pub
   ,start_date);
-- 
cgit v1.2.3

