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.

19 lines
519 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('analytics', table => {
  8. if (dbCompat.charset) { table.charset('utf8mb4') }
  9. table.string('key').notNullable().primary()
  10. table.boolean('isEnabled').notNullable().defaultTo(false)
  11. table.json('config').notNullable()
  12. })
  13. }
  14. exports.down = knex => {
  15. return knex.schema
  16. .dropTableIfExists('analytics')
  17. }