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

feat: export Migration Execution API from main package (fixes #4880) #4892

Merged
merged 1 commit into from Nov 22, 2019

Conversation

leonardofalk
Copy link
Contributor

This may need a lot of rework and review, but it describes what I tried to explain in #4880

})
}

public async getAllMigrations(): Promise<Migration[]> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need it if we already have getMigrations ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMigrations is a protected method where this one is part of the public API proposed returning a Promise<Mutation[]>, like its sibling methods getExecutedMigrations and getPendingMigrations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about it. Not sure we really need this "all" name. But we can left it as you did.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought that for consistency they should all return promises instead and I didn't want to introduce any changes to current behaviour. I'll change getMigrations to return a Promise and make it public, if that's ok.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

choose any approach you prefer

@pleerock
Copy link
Member

Think we can merge it.. but tests are failing because of tslint errors, can you please fix them

@leonardofalk
Copy link
Contributor Author

Think we can merge it.. but tests are failing because of tslint errors, can you please fix them

Yeah I can fix it, I was hoping to get some feedback first, because there are some other changes in the original issue which needs to be done, if they make any sense.

@pleerock
Copy link
Member

For me those methods don't make sense since I never had such use case. But we still can make some methods public if users need it. I would like to hear other people opinions around this question but looks like nobody is interested

@leonardofalk
Copy link
Contributor Author

Think we can merge it.. but tests are failing because of tslint errors, can you please fix them

Done.

@pleerock pleerock merged commit 8f4f908 into typeorm:master Nov 22, 2019
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

2 participants