2019-02-24 21:27:24 +00:00
|
|
|
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')
|
2019-02-24 21:27:24 +00:00
|
|
|
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')
|
2019-02-24 21:27:24 +00:00
|
|
|
})
|
|
|
|
])
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.down = function (knex, Promise) {
|
|
|
|
return Promise.all([
|
|
|
|
knex.schema.table('user', t => {
|
|
|
|
t.dropColumns('admin')
|
|
|
|
}),
|
|
|
|
knex.schema.dropTable('publishkey')
|
|
|
|
])
|
|
|
|
}
|