我将 knex 从0.21版本更新到了0.95版本,按照迁移指南进行了操作。现在在CI执行
任何帮助都将不胜感激,因为我在处理错误信息时一无所获。
npx knex migrate:latest
命令时出现了错误。migration file "20191104160706_migrate-appsflyer_customers.js" failed
migration failed with error: The query is empty
at createQueryBuilder (/home/circleci/backend/node_modules/knex/lib/knex-builder/make-knex.js:313:26)
但迁移文件包含了查询语句
async function up (knex) {
// language=Postgres
const { rows } = await knex.raw(`
SELECT * FROM appsflyer_customer;
`)
const mappedRows = rows.map(row => ({
user_id: row.user_id,
advertising_id_type: 'appsflyer',
advertising_id: row.appsflyer_device_id
}))
await knex('device_advertising_association')
.insert(mappedRows)
}
async function down (knex) {
await knex.raw(`
DELETE FROM device_advertising_association WHERE user_id NOTNULL;
`)
}
module.exports = {
up, down
}
任何帮助都将不胜感激,因为我在处理错误信息时一无所获。