2 PRAGMA foreign_keys = ON;
6 CREATE_TABLE(WidgetInfo)
7 COLUMN_NOT_NULL(app_id, INTEGER, PRIMARY KEY AUTOINCREMENT)
8 COLUMN(widget_type, INT, DEFAULT 1)
9 COLUMN(widget_id, TEXT, DEFAULT '')
10 COLUMN(widget_version, TEXT, DEFAULT '')
11 COLUMN(widget_width, INT, DEFAULT 0)
12 COLUMN(widget_height, INT, DEFAULT 0)
13 COLUMN(author_name, TEXT, DEFAULT '')
14 COLUMN(author_email, TEXT, DEFAULT '')
15 COLUMN(author_href, TEXT, DEFAULT '')
16 COLUMN(csp_policy, TEXT, DEFAULT '')
17 COLUMN(csp_policy_report_only, TEXT, DEFAULT '')
18 COLUMN(min_version, TEXT, DEFAULT '1.0')
19 COLUMN_NOT_NULL(back_supported, TINYINT, DEFAULT 0)
20 COLUMN(defaultlocale, TEXT, DEFAULT 0)
21 COLUMN_NOT_NULL(tizen_pkgid, TEXT, DEFAULT '')
22 COLUMN_NOT_NULL(tizen_appid, TEXT, DEFAULT 0 UNIQUE)
23 COLUMN(pkg_type, INT, DEFAULT 0)
24 COLUMN(security_model_version, INT, DEFAULT 0)
28 CREATE INDEX IF NOT EXISTS WidgetInfo_AppidIndex ON WidgetInfo(tizen_appid);
31 CREATE_TABLE(WidgetCertificate)
32 COLUMN_NOT_NULL(app_id, INT,)
33 COLUMN_NOT_NULL(cert_source, INT, CHECK(cert_source between 0 and 2))
34 COLUMN_NOT_NULL(encoded_chain, VARCHAR(16000),)
36 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
40 CREATE_TABLE(WidgetWindowModes)
41 COLUMN_NOT_NULL(app_id, INT,)
42 COLUMN_NOT_NULL(window_mode, VARCHAR(256),)
44 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
48 CREATE_TABLE(LocalizedWidgetInfo)
49 COLUMN_NOT_NULL(app_id, INT,)
50 COLUMN_NOT_NULL(widget_locale, TEXT,)
51 COLUMN(widget_name, TEXT,)
52 COLUMN(widget_shortname, TEXT,)
53 COLUMN(widget_description, TEXT,)
54 COLUMN(widget_license, TEXT,)
55 COLUMN(widget_license_file, TEXT,)
56 COLUMN(widget_license_href, TEXT,)
59 PRIMARY KEY (app_id, widget_locale),
60 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
64 CREATE_TABLE(WidgetExtendedInfo)
65 COLUMN_NOT_NULL(app_id, INTEGER, PRIMARY KEY)
66 COLUMN(install_time, BIGINT, DEFAULT 0)
67 COLUMN(updated, INT, DEFAULT 0)
68 COLUMN(splash_img_src, TEXT, DEFAULT '')
69 COLUMN(background_page, TEXT, DEFAULT '')
70 COLUMN(installed_path, TEXT, DEFAULT '')
72 FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
76 CREATE_TABLE(WidgetPreference)
77 COLUMN_NOT_NULL(app_id, INTEGER,)
78 COLUMN_NOT_NULL(tizen_appid, TEXT, DEFAULT 0)
79 COLUMN_NOT_NULL(key_name, TEXT,)
80 COLUMN(key_value, TEXT, DEFAULT '')
81 COLUMN(readonly, INT, DEFAULT 0)
84 PRIMARY KEY(app_id, key_name),
85 FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
89 CREATE_TABLE(WidgetFeature)
90 COLUMN_NOT_NULL(widget_feature_id, INTEGER, primary key autoincrement)
91 COLUMN_NOT_NULL(app_id, INT,)
92 COLUMN_NOT_NULL(name, TEXT,)
93 COLUMN_NOT_NULL(rejected, INT,)
95 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
99 CREATE_TABLE(WidgetPrivilege)
100 COLUMN_NOT_NULL(widget_privilege_id, INTEGER, primary key autoincrement)
101 COLUMN_NOT_NULL(app_id, INT,)
102 COLUMN_NOT_NULL(name, TEXT,)
104 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
108 CREATE_TABLE(WidgetIcon)
109 COLUMN_NOT_NULL(icon_id, INTEGER, primary key autoincrement)
110 COLUMN_NOT_NULL(app_id, INT,)
111 COLUMN_NOT_NULL(icon_src, TEXT,)
112 COLUMN(icon_width, INT, DEFAULT 0)
113 COLUMN(icon_height, INT, DEFAULT 0)
115 FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
119 CREATE_TABLE(WidgetLocalizedIcon)
120 COLUMN_NOT_NULL(app_id, INT,) /* TODO key duplicated for efficiency - ORM doesn't support JOIN */
121 COLUMN_NOT_NULL(icon_id, INTEGER,)
122 COLUMN_NOT_NULL(widget_locale, TEXT,)
124 FOREIGN KEY(icon_id) REFERENCES WidgetIcon (icon_id) ON DELETE CASCADE,
125 PRIMARY KEY(icon_id, widget_locale)
129 CREATE_TABLE(WidgetStartFile)
130 COLUMN_NOT_NULL(start_file_id, INTEGER, primary key autoincrement)
131 COLUMN_NOT_NULL(app_id, INT,)
132 COLUMN_NOT_NULL(src, TEXT,)
134 FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
138 CREATE_TABLE(WidgetLocalizedStartFile)
139 COLUMN_NOT_NULL(app_id, INT,) /* TODO key duplicated for efficiency - ORM doesn't support JOIN */
140 COLUMN_NOT_NULL(start_file_id, INTEGER,)
141 COLUMN_NOT_NULL(widget_locale, TEXT,)
142 COLUMN_NOT_NULL(type, TEXT,)
143 COLUMN_NOT_NULL(encoding, TEXT,)
145 FOREIGN KEY(start_file_id) REFERENCES WidgetStartFile (start_file_id) ON DELETE CASCADE,
146 PRIMARY KEY(start_file_id, widget_locale)
150 CREATE_TABLE(WidgetExternalLocations)
151 COLUMN_NOT_NULL(app_id, INT,)
152 COLUMN_NOT_NULL(path, TEXT,)
154 FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE,
155 PRIMARY KEY(app_id, path)
159 CREATE_TABLE(WidgetCertificateFingerprint)
160 COLUMN_NOT_NULL(app_id, INT,)
161 COLUMN_NOT_NULL(owner, INT,)
162 COLUMN_NOT_NULL(chainid, INT,)
163 COLUMN_NOT_NULL(type, INT,)
164 COLUMN(md5_fingerprint, TEXT,)
165 COLUMN(sha1_fingerprint, TEXT,)
166 COLUMN(common_name, VARCHAR(64),)
169 PRIMARY KEY(app_id, chainid, owner, type)
170 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
174 CREATE_TABLE(WidgetWARPInfo)
175 COLUMN_NOT_NULL(app_id, INT,)
176 COLUMN_NOT_NULL(iri, TEXT,)
177 COLUMN(subdomain_access, INT, CHECK(subdomain_access between 0 and 1))
180 PRIMARY KEY(app_id, iri)
181 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
185 CREATE_TABLE(WidgetAllowNavigation)
186 COLUMN_NOT_NULL(app_id, INT,)
187 COLUMN_NOT_NULL(scheme, TEXT,)
188 COLUMN_NOT_NULL(host, TEXT,)
191 PRIMARY KEY(app_id, scheme, host)
192 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
196 CREATE_TABLE(FeaturesList)
197 COLUMN_NOT_NULL(FeatureUUID, INTEGER, primary key autoincrement)
198 COLUMN_NOT_NULL(FeatureName, TEXT, unique)
199 COLUMN_NOT_NULL(PluginPropertiesId, INT,)
202 FOREIGN KEY (PluginPropertiesId) REFERENCES PluginProperties (PluginPropertiesId) ON DELETE CASCADE
206 CREATE_TABLE(PluginProperties)
207 COLUMN_NOT_NULL(PluginPropertiesId, INTEGER, primary key autoincrement)
208 COLUMN_NOT_NULL(InstallationState, INTEGER, DEFAULT 0)
209 COLUMN_NOT_NULL(PluginLibraryName, TEXT, unique)
210 COLUMN_NOT_NULL(LibraryTimestamp, INT,)
211 COLUMN(PluginLibraryPath, TEXT,)
214 CREATE_TABLE(PluginDependencies)
215 COLUMN_NOT_NULL(PluginPropertiesId, INTEGER, not null)
216 COLUMN_NOT_NULL(RequiredPluginPropertiesId, INTEGER, not null)
219 FOREIGN KEY (PluginPropertiesId) REFERENCES PluginProperties (PluginPropertiesId) ON DELETE CASCADE
220 FOREIGN KEY (RequiredPluginPropertiesId) REFERENCES PluginProperties (PluginPropertiesId) ON DELETE CASCADE
224 CREATE_TABLE(PluginImplementedObjects)
225 COLUMN_NOT_NULL(PluginObject, TEXT, unique)
226 COLUMN_NOT_NULL(PluginPropertiesId, INTEGER, not null)
229 FOREIGN KEY (PluginPropertiesId) REFERENCES PluginProperties (PluginPropertiesId) ON DELETE CASCADE
233 CREATE_TABLE(PluginRequiredObjects)
234 COLUMN_NOT_NULL(PluginPropertiesId, INTEGER, not null)
235 COLUMN_NOT_NULL(PluginObject, TEXT, not null)
238 FOREIGN KEY (PluginPropertiesId) REFERENCES PluginProperties (PluginPropertiesId) ON DELETE CASCADE
242 CREATE_TABLE(DeviceCapabilities)
243 COLUMN_NOT_NULL(DeviceCapID, INTEGER, primary key autoincrement)
244 COLUMN_NOT_NULL(DeviceCapName, TEXT, unique)
245 COLUMN(DeviceCapDefaultValue, INT,)
248 CREATE_TABLE(FeatureDeviceCapProxy)
249 COLUMN_NOT_NULL(FeatureUUID, INT, not null)
250 COLUMN_NOT_NULL(DeviceCapID, INT, not null)
253 FOREIGN KEY (FeatureUUID) REFERENCES FeaturesList (FeatureUUID) ON DELETE CASCADE
254 FOREIGN KEY (DeviceCapID) REFERENCES DeviceCapabilities (DeviceCapID) ON DELETE CASCADE
255 PRIMARY KEY(FeatureUUID,DeviceCapID)
259 CREATE_TABLE(SettingsList)
260 COLUMN_NOT_NULL(appId, INT,)
261 COLUMN_NOT_NULL(settingName, TEXT,)
262 COLUMN_NOT_NULL(settingValue, TEXT,)
264 FOREIGN KEY (appId) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
268 CREATE_TABLE(AppControlInfo)
269 COLUMN_NOT_NULL(app_id, INT,)
270 COLUMN_NOT_NULL(execute_index, INT,)
271 COLUMN_NOT_NULL(src, TEXT,)
272 COLUMN_NOT_NULL(operation, TEXT,)
273 COLUMN_NOT_NULL(uri, TEXT,)
274 COLUMN_NOT_NULL(mime, TEXT,)
275 COLUMN_NOT_NULL(disposition, TINYINT, DEFAULT 0)
278 PRIMARY KEY(app_id, operation, uri, mime)
279 FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
283 CREATE_TABLE(EncryptedResourceList)
284 COLUMN_NOT_NULL(app_id, INT,)
285 COLUMN_NOT_NULL(resource, TEXT,)
286 COLUMN_NOT_NULL(size, INT,)
289 FOREIGN KEY (app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE
293 CREATE_TABLE(LiveBoxInfo)
294 COLUMN_NOT_NULL(app_id, INT,)
295 COLUMN(livebox_id, TEXT, DEFAULT '')
297 FOREIGN KEY(app_id) REFERENCES WidgetInfo (app_id) ON DELETE CASCADE