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 8544884
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tapdb/sqlc/migrations/000007_universe.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ CREATE TABLE IF NOT EXISTS federation_global_sync_config (
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,
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,
group_key BLOB CHECK(LENGTH(group_key) = 32) NULL,

-- This field is an enum representing the proof type stored in the given
-- universe.
Expand All @@ -125,11 +125,11 @@ 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.
UNIQUE (asset_id, group_key, proof_type)
Expand Down

0 comments on commit 8544884

Please sign in to comment.