gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -fix 0002-auditordb-scripts


From: gnunet
Subject: [taler-exchange] branch master updated: -fix 0002-auditordb-scripts
Date: Thu, 02 Nov 2023 23:51:43 +0100

This is an automated email from the git hooks/post-receive script.

nic-eigel pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 0442c228 -fix 0002-auditordb-scripts
     new 082728f8 Merge remote-tracking branch 'refs/remotes/origin/master'
0442c228 is described below

commit 0442c22857a83eb9291182a1a4d372f1ffb9203c
Author: Nic <nic@eigel.ch>
AuthorDate: Thu Nov 2 23:48:08 2023 +0100

    -fix 0002-auditordb-scripts
---
 src/auditordb/0002-auditor_balances.sql              | 20 +++++++++++++-------
 src/auditordb/0002-auditor_denomination_pending.sql  |  1 +
 .../0002-auditor_historic_denomination_revenue.sql   |  1 +
 .../0002-auditor_historic_reserve_summary.sql        |  1 +
 src/auditordb/0002-auditor_purses.sql                |  3 ++-
 src/auditordb/0002-auditor_reserves.sql              |  1 +
 src/auditordb/0002-deposit_confirmations.sql         |  1 +
 src/auditordb/auditor-0002.sql.in                    | 19 ++++++++++++-------
 8 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/src/auditordb/0002-auditor_balances.sql 
b/src/auditordb/0002-auditor_balances.sql
index 396381e0..5a25a0e2 100644
--- a/src/auditordb/0002-auditor_balances.sql
+++ b/src/auditordb/0002-auditor_balances.sql
@@ -14,13 +14,19 @@
 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 --
 
-CREATE TABLE IF NOT EXISTS auditor_balances (
-    balance_key TEXT PRIMARY KEY
-   ,balance_value taler_amount
-  );
-COMMENT ON TABLE auditor_balances
+SET search_path TO auditor;
+CREATE TABLE IF NOT EXISTS auditor_balances
+(
+    balance_key TEXT
+    ,balance_value taler_amount
+    ,PRIMARY KEY (balance_key)
+);
+COMMENT
+ON TABLE auditor_balances
   IS 'table storing various global balances of the auditor';
-COMMENT ON COLUMN auditor_balances.balance_key
+COMMENT
+ON COLUMN auditor_balances.balance_key
  IS 'unique name for the balance value';
-COMMENT ON COLUMN auditor_balances.balance_value
+COMMENT
+ON COLUMN auditor_balances.balance_value
  IS 'balance amount';
diff --git a/src/auditordb/0002-auditor_denomination_pending.sql 
b/src/auditordb/0002-auditor_denomination_pending.sql
index ea47dc0d..0dee6eca 100644
--- a/src/auditordb/0002-auditor_denomination_pending.sql
+++ b/src/auditordb/0002-auditor_denomination_pending.sql
@@ -14,6 +14,7 @@
 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 --
 
+SET search_path TO auditor;
 CREATE TABLE IF NOT EXISTS auditor_denomination_pending
   (denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64)
   ,denom_balance taler_amount NOT NULL
diff --git a/src/auditordb/0002-auditor_historic_denomination_revenue.sql 
b/src/auditordb/0002-auditor_historic_denomination_revenue.sql
index 98146aae..19c0b582 100644
--- a/src/auditordb/0002-auditor_historic_denomination_revenue.sql
+++ b/src/auditordb/0002-auditor_historic_denomination_revenue.sql
@@ -14,6 +14,7 @@
 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 --
 
+SET search_path TO auditor;
 CREATE TABLE IF NOT EXISTS auditor_historic_denomination_revenue
   (denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64)
   ,revenue_timestamp INT8 NOT NULL
diff --git a/src/auditordb/0002-auditor_historic_reserve_summary.sql 
b/src/auditordb/0002-auditor_historic_reserve_summary.sql
index e71ae8b7..819c4e16 100644
--- a/src/auditordb/0002-auditor_historic_reserve_summary.sql
+++ b/src/auditordb/0002-auditor_historic_reserve_summary.sql
@@ -14,6 +14,7 @@
 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 --
 
+SET search_path TO auditor;
 CREATE TABLE IF NOT EXISTS auditor_historic_reserve_summary
   (start_date INT8 PRIMARY KEY
   ,end_date INT8 NOT NULL
diff --git a/src/auditordb/0002-auditor_purses.sql 
b/src/auditordb/0002-auditor_purses.sql
index 9ba5955e..17fd5dde 100644
--- a/src/auditordb/0002-auditor_purses.sql
+++ b/src/auditordb/0002-auditor_purses.sql
@@ -14,6 +14,7 @@
 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 --
 
+SET search_path TO auditor;
 CREATE TABLE IF NOT EXISTS auditor_purses
   (auditor_purses_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
   ,purse_pub BYTEA PRIMARY KEY CHECK(LENGTH(purse_pub)=32)
@@ -21,5 +22,5 @@ CREATE TABLE IF NOT EXISTS auditor_purses
   ,target taler_amount NOT NULL
   ,expiration_date INT8 NOT NULL
   );
-COMMENT ON TABLE purses
+COMMENT ON TABLE auditor_purses
   IS 'all of the purses and their respective balances that the auditor is 
aware of';
diff --git a/src/auditordb/0002-auditor_reserves.sql 
b/src/auditordb/0002-auditor_reserves.sql
index 834d245e..1ed56be6 100644
--- a/src/auditordb/0002-auditor_reserves.sql
+++ b/src/auditordb/0002-auditor_reserves.sql
@@ -14,6 +14,7 @@
 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 --
 
+SET search_path TO auditor;
 CREATE TABLE IF NOT EXISTS auditor_reserves
   (auditor_reserves_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
   ,reserve_pub BYTEA PRIMARY KEY CHECK(LENGTH(reserve_pub)=32)
diff --git a/src/auditordb/0002-deposit_confirmations.sql 
b/src/auditordb/0002-deposit_confirmations.sql
index 1d63bdb6..e246e131 100644
--- a/src/auditordb/0002-deposit_confirmations.sql
+++ b/src/auditordb/0002-deposit_confirmations.sql
@@ -14,6 +14,7 @@
 -- TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
 --
 
+SET search_path TO auditor;
 CREATE TABLE IF NOT EXISTS deposit_confirmations
   (deposit_confirmation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY 
UNIQUE
   ,h_contract_terms BYTEA NOT NULL CHECK (LENGTH(h_contract_terms)=64)
diff --git a/src/auditordb/auditor-0002.sql.in 
b/src/auditordb/auditor-0002.sql.in
index ab0db2fb..3d07433e 100644
--- a/src/auditordb/auditor-0002.sql.in
+++ b/src/auditordb/auditor-0002.sql.in
@@ -24,13 +24,18 @@ COMMENT ON SCHEMA auditor IS 'taler-auditor data';
 SELECT _v.register_patch('auditor-0002', NULL, NULL);
 SET search_path TO auditor;
 
-CREATE TYPE taler_amount
-  AS
-  (val INT8
-  ,frac INT4
-  );
-COMMENT ON TYPE taler_amount
-  IS 'Stores an amount, fraction is in units of 1/100000000 of the base value';
+DO $$ BEGIN
+    CREATE TYPE taler_amount
+      AS
+      (val INT8
+      ,frac INT4
+      );
+    COMMENT ON TYPE taler_amount
+      IS 'Stores an amount, fraction is in units of 1/100000000 of the base 
value';
+EXCEPTION
+    WHEN duplicate_object THEN null;
+END $$;
+
 
 #include "0002-auditor_balances.sql"
 #include "0002-auditor_denomination_pending.sql"

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]