2019-08-04 20:31:13 +00:00
|
|
|
/* global WIKI */
|
|
|
|
|
2019-05-27 04:28:12 +00:00
|
|
|
exports.up = knex => {
|
|
|
|
const dbCompat = {
|
|
|
|
blobLength: (WIKI.config.db.type === `mysql` || WIKI.config.db.type === `mariadb`)
|
|
|
|
}
|
|
|
|
return knex.schema
|
|
|
|
.table('assetData', table => {
|
|
|
|
if (dbCompat.blobLength) {
|
|
|
|
table.dropColumn('data')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.table('assetData', table => {
|
|
|
|
if (dbCompat.blobLength) {
|
|
|
|
table.specificType('data', 'LONGBLOB').notNullable()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.down = knex => {
|
|
|
|
return knex.schema
|
|
|
|
.table('assetData', table => {})
|
|
|
|
}
|