Merge remote-tracking branch 'origin/master' into cgen

This commit is contained in:
Mike McLean 2015-09-21 15:43:01 -04:00
commit d31e774a1c
13 changed files with 403 additions and 49 deletions

View file

@ -378,6 +378,22 @@ CREATE TABLE tag_config (
UNIQUE (tag_id,active)
) WITHOUT OIDS;
CREATE TABLE tag_extra (
tag_id INTEGER NOT NULL REFERENCES tag(id),
key TEXT NOT NULL,
value TEXT NOT NULL, -- TODO - move this to jsonb when we can
-- versioned - see desc above
create_event INTEGER NOT NULL REFERENCES events(id) DEFAULT get_event(),
revoke_event INTEGER REFERENCES events(id),
creator_id INTEGER NOT NULL REFERENCES users(id),
revoker_id INTEGER REFERENCES users(id),
active BOOLEAN DEFAULT 'true' CHECK (active),
CONSTRAINT active_revoke_sane CHECK (
(active IS NULL AND revoke_event IS NOT NULL AND revoker_id IS NOT NULL)
OR (active IS NOT NULL AND revoke_event IS NULL AND revoker_id IS NULL)),
PRIMARY KEY (create_event, tag_id, key),
UNIQUE (tag_id, key, active)
) WITHOUT OIDS;
-- the tag_updates table provides a mechanism to indicate changes relevant to tag
-- that are not reflected in a versioned table. For example: builds changing volumes,