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
|
-- Copyright 2009 Canonical Ltd. This software is licensed under the
-- GNU Affero General Public License version 3 (see the file LICENSE).
-- update pg_ts_cfg set locale='en_AU.UTF-8' where ts_name = 'default';
-- Create some calendars
INSERT INTO Calendar (title, revision)
VALUES ('Sample Person\'s Calendar', 0);
UPDATE Person SET calendar = (SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
timezone = 'Australia/Perth'
WHERE id = (SELECT id from Person WHERE displayname = 'Sample Person');
INSERT INTO Calendar (title, revision)
VALUES ('Foo Bar\'s Calendar', 0);
UPDATE Person SET calendar = (SELECT id FROM Calendar WHERE title = 'Foo Bar\'s Calendar'),
timezone = 'Africa/Johannesburg'
WHERE id = (SELECT id from Person WHERE displayname = 'Foo Bar');
INSERT INTO Calendar (title, revision)
VALUES ('Ubuntu Project Calendar', 0);
UPDATE Project SET calendar = (SELECT id FROM Calendar WHERE title = 'Ubuntu Project Calendar')
WHERE id = (SELECT id from Project WHERE name = 'ubuntu');
-- Add some subscriptions for "Sample Person"
INSERT INTO CalendarSubscription (subject, object, colour)
VALUES ((SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
(SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
'#c0d0ff');
INSERT INTO CalendarSubscription (subject, object, colour)
VALUES ((SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
(SELECT id FROM Calendar WHERE title = 'Foo Bar\'s Calendar'),
'#c0ffc8');
INSERT INTO CalendarSubscription (subject, object, colour)
VALUES ((SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
(SELECT id FROM Calendar WHERE title = 'Ubuntu Project Calendar'),
'#faffd2');
-- Subscriptions for "Foo Bar"
INSERT INTO CalendarSubscription (subject, object, colour)
VALUES ((SELECT id FROM Calendar WHERE title = 'Foo Bar\'s Calendar'),
(SELECT id FROM Calendar WHERE title = 'Foo Bar\'s Calendar'),
'#c0ffc8');
INSERT INTO CalendarSubscription (subject, object, colour)
VALUES ((SELECT id FROM Calendar WHERE title = 'Foo Bar\'s Calendar'),
(SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
'#c0d0ff');
-- Add events to "Sample Person's Calendar"
INSERT INTO CalendarEvent (uid, calendar, dtstart, duration,
title, description, location)
VALUES ('sample-id-1@launchpad.example.org', (SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
'2005-01-03 08:00:00', '01:00:00', 'Event 1', 'Desc 1', 'Location');
INSERT INTO CalendarEvent (uid, calendar, dtstart, duration,
title, description, location)
VALUES ('sample-id-2@launchpad.example.org', (SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
'2005-01-03 10:00:00', '01:00:00', 'Event 2', 'Desc 2', 'Location');
INSERT INTO CalendarEvent (uid, calendar, dtstart, duration,
title, description, location)
VALUES ('sample-id-3@launchpad.example.org', (SELECT id FROM Calendar WHERE title = 'Sample Person\'s Calendar'),
'2005-01-04 08:00:00', '01:00:00', 'Event 1', 'Desc 1', 'Location');
-- Add events to "Foo Bar's Calendar"
INSERT INTO CalendarEvent (uid, calendar, dtstart, duration,
title, description, location)
VALUES ('sample-id-4@launchpad.example.org', (SELECT id FROM Calendar WHERE title = 'Foo Bar\'s Calendar'),
'2005-01-04 08:00:00', '01:00:00', 'Foo Bar 1', 'Desc 1', 'Location');
-- Add events to "Ubuntu Project Calendar"
INSERT INTO CalendarEvent (uid, calendar, dtstart, duration,
title, description, location)
VALUES ('sample-id-5@launchpad.example.org', (SELECT id from Calendar WHERE title = 'Ubuntu Project Calendar'),
'2004-12-06 08:00:00', '11 days 08:30:00', 'The Mataro Sessions', 'The Ubuntu conference in Mataro', 'Mataro, Spain');
|