river-of-ebooks/migrations/20190224022422_add_admin_us...

30 lines
823 B
JavaScript
Raw Normal View History

exports.up = function (knex, Promise) {
return Promise.all([
knex.schema.table('user', t => {
t.boolean('admin').defaultTo(false)
}),
knex.schema.createTable('publishkey', t => {
t.increments('id').primary()
t.integer('user').notNullable().references('user.id').onDelete('CASCADE').onUpdate('CASCADE')
2019-02-26 03:29:18 +00:00
t.string('name')
t.string('url')
t.string('appid')
t.string('secret')
2019-02-26 03:29:18 +00:00
t.string('verification_key')
t.boolean('whitelisted').defaultTo(false)
t.boolean('verified').defaultTo(false)
2019-02-27 01:01:56 +00:00
t.bigInteger('created_at')
t.bigInteger('updated_at')
})
])
}
exports.down = function (knex, Promise) {
return Promise.all([
knex.schema.table('user', t => {
t.dropColumns('admin')
}),
knex.schema.dropTable('publishkey')
])
}