tizen 2.4 release
[framework/web/wrt-commons.git] / tests / dao / wrt_dao_tests_prepare_db.sh
index 4bb3f0e..df42a53 100755 (executable)
@@ -23,16 +23,16 @@ if [ "x$1" == "xstart" ]; then
     wrt_commons_create_clean_db.sh;
 
     #simple plugins
-    INS_MIN_PLUGINPROP="insert into PluginProperties(PluginPropertiesId, InstallationState, PluginLibraryName"
-    INS_ALL_PLUGINPROP="insert into PluginProperties(PluginPropertiesId, InstallationState, PluginLibraryName, PluginLibraryPath)"
+    INS_MIN_PLUGINPROP="insert into PluginProperties(PluginPropertiesId, InstallationState, PluginLibraryName, LibraryTimestamp"
+    INS_ALL_PLUGINPROP="insert into PluginProperties(PluginPropertiesId, InstallationState, PluginLibraryName, LibraryTimestamp, PluginLibraryPath)"
     INS_PLUGIN_OBJECTS="insert into PluginImplementedObjects(PluginObject, PluginPropertiesId)"
     INS_PLUGIN_DEPEND="insert into PluginDependencies(PluginPropertiesId, RequiredPluginPropertiesId)"
 
-    sqlite3 $WRT_DB "${INS_MIN_PLUGINPROP}) VALUES(1, 1, 'plugin1')";
-    sqlite3 $WRT_DB "${INS_MIN_PLUGINPROP}, PluginLibraryPath) VALUES(2, 1, 'plugin2', 'path_to_plugin2')";
-    sqlite3 $WRT_DB "${INS_MIN_PLUGINPROP}) VALUES(3, 1, 'plugin3')";
-    sqlite3 $WRT_DB "${INS_ALL_PLUGINPROP} VALUES(4, 1, 'p4', 'path_to_p4')";
-    sqlite3 $WRT_DB "${INS_ALL_PLUGINPROP} VALUES(5, 1, 'p5', 'path_to_p5')";
+    sqlite3 $WRT_DB "${INS_MIN_PLUGINPROP}) VALUES(1, 1, 'plugin1', 0)";
+    sqlite3 $WRT_DB "${INS_ALL_PLUGINPROP} VALUES(2, 1, 'plugin2', 0, 'path_to_plugin2')";
+    sqlite3 $WRT_DB "${INS_MIN_PLUGINPROP}) VALUES(3, 1, 'plugin3', 0)";
+    sqlite3 $WRT_DB "${INS_ALL_PLUGINPROP} VALUES(4, 1, 'p4', 0, 'path_to_p4')";
+    sqlite3 $WRT_DB "${INS_ALL_PLUGINPROP} VALUES(5, 1, 'p5', 0, 'path_to_p5')";
 
     #plugin dependendencies
     sqlite3 $WRT_DB "${INS_PLUGIN_DEPEND} VALUES(1, 5)";
@@ -71,7 +71,7 @@ if [ "x$1" == "xstart" ]; then
 
     #Widgets
     INS_ALL_WIDGETEXT="insert into WidgetExtendedInfo(app_id, install_time)"
-    INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, wac_signed, min_version, tizen_pkgid, tizen_appid, back_supported, csp_policy_report_only)"
+    INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, min_version, tizen_pkgid, tizen_appid, back_supported, csp_policy_report_only)"
     INS_ALL_WIDGET_LOC="insert into LocalizedWidgetInfo(app_id, widget_locale, widget_name, widget_shortname, widget_description, widget_license, widget_license_file, widget_license_href)"
     INS_ALL_WIDGET_ICONS="insert into WidgetIcon(app_id, icon_src, icon_width, icon_height)"
     INS_ALL_WIDGET_LOC_ICONS="insert into WidgetLocalizedIcon(app_id, icon_id, widget_locale)"
@@ -87,8 +87,8 @@ if [ "x$1" == "xstart" ]; then
     INS_ALL_WIDGET_POWDERLEV_CONT="insert into PowderLevelContexts(levelid, context)"
 
 
-    sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2000, 'w_id_2000', '1.0.0', 100, 200, 'a_name_2000', 'a_email_2000', 'a_href_2000', 'basef_2000', 1, 1, '1.0', 'pkgid201', 'tizenid201', 1, 'policy_report201')";
-    sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2001, 'w_id_2001', '2.0.0', 100, 200, 'a_name_2001', 'a_email_2001', 'a_href_2001', 'basef_2001', 1, 1, '0.5', 'pkgid202', 'tizenid202', 0, 'policy_report202')";
+    sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2000, 'w_id_2000', '1.0.0', 100, 200, 'a_name_2000', 'a_email_2000', 'a_href_2000', '1.0', 'pkgid201', 'tizenid201', 1, 'policy_report201')";
+    sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2001, 'w_id_2001', '2.0.0', 100, 200, 'a_name_2001', 'a_email_2001', 'a_href_2001', '0.5', 'pkgid202', 'tizenid202', 0, 'policy_report202')";
     sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2002, 0, 'tizenid203')";
     sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2003, 0, 'tizenid204')"; # for properties tests
 
@@ -137,6 +137,16 @@ if [ "x$1" == "xstart" ]; then
     mkdir "/opt/usr/apps/pkgid201"
     mkdir "/opt/usr/apps/pkgid201/data"
 
+    WGT_INTERFACE_DB=/opt/usr/apps/pkgid201/data/.widget_interface.db
+    #Create widget interface db
+    sqlite3 $WGT_INTERFACE_DB "create table Properties(key TEXT NOT NULL, value TEXT DEFAULT '' NOT NULL, readonly INTEGER check(readonly between 0 and 1) DEFAULT 0, configxml INTEGER check(readonly between 0 and 1) DEFAULT 0, UNIQUE (key))"
+    chown app:app $WGT_INTERFACE_DB
+    chown app:app $WGT_INTERFACE_DB-journal
+    #Add properties
+    WGT_IDB_INS_ALL_WIDGET_PREF="insert into Properties(key,value,readonly)"
+    sqlite3 $WGT_INTERFACE_DB "${WGT_IDB_INS_ALL_WIDGET_PREF} VALUES('key1_for_2000', 'value_for_key1_2000', 0)";
+    sqlite3 $WGT_INTERFACE_DB "${WGT_IDB_INS_ALL_WIDGET_PREF} VALUES('key2_for_2000', 'value_for_key2_2000', 0)";
+
     exit $?
 
 elif [ "x$1" == "xstop" ]; then