File: schema.sql

package info (click to toggle)
imip-agent 0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,056 kB
  • sloc: python: 9,888; sh: 4,480; sql: 144; makefile: 8
file content (186 lines) | stat: -rw-r--r-- 5,068 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
-- Object store tables.

create table objects (
    store_user varchar not null,
    object_uid varchar not null,
    object_text varchar not null,
    status varchar not null, -- 'active', 'cancelled'
    primary key(store_user, object_uid)
);

create table countered_objects (
    store_user varchar not null,
    other varchar not null,
    object_uid varchar not null,
    object_text varchar not null,
    primary key(store_user, object_uid)
);

create table recurrences (
    store_user varchar not null,
    object_uid varchar not null,
    object_recurrenceid varchar not null,
    object_text varchar not null,
    status varchar not null, -- 'active', 'cancelled'
    primary key(store_user, object_uid, object_recurrenceid)
);

create table countered_recurrences (
    store_user varchar not null,
    other varchar not null,
    object_uid varchar not null,
    object_recurrenceid varchar not null,
    object_text varchar not null,
    primary key(store_user, object_uid, object_recurrenceid)
);

-- Object store free/busy details.

create table freebusy (
    store_user varchar not null,
    "start" varchar not null,
    "end" varchar not null,
    object_uid varchar,
    transp varchar,
    object_recurrenceid varchar,
    summary varchar,
    organiser varchar
);

create index freebusy_start on freebusy(store_user, "start");
create index freebusy_end on freebusy(store_user, "end");

create table freebusy_offers (
    store_user varchar not null,
    "start" varchar not null,
    "end" varchar not null,
    object_uid varchar,
    transp varchar,
    object_recurrenceid varchar,
    summary varchar,
    organiser varchar,
    expires varchar
);

create index freebusy_offers_start on freebusy_offers(store_user, "start");
create index freebusy_offers_end on freebusy_offers(store_user, "end");

create table freebusy_other (
    store_user varchar not null,
    other varchar not null,
    "start" varchar not null,
    "end" varchar not null,
    object_uid varchar,
    transp varchar,
    object_recurrenceid varchar,
    summary varchar,
    organiser varchar,
    attendee varchar -- used by quotas
);

create index freebusy_other_start on freebusy_other(store_user, other, "start");
create index freebusy_other_end on freebusy_other(store_user, other, "end");

create table freebusy_providers (
    store_user varchar not null,
    object_uid varchar not null,
    object_recurrenceid varchar
);

create index freebusy_providers_store_user on freebusy_providers(store_user);

create table freebusy_provider_datetimes (
    store_user varchar not null,
    "start" varchar
);

create index freebusy_provider_datetimes_store_user on freebusy_provider_datetimes(store_user);

-- Object store request details.

create table requests (
    store_user varchar not null,
    object_uid varchar not null,
    object_recurrenceid varchar,
    request_type varchar
);

create index requests_object_uid on requests(store_user, object_uid);



-- Journal store tables.

create table quota_delegates (
    quota varchar not null,
    store_user varchar not null,
    primary key(quota, store_user)
);

-- Journal user groups and limits.

create table quota_limits (
    quota varchar not null,
    user_group varchar not null,
    quota_limit varchar not null,
    primary key(quota, user_group)
);

create table user_groups (
    quota varchar not null,
    store_user varchar not null,
    user_group varchar not null,
    primary key(quota, store_user, user_group)
);

-- Separate object store tables.

create table journal_objects (
    store_user varchar not null,
    object_uid varchar not null,
    object_text varchar not null,
    status varchar not null, -- 'active', 'cancelled'
    primary key(store_user, object_uid)
);

create table journal_recurrences (
    store_user varchar not null,
    object_uid varchar not null,
    object_recurrenceid varchar not null,
    object_text varchar not null,
    status varchar not null, -- 'active', 'cancelled'
    primary key(store_user, object_uid, object_recurrenceid)
);

-- Separate object store free/busy details.

create table journal_freebusy_other (
    store_user varchar not null,
    other varchar not null,
    "start" varchar not null,
    "end" varchar not null,
    object_uid varchar,
    transp varchar,
    object_recurrenceid varchar,
    summary varchar,
    organiser varchar,
    attendee varchar -- used by quotas
);

create index journal_freebusy_other_start on journal_freebusy_other(store_user, other, "start");
create index journal_freebusy_other_end on journal_freebusy_other(store_user, other, "end");

create table journal_freebusy_providers (
    store_user varchar not null,
    object_uid varchar not null,
    object_recurrenceid varchar
);

create index journal_freebusy_providers_store_user on journal_freebusy_providers(store_user);

create table journal_freebusy_provider_datetimes (
    store_user varchar not null,
    "start" varchar
);

create index journal_freebusy_provider_datetimes_store_user on journal_freebusy_provider_datetimes(store_user);