knex icon indicating copy to clipboard operation
knex copied to clipboard

Conditional Migration in a database

Open sanjaybharti-consort opened this issue 2 years ago • 2 comments

Environment

Knex version: 2.0.0 Database + version: mysql:8.0.21 OS: Ubuntu:bionic

@ smorey2.

Feature discussion / request

How can we set condition on any migration file. If condition is true then all migrations will run else only specific migration work

sanjaybharti-consort avatar Jul 26 '22 13:07 sanjaybharti-consort

One can use hascolumn or hastable migrations.

hemantachhami19 avatar Aug 03 '22 17:08 hemantachhami19

http://knexjs.org/guide/#withuserparams exists for this purpose.

kibertoad avatar Aug 03 '22 17:08 kibertoad