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

Allow to create model with pre-given UUID idKey #76

Merged
merged 1 commit into from Jul 26, 2018

Conversation

MihaelIsaev
Copy link
Member

@MihaelIsaev MihaelIsaev commented Jul 1, 2018

The problem

When I'm trying to save model to the database with specified UUID ID it saves with another random UUID ID.

Why I need this fix

I'm trying to transfer data from another database and I really need to use my old UUIDs as PRIMARY KEY ID.

Workaround

We should check if UUID ID is already specified and only in case when it isn't fluent should generate random UUID.

@MihaelIsaev
Copy link
Member Author

I've updated PR description and created related issue.

Copy link

@addisonwebb addisonwebb left a comment

Choose a reason for hiding this comment

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

This fix looks good to me. My only suggestion would be to add some tests here to protect against regressions. I had a nearly identical PR that was closed for some reason and I had some tests that might provide a good starting point. f7b068d

@addisonwebb
Copy link

fixes #56 and #78 - similar to PR #60

@tanner0101 tanner0101 added this to the 1.0.0 milestone Jul 26, 2018
@tanner0101 tanner0101 added the bug Something isn't working label Jul 26, 2018
@tanner0101 tanner0101 self-assigned this Jul 26, 2018
Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

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

LGTM, tyvm!

@penny-coin
Copy link

Hey @MihaelIsaev, you just merged a pull request, have a coin!

You now have 84 coins.

@tanner0101 tanner0101 merged commit eea3a44 into vapor:master Jul 26, 2018
@addisonwebb
Copy link

Thanks @tanner0101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Vapor 3
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

4 participants