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
Implement option to specify any column as primary key #247
Conversation
Codecov Report
@@ Coverage Diff @@
## master #247 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 56 56
Lines 3969 3972 +3
=========================================
+ Hits 3969 3972 +3
Continue to review full report at Codecov.
|
cca49ee
to
e43d922
Compare
what happens to generated query for each adapter when Primary is set to false? |
That's really up to the developer on what to define as primary key. Imho this would still work in MySQL: schema.CreateTable("audit", func(t *rel.Table) {
t.BigID("id", rel.Primary(false), rel.Required(true))
// other fields
t.PrimaryKey("id")
}) that would generate:
|
but if user doesn't specify |
If user on purpose specifies |
agree 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks!!
Partially fixes #244
Still need to implement this into go-rel/sql and probably adapters