gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: -migrate to Postgress 11: use BI


From: gnunet
Subject: [taler-merchant] branch master updated: -migrate to Postgress 11: use BIGINT GENERATED BY DEFAULT AS IDENTITY instead of BIGSERIAL
Date: Thu, 17 Feb 2022 23:08:50 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new d9e9f196 -migrate to Postgress 11: use BIGINT GENERATED BY DEFAULT AS 
IDENTITY instead of BIGSERIAL
d9e9f196 is described below

commit d9e9f196097e04c64d6f0575910200749ee03ea3
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Feb 17 23:08:47 2022 +0100

    -migrate to Postgress 11: use BIGINT GENERATED BY DEFAULT AS IDENTITY 
instead of BIGSERIAL
---
 src/backenddb/merchant-0001.sql | 26 +++++++++++++-------------
 src/backenddb/merchant-0003.sql |  2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/backenddb/merchant-0001.sql b/src/backenddb/merchant-0001.sql
index aaee8998..4a458259 100644
--- a/src/backenddb/merchant-0001.sql
+++ b/src/backenddb/merchant-0001.sql
@@ -23,7 +23,7 @@ SELECT _v.register_patch('merchant-0001', NULL, NULL);
 ---------------- Exchange information ---------------------------
 
 CREATE TABLE IF NOT EXISTS merchant_exchange_wire_fees
-  (wirefee_serial BIGSERIAL PRIMARY KEY
+  (wirefee_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,master_pub BYTEA NOT NULL CHECK (LENGTH(master_pub)=32)
   ,h_wire_method BYTEA NOT NULL CHECK (LENGTH(h_wire_method)=64)
   ,start_date INT8 NOT NULL
@@ -41,7 +41,7 @@ COMMENT ON COLUMN merchant_exchange_wire_fees.master_pub
  IS 'Master public key of the exchange with these wire fees';
 
 CREATE TABLE IF NOT EXISTS merchant_exchange_signing_keys
-  (signkey_serial BIGSERIAL PRIMARY KEY
+  (signkey_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,master_pub BYTEA NOT NULL CHECK (LENGTH(master_pub)=32)
   ,exchange_pub BYTEA NOT NULL CHECK (LENGTH(exchange_pub)=32)
   ,start_date INT8 NOT NULL
@@ -59,7 +59,7 @@ COMMENT ON COLUMN merchant_exchange_signing_keys.master_pub
 -------------------------- Instances  ---------------------------
 
 CREATE TABLE IF NOT EXISTS merchant_instances
-  (merchant_serial BIGSERIAL PRIMARY KEY
+  (merchant_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,merchant_pub BYTEA NOT NULL UNIQUE CHECK (LENGTH(merchant_pub)=32)
   ,merchant_id VARCHAR NOT NULL UNIQUE
   ,merchant_name VARCHAR NOT NULL
@@ -93,11 +93,11 @@ COMMENT ON TABLE merchant_keys
   IS 'private keys of instances that have not been deleted';
 
 CREATE TABLE IF NOT EXISTS merchant_accounts
-  (account_serial BIGSERIAL PRIMARY KEY
+  (account_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,merchant_serial BIGINT NOT NULL
      REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE
   ,h_wire BYTEA NOT NULL CHECK (LENGTH(h_wire)=64)
-  ,salt BYTEA NOT NULL CHECK (LENGTH(salt)=16) 
+  ,salt BYTEA NOT NULL CHECK (LENGTH(salt)=16)
   ,payto_uri VARCHAR NOT NULL
   ,active BOOLEAN NOT NULL
   ,UNIQUE (merchant_serial,payto_uri)
@@ -118,7 +118,7 @@ COMMENT ON COLUMN merchant_accounts.active
 -------------------------- Inventory  ---------------------------
 
 CREATE TABLE IF NOT EXISTS merchant_inventory
-  (product_serial BIGSERIAL PRIMARY KEY
+  (product_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,merchant_serial BIGINT NOT NULL
     REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE
   ,product_id VARCHAR NOT NULL
@@ -186,7 +186,7 @@ COMMENT ON COLUMN merchant_inventory_locks.expiration
 ---------------- Orders and contracts ---------------------------
 
 CREATE TABLE IF NOT EXISTS merchant_orders
-  (order_serial BIGSERIAL PRIMARY KEY
+  (order_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,merchant_serial BIGINT NOT NULL
     REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE
   ,order_id VARCHAR NOT NULL
@@ -291,7 +291,7 @@ CREATE INDEX IF NOT EXISTS 
merchant_contract_terms_by_merchant_session_and_fulfi
 ---------------- Payment and refunds ---------------------------
 
 CREATE TABLE IF NOT EXISTS merchant_deposits
-  (deposit_serial BIGSERIAL PRIMARY KEY
+  (deposit_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,order_serial BIGINT
      REFERENCES merchant_contract_terms (order_serial) ON DELETE CASCADE
   ,deposit_timestamp INT8 NOT NULL
@@ -324,7 +324,7 @@ COMMENT ON COLUMN merchant_deposits.wire_fee_val
   IS 'We MAY want to see if we should try to get this via 
merchant_exchange_wire_fees (not sure, may be too complicated with the date 
range, etc.)';
 
 CREATE TABLE IF NOT EXISTS merchant_refunds
-  (refund_serial BIGSERIAL PRIMARY KEY
+  (refund_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,order_serial BIGINT NOT NULL
      REFERENCES merchant_contract_terms (order_serial) ON DELETE CASCADE
   ,rtransaction_id BIGINT NOT NULL
@@ -358,7 +358,7 @@ COMMENT ON TABLE merchant_refund_proofs
 -------------------- Wire transfers ---------------------------
 
 CREATE TABLE IF NOT EXISTS merchant_transfers
-  (credit_serial BIGSERIAL PRIMARY KEY
+  (credit_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,exchange_url VARCHAR NOT NULL
   ,wtid BYTEA CHECK (LENGTH(wtid)=32)
   ,credit_amount_val INT8 NOT NULL
@@ -436,7 +436,7 @@ COMMENT ON COLUMN 
merchant_deposit_to_transfer.execution_time
 -------------------------- Tipping ---------------------------
 
 CREATE TABLE IF NOT EXISTS merchant_tip_reserves
-  (reserve_serial BIGSERIAL PRIMARY KEY
+  (reserve_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,reserve_pub BYTEA NOT NULL UNIQUE CHECK (LENGTH(reserve_pub)=32)
   ,merchant_serial BIGINT NOT NULL
     REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE
@@ -485,7 +485,7 @@ COMMENT ON TABLE merchant_tip_reserves
   IS 'private keys of reserves that have not been deleted';
 
 CREATE TABLE IF NOT EXISTS merchant_tips
-  (tip_serial BIGSERIAL PRIMARY KEY
+  (tip_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY
   ,reserve_serial BIGINT NOT NULL
      REFERENCES merchant_tip_reserves (reserve_serial) ON DELETE CASCADE
   ,tip_id BYTEA NOT NULL UNIQUE CHECK (LENGTH(tip_id)=64)
@@ -513,7 +513,7 @@ COMMENT ON COLUMN merchant_tips.expiration
   IS 'by when does the client have to pick up the tip';
 
 CREATE TABLE IF NOT EXISTS merchant_tip_pickups
-  (pickup_serial BIGSERIAL PRIMARY KEY NOT NULL
+  (pickup_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY NOT NULL
   ,tip_serial BIGINT NOT NULL
       REFERENCES merchant_tips (tip_serial) ON DELETE CASCADE
   ,pickup_id BYTEA NOT NULL UNIQUE CHECK (LENGTH(pickup_id)=64)
diff --git a/src/backenddb/merchant-0003.sql b/src/backenddb/merchant-0003.sql
index 370af625..1c9bff57 100644
--- a/src/backenddb/merchant-0003.sql
+++ b/src/backenddb/merchant-0003.sql
@@ -25,7 +25,7 @@ BEGIN;
 SELECT _v.register_patch('merchant-0003', NULL, NULL);
 
 CREATE TABLE IF NOT EXISTS merchant_kyc
-(kyc_serial_id BIGSERIAL UNIQUE
+(kyc_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
 ,kyc_timestamp INT8 NOT NULL
 ,kyc_ok BOOLEAN NOT NULL DEFAULT (FALSE)
 ,exchange_sig BYTEA CHECK(LENGTH(exchange_sig)=64)

-- 
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]