From 81d668a5768c2831387191cc02a3a02ce395c92e Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 26 Apr 2013 13:43:44 +0200 Subject: [PATCH] Add SQL schema --- schema.sql | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 schema.sql diff --git a/schema.sql b/schema.sql new file mode 100644 index 0000000..17619d5 --- /dev/null +++ b/schema.sql @@ -0,0 +1,33 @@ +-- This is the database schema for PostgreSQL. + +begin; + +create table collection ( + path varchar primary key not null, + parent_path varchar references collection (path)); + +create table item ( + name varchar primary key not null, + tag varchar not null, + collection_path varchar references collection (path) not null); + +create table header ( + key varchar not null, + value varchar not null, + collection_path varchar references collection (path) not null, + primary key (key, collection_path)); + +create table line ( + key varchar not null, + value varchar not null, + item_name varchar references item (name) not null, + timestamp timestamp not null, + primary key (key, item_name)); + +create table property ( + key varchar not null, + value varchar not null, + collection_path varchar references collection (path) not null, + primary key (key, collection_path)); + +commit;