-
Notifications
You must be signed in to change notification settings - Fork 178
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
Change names of tables which don't follow ActiveRecord conventions #91
Comments
Why not just rename all the tables to follow the proper conventions? |
To avoid touching the tons of existing PHP code that relies upon the tables the way they are right now. |
Lets be sure to also add |
The |
From an internal discussion about getting rid of our static tables:
|
I'm not a fan. For two reasons: Why was moving that data out of the _data_base even considered? |
I don't think it's fair to call these
Consistenty is a fair point, but not compelling enough for me to switch. Going back to my date analogy, if you want to query for all competitions that are in a month with exactly 30 days, how would you do it?
It's a very small amount of information (easilly fits into hashmaps in RAM) that almost never changes. I think there is a huge benefit to storing this stuff in Git: it gives us a transparency that's even better than the database export, because you can see exactly when and why changes to events or countries were made. I believe this transparency outweighs any potential downsides. |
It depends on the way you look at the data. If I want to display the event names for all results, that's fine. But if I want to find the best 100 results for each Event, I have to take extra precautions to not mess this up. To be honest: I don't get your Date analogy. a) Dates are not specific to our application, but universal. The countries and events we "support" are pretty specific to our application. b) "February" is related to internationalization which is usually not mixed with the pure data. The Git history argument is a very strong one, though and it might indeed outweigh the downsides. I sometimes have day dreams about opening my terminal and being able to query for all past events like |
I'm just a noob, but was thinking about this and thought that countries and continents don't change that often. I agree that keeping "our" stuff, like events and formats, in the code is good, but not sure about outside things. |
Which countries the WCA chooses to recognize is a political thing that not everyone in the world agrees on. I still think it makes a lot of sense to keep them in version control. |
@gregorbg is this still relevant with PHP gone? |
We fix this in #8077 I think |
This is especially relevant now, precisely because PHP is gone. |
Awesome thanks! Changed name to be more grok-able for my brain - let me know if I'm on the wrong track |
Generally, this isn't a problem, as we can override table names with ActiveRecord's table_name attribute. Rails appears to be pretty attached to its
id
column as an INTEGER, however. See http://stackoverflow.com/questions/1200568/using-rails-how-can-i-set-my-primary-key-to-not-be-an-integer-typed-column.Potentially problematic tables:
The text was updated successfully, but these errors were encountered: