Skip to content

Commit

Permalink
[fix] moving notes into trash does not change the last modified prope…
Browse files Browse the repository at this point in the history
…rty.
  • Loading branch information
coderPaddyS committed Jul 25, 2024
1 parent 4d6c6d6 commit 7609720
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("DROP TABLE notes;");
database.execSQL("ALTER TABLE notes_new RENAME TO notes");
database.execSQL(
"CREATE TRIGGER [UpdateLastModified] AFTER UPDATE ON notes FOR EACH ROW WHEN NEW.last_modified = OLD.last_modified AND NEW.custom_order = OLD.custom_order " +
"CREATE TRIGGER [UpdateLastModified] AFTER UPDATE ON notes FOR EACH ROW " +
"WHEN NEW.last_modified = OLD.last_modified AND NEW.custom_order = OLD.custom_order AND NEW.in_trash = OLD.in_trash " +
"BEGIN " +
"UPDATE notes SET last_modified = DateTime('now') WHERE _id=NEW._id; " +
"END;"
Expand Down

0 comments on commit 7609720

Please sign in to comment.