CREATE TABLE "workspace" ( "id" int, "title" varchar(255) ); CREATE TABLE "category" ( "id" int PRIMARY KEY, "term" varchar(255), "label" varchar(255), "collection_id" int CONSTRAINT collection_id REFERENCES collection(id) ); CREATE TABLE "collection" ( "id" int, "title" varchar(255), "workspace_id" int CONSTRAINT workspace_id REFERENCES workspace(id) ); CREATE TABLE "accept" ( "id" int, "mime_type" varchar(255), "collection_id" int CONSTRAINT collection_id REFERENCES collection(id) ); CREATE TABLE "entry" ( "id" int, "title" varchar(255), "summary" varchar(255), "type" varchar(255), "content" varchar(255), "rights" varchar(255), "draft" bool, "updated" datetime, "published" datetime, "collection_id" int CONSTRAINT collection_id REFERENCES collection(id) ); CREATE TABLE "mediaentry" ( "id" int, "entry_id" int CONSTRAINT entry_id REFERENCES entry(id) ); CREATE TABLE "person" ( "id" int, "name" varchar(255), "email" varchar(255), "uri" varchar(255) ); CREATE TABLE "author" ( "entry_id" int CONSTRAINT entry_id REFERENCES entry(id), "person_id" int CONSTRAINT person_id REFERENCES person(id) ); CREATE TABLE "entry_category" ( "entry_id" int CONSTRAINT entry_id REFERENCES entry(id), "category_id" int CONSTRAINT category_id REFERENCES category(id) ); CREATE TABLE "contributor" ( "entry_id" int CONSTRAINT entry_id REFERENCES entry(id), "person_id" int CONSTRAINT person_id REFERENCES person(id) ); CREATE TABLE "link" ( "id" int, "title" varchar(255), "href" varchar(255), "rel" varchar(255), "entry_id" int CONSTRAINT entry_id REFERENCES entry(id) ); CREATE TABLE "source" ( "entry_id" int CONSTRAINT entry_id REFERENCES entry(id), "source_entry_id" int CONSTRAINT entry_id REFERENCES entry(id) );