Set active_record config for always creating uuids in generators#21762
Set active_record config for always creating uuids in generators#21762sgrif merged 1 commit intorails:masterfrom
Conversation
|
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @sgrif (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
This has falling tests |
|
@sgrif Thanks for the heads up. Tests passing. I'm pretty unfamiliar with the AR/Railties code, but I think I figured out how these generators work (kinda). I left the |
There was a problem hiding this comment.
Do we need to set this back to the old value at the end of this test?
|
Can you squash and rebase after addressing that comment? This will need a changelog entry as well. |
|
@sgrif Done. I'll watch the tests and let you know once it's all green... |
|
Thanks. I'm going through the backlog so you won't be able to keep up with the merge conflicts I think. Just ping me once the tests are green and I'll merge manually. |
|
@sgrif All checks passed. Merge conflict. :) |
Set active_record config for always creating uuids in generators
`id: :serial` is added because `id: :uuid` support was introduced. rails/rails#21762 `using: :btree` was redundant rails/rails#27981 Standardaized column spacing was removed to avoid diffs about aligining columns. rails/rails@df84e98#r22545295 ```diff - t.string "zipcode", limit: 5 + t.string "zipcode", limit: 5 + t.string "extra_information", limit: 255 ```
UUID's are awesome (and they improve performance). I want them everywhere, but it's annoying to have to modify my DB migrations every time. I wish I could make an application config to force the generators to always add
id: :uuidwhenever I create a table.Throw this in your
application.rbfile......and
id: :uuidwill be added to everycreate_tablegeneration: