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.

20 lines
626 B

  1. /* global WIKI */
  2. exports.up = knex => {
  3. const dbCompat = {
  4. charset: (WIKI.config.db.type === `mysql` || WIKI.config.db.type === `mariadb`)
  5. }
  6. return knex.schema
  7. .createTable('apiKeys', table => {
  8. if (dbCompat.charset) { table.charset('utf8mb4') }
  9. table.increments('id').primary()
  10. table.string('name').notNullable()
  11. table.text('key').notNullable()
  12. table.string('expiration').notNullable()
  13. table.boolean('isRevoked').notNullable().defaultTo(false)
  14. table.string('createdAt').notNullable()
  15. table.string('updatedAt').notNullable()
  16. })
  17. }
  18. exports.down = knex => { }