apps: updateTime should be null if never updated

"TIMESTAMP NULL" is an attribute modifier to make the column nullable.
Without it, if you assign null, the timestamp becomes the current time!
This commit is contained in:
Girish Ramakrishnan
2024-06-25 16:56:30 +02:00
parent ccd5f6c2e5
commit 6c68f7da2e
4 changed files with 15 additions and 3 deletions
@@ -0,0 +1,9 @@
'use strict';
exports.up = async function(db) {
await db.runSql('ALTER TABLE apps MODIFY updateTime TIMESTAMP NULL DEFAULT NULL');
await db.runSql('UPDATE apps SET updateTime=? WHERE creationTime=updateTime', [ null ]);
};
exports.down = async function(/* db */) {
};