From 936e0c20ecbce83160ae592b97fe5926f6e07e37 Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Mon, 8 Apr 2024 12:47:36 +0200 Subject: [PATCH] Script to update constraint --- migrations/074-unique-lock-update.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 migrations/074-unique-lock-update.sql diff --git a/migrations/074-unique-lock-update.sql b/migrations/074-unique-lock-update.sql new file mode 100644 index 0000000..135cef8 --- /dev/null +++ b/migrations/074-unique-lock-update.sql @@ -0,0 +1,5 @@ +-- existing contraint is (log_index, tx_id) and this does not work with multi-send transactions from gnosis safe +ALTER TABLE dschief.delegate_lock DROP CONSTRAINT delegate_lock_log_index_tx_id_key; + +-- add a new constraint that includes the lock value and the from_address (delegate contract) +ALTER TABLE dschief.delegate_lock ADD CONSTRAINT delegate_lock_key UNIQUE (log_index, tx_id, from_address, lock); \ No newline at end of file