-- artifact 'pointer' table

CREATE TABLE artifact_updates (
    id character varying(64) NOT NULL DEFAULT uuid_generate_v4(),
    product varchar(255) NOT NULL,
    version varchar(255) NOT NULL,
    uri varchar(2000) NOT NULL,
    sha1 varchar(255) NOT NULL,
    environment varchar(255) NOT NULL DEFAULT 'public'
);

ALTER TABLE artifact_updates ADD CONSTRAINT artifact_updates_uniqkey UNIQUE (product, version);

ALTER TABLE users ADD COLUMN environment varchar(255) NOT NULL DEFAULT 'public';
