ts is useful as a versioning mechanism (for example, icon changed). update the timestamp explicity in code instead of db. this way health and healthTime can be updated without changing ts.
16 lines
482 B
JavaScript
16 lines
482 B
JavaScript
'use strict';
|
|
|
|
exports.up = function(db, callback) {
|
|
db.runSql('ALTER TABLE apps MODIFY ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP', [], function (error) {
|
|
if (error) console.error(error);
|
|
callback(error);
|
|
});
|
|
};
|
|
|
|
exports.down = function(db, callback) {
|
|
db.runSql('ALTER TABLE apps MODIFY ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', [], function (error) {
|
|
if (error) console.error(error);
|
|
callback(error);
|
|
});
|
|
};
|