Created
April 20, 2017 06:47
-
-
Save jeremiahmarks/2089c746d87e08efe5ef0e2f3e8a7847 to your computer and use it in GitHub Desktop.
Example of LastModified timestamp in SQLite
From http://stackoverflow.com/questions/2248432/does-sqlite-store-the-lastmodified-date-of-a-row
This file contains 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
CREATE TRIGGER update_appInfo_updatetime BEFORE update ON appInfo | |
begin | |
update appinfo set updatedatetime = strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime') where bundle_id = old.bundle_id; | |
end | |
CREATE TABLE "appInfo" (bundle_id INTEGER PRIMARY KEY,title text, updatedatetime text DEFAULT (strftime('%Y-%m-%d %H:%M:%S:%s','now', 'localtime'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment