aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/0002-policy_details.sql
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-11-27 21:21:04 +0100
committerChristian Grothoff <christian@grothoff.org>2022-11-27 21:21:04 +0100
commitcf2e37cd876651e799893e8fe5babb51a9e12dd7 (patch)
tree437047cc646fb1a3a86f4226fd5460bbe2b0c530 /src/exchangedb/0002-policy_details.sql
parentf2ba02aab2b9bbd976107ecc4ac7e7d657a9d73a (diff)
downloadexchange-cf2e37cd876651e799893e8fe5babb51a9e12dd7.tar.xz
more work on SQL refactoring
Diffstat (limited to 'src/exchangedb/0002-policy_details.sql')
-rw-r--r--src/exchangedb/0002-policy_details.sql18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/exchangedb/0002-policy_details.sql b/src/exchangedb/0002-policy_details.sql
index cd3c2f10e..c9bfd1575 100644
--- a/src/exchangedb/0002-policy_details.sql
+++ b/src/exchangedb/0002-policy_details.sql
@@ -16,8 +16,8 @@
-- FIXME: this table should be sharded!
-CREATE TABLE IF NOT EXISTS policy_details
- (policy_details_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY
+CREATE TABLE policy_details
+ (policy_details_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,policy_hash_code BYTEA PRIMARY KEY CHECK(LENGTH(policy_hash_code)=16)
,policy_json VARCHAR
,deadline INT8 NOT NULL
@@ -57,17 +57,3 @@ COMMENT ON COLUMN policy_details.fulfillment_state
- 5 (Timeout)';
COMMENT ON COLUMN policy_details.fulfillment_id
IS 'Reference to the proof of the fulfillment of this policy, if it exists. Invariant: If not NULL, this entry''s .hash_code MUST be part of the corresponding policy_fulfillments.policy_hash_codes array.';
-
-
-INSERT INTO exchange_tables
- (name
- ,version
- ,action
- ,partitioned
- ,by_range)
- VALUES
- ('policy_details'
- ,'exchange-0002'
- ,'create'
- ,FALSE -- BAD! FIXME!
- ,FALSE);