-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Checker for implicit_order_column for table with uuid as primary key #197
Comments
@djezzzl, any chance you were able to take a look at this? |
Hi @developie0610, Thank you for reporting this! Hi @toydestroyer, Thank you for pinging me; it seems I overlooked this. Could you please help me to understand what the checker should check? That every model with UUID as a primary key have |
Yes. That is what we are looking for @djezzzl and I don't see the need for more complications. |
Let me know if this is a sensible checker, I am happy to contribute on the actual work since we are the primary user as far as I'm concerned. |
Hey @developie0610, Feel free to make a PR if you have time; however, I'm happy to help if you can't. Could you give me a minimal code example (model/schema with meaningful code there), though, so I can repeat it in my tests and do a proper checker? |
awesome, thanks @djezzzl. I'll contribute the PR. You can refer to this arbitrary setup to verify:
Schema:
Model:
Migration:
-> Expected result from |
Thank you for sharing this!
Great then! Please feel free to ping me for any assistance; if you can't finish, please let me know, and I can do that. |
Hi @developie0610, Thank you for your contribution! I just released this on 1.7.18. Please have a look. BTW, could you please fill in the WIKI page? https://github.com/djezzzl/database_consistency/wiki/implicitorderingchecker P.S. Have a great weekend! |
Hi @djezzzl , I'm working on a project that recently start utilize
uuid
as our primary key for new database's table. We find it's a common pattern to defineimplicit_order_column
(supported Rails >=6) with such tables to maintain the records's order in queries.We have reason to think that this approach would be a common practice compare to using sortable uuid algorithm, and given that we are relying heavily on
database_consistency
, having a checker would be a great resource.The text was updated successfully, but these errors were encountered: