You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
440 B

  1. const has = require('lodash/has')
  2. exports.up = async knex => {
  3. // -> Fix 2.5.1 added isEnabled columns for beta users
  4. const localStrategy = await knex('authentication').where('key', 'local').first()
  5. if (localStrategy && !has(localStrategy, 'isEnabled')) {
  6. await knex.schema
  7. .alterTable('authentication', table => {
  8. table.boolean('isEnabled').notNullable().defaultTo(true)
  9. })
  10. }
  11. }
  12. exports.down = knex => { }