Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support passing an array of Migrations #164

Merged
merged 1 commit into from
Mar 3, 2018

Conversation

jedwards1211
Copy link
Contributor

@jedwards1211 jedwards1211 commented Feb 12, 2018

I want to rock the boat a bit: the current method of giving sequelize a directory and glob pattern to find migrations isn't very flexible, and neither are other options people have suggested (providing multiple directories, passing in an array of files).

I need to provide a way for plugins in my app to inject their own migrations that live in a different directory from the app core, and possible even use a mix of languages (coffee, typescript, etc).

@PascalPflaum PascalPflaum merged commit 3f7c126 into sequelize:master Mar 3, 2018
@PascalPflaum
Copy link
Collaborator

thx, I will work through some more open PRs/Issues and then release a new version.

@cjpark
Copy link

cjpark commented Apr 11, 2018

@jedwards1211 this is exactly what I need, except for one issue: the Migrations class isn't exported.

How are you getting at it? Do you do something hacky like directly require-ing migrations.js?

@jedwards1211
Copy link
Contributor Author

@cjpark ah right. Yes, I was going to do it the hacky way like that. Though I ended up making code to copy migrations from various different folders into one temporary folder that I could use with Umzug as it is. (This is all to make our server support plugins that can provide their own database models and migrations)

@tamlyn
Copy link

tamlyn commented Apr 16, 2018

When using an array of Migrations like this, there doesn't seem to be a way to pass custom params into the migration up and down functions. Or am I missing something?

@jedwards1211
Copy link
Contributor Author

It's true that there's no way to do it via the options to Umzug, though whatever code you write to create the Migrations can wrap the up and down methods exported by your migration files to inject whatever custom params you want.

@odedniv
Copy link

odedniv commented Jun 20, 2018

Is this repo still getting releases? I want this 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants