-- 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,
-- TEMPORARY TABLES ------------------------------------------------------------
-- Definitions are repeated in code.
-
CREATE TEMPORARY TABLE history_smack_rule(
subject TEXT NOT NULL,
object TEXT NOT NULL,
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,
)
ORDER BY subject, object ASC;
-
--- Update here!
-PRAGMA schema_version = 1.1;
-
-COMMIT TRANSACTION;
+COMMIT TRANSACTION;
\ No newline at end of file