From cf2e37cd876651e799893e8fe5babb51a9e12dd7 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Sun, 27 Nov 2022 21:21:04 +0100
Subject: more work on SQL refactoring

---
 src/exchangedb/0002-reserves.sql | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'src/exchangedb/0002-reserves.sql')

diff --git a/src/exchangedb/0002-reserves.sql b/src/exchangedb/0002-reserves.sql
index e5db97fe5..03d17aee2 100644
--- a/src/exchangedb/0002-reserves.sql
+++ b/src/exchangedb/0002-reserves.sql
@@ -94,6 +94,11 @@ DECLARE
   table_name VARCHAR DEFAULT 'reserves';
 BEGIN
   table_name = concat_ws('_', table_name, partition_suffix);
+  EXECUTE FORMAT (
+    'ALTER TABLE ' || table_name ||
+    ' ADD CONSTRAINT ' || table_name || '_unique_uuid'
+    ' UNIQUE (reserve_uuid)'
+  );
   EXECUTE FORMAT (
     'CREATE INDEX ' || table_name || '_by_expiration_index '
     'ON ' || table_name || ' '
-- 
cgit v1.2.3

