You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm switching from postgres + knex to mongodb and a feature knex has is the ability to specify multiple migration directories. All it does is combine all the migrations and sorts thems in the correct order.
My reason for needing something like this is I have generic migrations and then migrations specific to clients. I need to be able to run all the generic migrations along with any client migrations.
For example consider the following migrations:
migrations/generic/1633521000_users.js
migrations/generic/1633572000_sales.js
migrations/client_1/1633553000_users.js
migrations/client_2/1633587000_sales.js
In this example, I want to run the migration for client_1. I would provide both the migration folders migrations/generic and migrations/client_1. This would run the following migrations in this order:
migrations/generic/1633521000_users.js
migrations/client_1/1633553000_users.js
migrations/generic/1633572000_sales.js
client_2 migrations would not be run in this case.
Describe the solution you'd like
The way knex handles this is in the config, their migration directory can either be a string or array of strings. I think this is the cleanest way
directory: a relative path to the directory containing the migration files. Can be an array of paths (default ./migrations)
Describe alternatives you've considered
By only having the ability to specify one migration directory, I would have to copy and paste the generic migrations into each clients folder which I do not want to do.
I don't think its possible to run the generic migrations and client migrations separate. If a generic migration had a date later than the client migration it wouldn't run it.
This is my specific use case, but I think there's a lot of benefits to this, a big one being able to better organize your migrations.
I am open to donating for this feature if you have something setup for that. Let me know how much you would think is fair for this feature if you want.
The text was updated successfully, but these errors were encountered:
You could use the API that the package offers to feed it a different migrations directory and a different connection string. Or use the -f parameter to provide a different configuration file from the command line.
Is your feature request related to a problem? Please describe.
I'm switching from postgres + knex to mongodb and a feature knex has is the ability to specify multiple migration directories. All it does is combine all the migrations and sorts thems in the correct order.
My reason for needing something like this is I have generic migrations and then migrations specific to clients. I need to be able to run all the generic migrations along with any client migrations.
For example consider the following migrations:
In this example, I want to run the migration for client_1. I would provide both the migration folders migrations/generic and migrations/client_1. This would run the following migrations in this order:
client_2 migrations would not be run in this case.
Describe the solution you'd like
The way knex handles this is in the config, their migration directory can either be a string or array of strings. I think this is the cleanest way
Describe alternatives you've considered
By only having the ability to specify one migration directory, I would have to copy and paste the generic migrations into each clients folder which I do not want to do.
I don't think its possible to run the generic migrations and client migrations separate. If a generic migration had a date later than the client migration it wouldn't run it.
This is my specific use case, but I think there's a lot of benefits to this, a big one being able to better organize your migrations.
I am open to donating for this feature if you have something setup for that. Let me know how much you would think is fair for this feature if you want.
The text was updated successfully, but these errors were encountered: