Skip to content
Snippets Groups Projects
Commit 639ccd43 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Update schema to use enum for archive identifier

parent b8b1152e
No related branches found
No related tags found
No related merge requests found
INSERT INTO archive(id, url)
VALUES('Banco', 'http://banco.softwareheritage.org:5003/');
gINSERT INTO archive(id, url)
VALUES('banco', 'http://banco.softwareheritage.org:5003/');
......@@ -13,7 +13,9 @@ comment on table dbversion is 'Schema update tracking';
INSERT INTO dbversion(version, release, description)
VALUES(1, now(), 'Work In Progress');
CREATE DOMAIN archive_id AS TEXT;
CREATE TYPE archive_id AS ENUM (
'banco'
);
CREATE TABLE archive (
id archive_id PRIMARY KEY,
......@@ -37,10 +39,10 @@ CREATE DOMAIN sha1 AS bytea CHECK (LENGTH(VALUE) = 20);
CREATE TABLE content_archive (
content_id sha1,
archive_id archive_id REFERENCES archive(id) DEFERRABLE,
archive_id archive_id REFERENCES archive(id),
status archive_status,
mtime timestamptz,
PRIMARY KEY (content_id, archive_id) DEFERRABLE
mtime timestamptz
PRIMARY KEY (content_id, archive_id)
);
comment on table content_archive is 'Referencing the status and whereabouts of a content';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment