How to do knex.js migrations?

前端 未结 6 1547
天命终不由人
天命终不由人 2021-02-01 19:39

I\'m still not sure how to do my migrations with knex. Here is what I have so far. It works on up, but down gives me FK constraint error even though fo

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-01 19:55

    Figured out that it wasn't working because of connection pooling. It would use a different connection to run each migration task which caused foreign key checks not to be set properly. setting

    pool:{
      max:1
    }
    

    in the migration config file fixed this.

提交回复
热议问题