1.1 --- a/conf/postgresql/schema.sql Sat Oct 08 23:16:53 2016 +0200
1.2 +++ b/conf/postgresql/schema.sql Sat Oct 08 23:45:25 2016 +0200
1.3 @@ -132,3 +132,55 @@
1.4 user_group varchar not null,
1.5 primary key(quota, store_user, user_group)
1.6 );
1.7 +
1.8 +-- Separate object store tables.
1.9 +
1.10 +create table journal_objects (
1.11 + store_user varchar not null,
1.12 + object_uid varchar not null,
1.13 + object_text varchar not null,
1.14 + status varchar not null, -- 'active', 'cancelled'
1.15 + primary key(store_user, object_uid)
1.16 +);
1.17 +
1.18 +create table journal_recurrences (
1.19 + store_user varchar not null,
1.20 + object_uid varchar not null,
1.21 + object_recurrenceid varchar not null,
1.22 + object_text varchar not null,
1.23 + status varchar not null, -- 'active', 'cancelled'
1.24 + primary key(store_user, object_uid, object_recurrenceid)
1.25 +);
1.26 +
1.27 +-- Separate object store free/busy details.
1.28 +
1.29 +create table journal_freebusy_other (
1.30 + store_user varchar not null,
1.31 + other varchar not null,
1.32 + "start" varchar not null,
1.33 + "end" varchar not null,
1.34 + object_uid varchar,
1.35 + transp varchar,
1.36 + object_recurrenceid varchar,
1.37 + summary varchar,
1.38 + organiser varchar,
1.39 + attendee varchar -- used by quotas
1.40 +);
1.41 +
1.42 +create index journal_freebusy_other_start on journal_freebusy_other(store_user, other, "start");
1.43 +create index journal_freebusy_other_end on journal_freebusy_other(store_user, other, "end");
1.44 +
1.45 +create table journal_freebusy_providers (
1.46 + store_user varchar not null,
1.47 + object_uid varchar not null,
1.48 + object_recurrenceid varchar
1.49 +);
1.50 +
1.51 +create index journal_freebusy_providers_store_user on journal_freebusy_providers(store_user);
1.52 +
1.53 +create table journal_freebusy_provider_datetimes (
1.54 + store_user varchar not null,
1.55 + "start" varchar
1.56 +);
1.57 +
1.58 +create index journal_freebusy_provider_datetimes_store_user on journal_freebusy_provider_datetimes(store_user);