Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
meta.syncable: fix sqlite to make sure it can be automatically installed
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Dec 18, 2013
1 parent 5a073d9 commit 6f64a27
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/plugins/meta.syncable/create.sqlite
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE ajxp_changes (
type TEXT,
source TEXT,
target TEXT
)
);

CREATE TABLE ajxp_index (
node_id INTEGER PRIMARY KEY AUTOINCREMENT,
Expand All @@ -14,24 +14,24 @@ CREATE TABLE ajxp_index (
bytesize NUMERIC,
md5 TEXT,
mtime NUMERIC
)
);

CREATE TRIGGER LOG_DELETE AFTER DELETE ON ajxp_index
BEGIN
INSERT INTO ajxp_changes (repository_identifer, node_id,source,target,type) VALUES (old.repository_identifer, old.node_id, old.node_path, "NULL", "delete");
END
END;

CREATE TRIGGER LOG_INSERT AFTER INSERT ON ajxp_index
BEGIN
INSERT INTO ajxp_changes (repository_identifer, node_id,source,target,type) VALUES (new.repository_identifer, new.node_id, "NULL", new.node_path, "create");
END
END;

CREATE TRIGGER "LOG_UPDATE_CONTENT" AFTER UPDATE ON "ajxp_index" FOR EACH ROW WHEN old.node_path=new.node_path
BEGIN
INSERT INTO ajxp_changes (repository_identifer, node_id,source,target,type) VALUES (new.repository_identifer, new.node_id, old.node_path, new.node_path, "content");
END
END;

CREATE TRIGGER "LOG_UPDATE_PATH" AFTER UPDATE ON "ajxp_index" FOR EACH ROW WHEN old.node_path!=new.node_path
BEGIN
INSERT INTO ajxp_changes (repository_identifer, node_id,source,target,type) VALUES (new.repository_identifer, new.node_id, old.node_path, new.node_path, "path");
END
END;

0 comments on commit 6f64a27

Please sign in to comment.