Last active
August 24, 2020 14:46
-
-
Save jlstanus/f868e9e9e6ec8c2715abf4a6b2d88b2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Classic triggers for geopackages DB files | |
-- 1. Creation date | |
CREATE TRIGGER "trigger_add_creation_date" AFTER INSERT | |
ON "table_name" | |
BEGIN | |
UPDATE table_name SET attribute = datetime('now') WHERE fid = NEW.fid; | |
END | |
-- 2. Update date | |
CREATE TRIGGER "trigger_update_date" AFTER UPDATE | |
ON "table_name" | |
BEGIN | |
UPDATE "line_area_exceptions" SET attribute = datetime('now') WHERE fid = OLD.fid; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment