Skip to content

Commit

Permalink
fixup! tapdb+universe: add global and uni specific fed sync config
Browse files Browse the repository at this point in the history
  • Loading branch information
ffranr committed Oct 10, 2023
1 parent 9a40724 commit 3616bd6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tapdb/sqlc/migrations/000007_universe.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ CREATE TABLE IF NOT EXISTS federation_global_sync_config (
-- This table contains universe (asset/asset group) specific federation sync
-- configuration.
CREATE TABLE IF NOT EXISTS federation_uni_sync_config (
-- This field contains the byte serialized ID of the asset that this
-- configuration applies to.
asset_id BLOB, -- CHECK(length(asset_id) = 32) NULL,
-- This field contains the byte serialized ID of the asset to which this
-- configuration is applicable
asset_id BLOB CHECK(length(asset_id) = 32) NULL,

-- This field contains the byte serialized group key public key of the asset
-- group that this configuration applies to.
group_key BLOB, -- CHECK(LENGTH(group_key) = 32) NULL,
-- This field contains the byte serialized compressed group key public key
-- of the asset group to which this configuration is applicable.
group_key BLOB CHECK(LENGTH(group_key) = 33) NULL,

-- This field is an enum representing the proof type stored in the given
-- universe.
Expand All @@ -125,12 +125,12 @@ CREATE TABLE IF NOT EXISTS federation_uni_sync_config (
-- should accept remote proof export via federation sync.
allow_sync_export BOOLEAN NOT NULL,

-- -- Both the asset ID and group key cannot be null at the same time.
-- CHECK (
-- (asset_id IS NOT NULL AND group_key IS NULL) OR
-- (asset_id IS NULL AND group_key IS NOT NULL)
-- ),
-- Both the asset ID and group key cannot be null at the same time.
CHECK (
(asset_id IS NOT NULL AND group_key IS NULL) OR
(asset_id IS NULL AND group_key IS NOT NULL)
),

-- The primary key is the universe identifier: the asset ID and group key.
-- Ensure that the universe identifier fields form a unique tuple.
UNIQUE (asset_id, group_key, proof_type)
);

0 comments on commit 3616bd6

Please sign in to comment.