From 1f6f4c29491ed972c616fc1f97b9c21b8600fec9 Mon Sep 17 00:00:00 2001 From: hjp Date: Tue, 24 Nov 2009 16:16:47 +0000 Subject: [PATCH] Added (experimental) schema for PostgreSQL. --- doc/schema.pgsql | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 doc/schema.pgsql diff --git a/doc/schema.pgsql b/doc/schema.pgsql new file mode 100644 index 0000000..6c04f59 --- /dev/null +++ b/doc/schema.pgsql @@ -0,0 +1,49 @@ +create table sessions ( + id serial primary key, + start_date int, + end_date int, + prefix varchar +); + +create table filesets ( + id serial primary key, + host varchar, + dir varchar, + options varchar +); + +create table files ( + id serial primary key, + path varchar, + fileset int references filesets(id) +); + +create table versions2 ( + id serial primary key, + file_type char(1), + file_size int8, + file_mtime int, + file_owner varchar, + file_group varchar, + file_acl varchar, + file_unix_bits bit(3), + file_rdev int, + checksum varchar, + file_linktarget varchar +); +create index versions2_file_mtime_idx on versions2(file_mtime); +create index versions2_checksum_idx on versions2(checksum); + +create table instances ( + id serial primary key, + file int references files(id), + file_id varchar, + date int, + online boolean, + session int references sessions(id), + version int references versions2(id) +); +create index instances_file_idx on instances(file); +create index instances_session_idx on instances(session); +create index instances_version_idx on instances(version); +