mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-14 00:16:21 +00:00
616124446f
WARNING: Please turn off lolisafe before upgrading, then run "node database/migration.js" once after upgrading. Ignore all errors/warnings about duplicate column name. Afterwards make sure your config.js follows the new format in config.sample.js (specifically fileLength and generateThumbnails options). * generateImageThumbnails and generateVideoThumbnails options in config.js is now renamed to an object named generateThumbnails, with image and video as its properties. * fileLength option is now an object with min, max, default and userChangeable as its properties. * User may now change their preferred file length (following the previous option, of course). * Updated a bunch of responses messages. Mainly appending a dot to the messages. * New APIs: /fileLength/config to get an object of the current fileLength config (exactly what is in the config.js file). /fileLength/change to change user's preferred file length. * And maybe some others ...?
15 lines
658 B
JavaScript
15 lines
658 B
JavaScript
const config = require('../config.js')
|
|
const db = require('knex')(config.database)
|
|
|
|
const migration = {}
|
|
migration.start = async () => {
|
|
await db.schema.table('albums', t => t.dateTime('editedAt')).catch(err => console.warn(err.message))
|
|
await db.schema.table('albums', t => t.dateTime('zipGeneratedAt')).catch(err => console.warn(err.message))
|
|
await db.schema.table('users', t => t.dateTime('enabled')).catch(err => console.warn(err.message))
|
|
await db.schema.table('users', t => t.dateTime('fileLength')).catch(err => console.warn(err.message))
|
|
console.log('Migration finished! Now start lolisafe normally')
|
|
process.exit(0)
|
|
}
|
|
|
|
migration.start()
|