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
593 B

  1. /* global WIKI */
  2. exports.up = knex => {
  3. const dbCompat = {
  4. blobLength: (WIKI.config.db.type === `mysql` || WIKI.config.db.type === `mariadb`),
  5. charset: (WIKI.config.db.type === `mysql` || WIKI.config.db.type === `mariadb`)
  6. }
  7. return knex.schema
  8. .createTable('userAvatars', table => {
  9. if (dbCompat.charset) { table.charset('utf8mb4') }
  10. table.integer('id').primary()
  11. if (dbCompat.blobLength) {
  12. table.specificType('data', 'LONGBLOB').notNullable()
  13. } else {
  14. table.binary('data').notNullable()
  15. }
  16. })
  17. }
  18. exports.down = knex => { }