2018-01-23 20:06:30 +00:00
|
|
|
const config = require('../config.js')
|
|
|
|
const db = require('knex')(config.database)
|
2017-10-04 05:05:38 +00:00
|
|
|
|
2018-01-23 20:06:30 +00:00
|
|
|
const migration = {}
|
2017-10-04 05:05:38 +00:00
|
|
|
migration.start = async () => {
|
2018-01-23 20:06:30 +00:00
|
|
|
await db.schema.table('albums', table => {
|
|
|
|
table.dateTime('editedAt')
|
|
|
|
table.dateTime('zipGeneratedAt')
|
2018-03-14 07:12:12 +00:00
|
|
|
}).catch(() => {})
|
|
|
|
await db.schema.table('users', table => {
|
|
|
|
table.integer('enabled')
|
|
|
|
}).catch(() => {})
|
2018-01-23 20:06:30 +00:00
|
|
|
console.log('Migration finished! Now start lolisafe normally')
|
2018-03-14 06:57:09 +00:00
|
|
|
process.exit(0)
|
2018-01-23 20:06:30 +00:00
|
|
|
}
|
2017-10-04 05:05:38 +00:00
|
|
|
|
2018-01-23 20:06:30 +00:00
|
|
|
migration.start()
|