2009-11-24 17:16:47 +01:00
|
|
|
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,
|
2016-06-08 21:48:33 +02:00
|
|
|
options varchar,
|
|
|
|
active boolean not null default 't'
|
2009-11-24 17:16:47 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|