Duplicated path error ignored
[platform/core/security/libprivilege-control.git] / db / rules-db.sql
index 6f7a5e3..a7fba4c 100644 (file)
@@ -6,15 +6,14 @@
 -- 2. If you change definition of tables
 --    update the schema counter at the bottom!!
 
--- TODO: Use "USING" in joins whenever possible
-
 .load librules-db-sql-udf.so
 PRAGMA foreign_keys = ON;
 PRAGMA auto_vacuum = NONE;
 
 BEGIN EXCLUSIVE TRANSACTION;
 
--- PRAGMA cache_size = 2000;
+-- Update here on every schema change! Integer value.
+PRAGMA user_version = 2;
 
 CREATE TABLE IF NOT EXISTS  app (
     app_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -150,7 +149,6 @@ CREATE TABLE IF NOT EXISTS all_smack_binary_rules(
 
 -- TEMPORARY TABLES ------------------------------------------------------------
 -- Definitions are repeated in code.
-
 CREATE TEMPORARY TABLE history_smack_rule(
     subject TEXT NOT NULL,
     object  TEXT NOT NULL,
@@ -546,7 +544,7 @@ BEGIN
     INSERT OR IGNORE INTO label(name) VALUES (NEW.path_label_name);
 
     -- Add the path
-    INSERT INTO app_path(app_id, path, label_id, access, access_reverse, app_path_type_id)
+    INSERT OR IGNORE INTO app_path(app_id, path, label_id, access, access_reverse, app_path_type_id)
     SELECT  application_view.app_id,
             NEW.path,
             label.label_id,
@@ -883,8 +881,4 @@ FROM    (
         )
 ORDER BY subject, object ASC;
 
-
--- Update here!
-PRAGMA schema_version = 1.1;
-
-COMMIT TRANSACTION;
+COMMIT TRANSACTION;
\ No newline at end of file