4 -- Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 -- Licensed under the Apache License, Version 2.0 (the "License");
7 -- you may not use this file except in compliance with the License.
8 -- You may obtain a copy of the License at
10 -- http://www.apache.org/licenses/LICENSE-2.0
12 -- Unless required by applicable law or agreed to in writing, software
13 -- distributed under the License is distributed on an "AS IS" BASIS,
14 -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 -- See the License for the specific language governing permissions and
16 -- limitations under the License.
19 CREATE TABLE schedule_table
21 id INTEGER PRIMARY KEY AUTOINCREMENT,
31 timezone INTEGER DEFAULT 0,
38 meeting_status INTEGER,
40 original_event_id INTEGER DEFAULT -1,
46 completed_time INTEGER,
50 is_deleted INTEGER DEFAULT 0,
52 dtstart_utime INTEGER,
53 dtstart_datetime TEXT,
60 rrule_id INTEGER DEFAULT 0,
72 CREATE INDEX sch_idx1 ON schedule_table(type);
73 CREATE TRIGGER trg_sch_del AFTER DELETE ON schedule_table
75 DELETE FROM rrule_table WHERE event_id = old.id;
76 DELETE FROM alarm_table WHERE event_id = old.id;
77 DELETE FROM schedule_table WHERE original_event_id = old.id;
78 DELETE FROM normal_instance_table WHERE event_id = old.id;
79 DELETE FROM allday_instance_table WHERE event_id = old.id;
80 DELETE FROM attendee_table WHERE event_id = old.id;
81 DELETE FROM extended_table WHERE record_id = old.id AND record_type = 2;
82 DELETE FROM extended_table WHERE record_id = old.id AND record_type = 3;
85 CREATE TRIGGER trig_original_mod AFTER UPDATE OF is_deleted ON schedule_table
87 DELETE FROM normal_instance_table WHERE event_id = (SELECT rowid FROM schedule_table WHERE original_event_id = old.id);
88 DELETE FROM allday_instance_table WHERE event_id = (SELECT rowid FROM schedule_table WHERE original_event_id = old.id);
89 UPDATE schedule_table SET is_deleted = 1 WHERE original_event_id = old.id;
92 CREATE TABLE rrule_table
94 id INTEGER PRIMARY KEY AUTOINCREMENT,
96 freq INTEGER DEFAULT 0,
115 CREATE TABLE normal_instance_table
118 dtstart_utime INTEGER,
122 CREATE TABLE allday_instance_table
125 dtstart_datetime TEXT,
129 CREATE TABLE attendee_table
134 attendee_number TEXT,
135 attendee_status INTEGER,
136 attendee_type INTEGER,
137 attendee_ct_index INTEGER,
138 attendee_role INTEGER,
139 attendee_rsvp INTEGER,
141 attendee_delegator_uri TEXT,
142 attendee_delegate_uri TEXT,
146 CREATE TABLE calendar_table
148 id INTEGER PRIMARY KEY AUTOINCREMENT,
157 is_deleted INTEGER DEFAULT 0,
164 deleted INTEGER DEFAULT 0
167 CREATE TABLE timezone_table
169 id INTEGER PRIMARY KEY AUTOINCREMENT,
170 tz_offset_from_gmt INTEGER,
172 std_start_month INTEGER,
173 std_start_position_of_week INTEGER,
174 std_start_day INTEGER,
175 std_start_hour INTEGER,
176 standard_bias INTEGER,
178 day_light_start_month INTEGER,
179 day_light_start_position_of_week INTEGER,
180 day_light_start_day INTEGER,
181 day_light_start_hour INTEGER,
182 day_light_bias INTEGER,
186 CREATE TRIGGER trg_cal_del AFTER DELETE ON calendar_table
188 DELETE FROM timezone_table WHERE calendar_id = old.id;
189 DELETE FROM schedule_table WHERE calendar_id = old.id;
190 DELETE FROM extended_table WHERE record_id = old.id AND record_type = 1;
193 CREATE TABLE alarm_table
198 remind_tick_unit INTEGER,
200 alarm_description TEXT,
202 alarm_id INTEGER default 0
205 CREATE TABLE reminder_table
207 pkgname TEXT NOT NULL,
208 onoff INTEGER default 1,
212 INSERT INTO reminder_table VALUES('org.tizen.calendar', 1, NULL, NULL);
214 CREATE TABLE extended_table
216 id INTEGER PRIMARY KEY AUTOINCREMENT,
223 CREATE TABLE deleted_table
226 schedule_type INTEGER,
230 CREATE INDEX deleted_schedule_ver_idx ON deleted_table(deleted_ver);
232 CREATE TABLE version_table
234 ver INTEGER PRIMARY KEY
236 INSERT INTO version_table VALUES(0);
238 INSERT INTO calendar_table VALUES(1,0,0,'Default event calendar' ,0,'224.167.79.255',0,1,1,0,-1,1,0,0,0,0,0);
239 INSERT INTO calendar_table VALUES(2,0,0,'Default todo calendar' ,0,'41.177.227.255',0,1,1,0,-1,2,0,0,0,0,0);
240 INSERT INTO calendar_table VALUES(3,0,0,'Default birthday calendar',0,'141.17.27.255' ,0,1,0,0,-1,1,0,0,0,0,0);