Files
cloudron-box/migrations/20240625144843-apps-updateTime-remove-default.js
Girish Ramakrishnan 6c68f7da2e 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!
2024-06-25 17:24:02 +02:00

10 lines
278 B
JavaScript

'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 */) {
};