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

More examples in Mongo #268

Merged
merged 4 commits into from
Jan 3, 2020
Merged

More examples in Mongo #268

merged 4 commits into from
Jan 3, 2020

Conversation

orasik
Copy link
Contributor

@orasik orasik commented Aug 15, 2019

Yesterday I struggled to create migrations with some use cases (adding a new field, updating field with a value from another) so I thought of adding these examples as it might help someone and save time :)

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Unfortunately, I'm not familiar with MongoDB queries or schema changes, so am not comfortable merging this in without another reviewer that knows MongoDB better.

@zikaeroh @erikdubbelboer If you know MongoDB well enough, could you review this PR?

@erikdubbelboer
Copy link
Contributor

I have never worked with MongoDB.

@orasik
Copy link
Contributor Author

orasik commented Aug 18, 2019

is there any integration test I can do to help?

@dhui
Copy link
Member

dhui commented Aug 18, 2019

We could run the example migrations as part of our tests. e.g. add TestExample(t *testing.T, sourceDir string) to database/testing and update all of the existing DB tests accordingly.

When TestExample() is given empty string or empty directory, it should pass.

@coveralls
Copy link

coveralls commented Jan 3, 2020

Pull Request Test Coverage Report for Build 609

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 51.402%

Totals Coverage Status
Change from base Build 608: 0.0%
Covered Lines: 2346
Relevant Lines: 4564

💛 - Coveralls

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Turns out TestMigrate() runs migrations using the examples

@dhui dhui merged commit 3001e74 into golang-migrate:master Jan 3, 2020
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

4 participants