Timeline for Is it wasteful to create a new database table instead of using enum data type?
Current License: CC BY-SA 4.0
27 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 5, 2022 at 4:58 | comment | added | Alexiz Hernandez | @RubberDuck I know this is a very old post, but I read your comment and I just want to say... I am one of those developers maintaining a RoR backend where the person/people that made it, decided option #3 was a stellar idea, since not only did they use it in columns like status, but they thought it would be better to make a column like veteran, to options veteranIds-0 and veteranIds-1, not boolean or at the very least int. And guess what the 0 means yes and the 1 means no. And YES, I dream of finding the ones who did this almost every night. | |
| Jan 2, 2020 at 22:20 | history | protected | gnat | ||
| Jan 2, 2020 at 16:16 | answer | added | Ravish | timeline score: 1 | |
| Oct 3, 2019 at 14:50 | comment | added | Flater | @RubberDuck: Int values are less of an issue if they are backed by an enum in your backend code (I'm focusing on C# here). EF stores enums by their base type (usually int), but EF does operate on the premise that developers mostly don't look in the database and merely handle data via the code (where the enum will always provide the correct translation). On top of that, there are ways to have EF use the string name instead of the int value; but this renders the data less refactor friendly if the enum value's name changes. | |
| Oct 3, 2019 at 14:42 | answer | added | Phill W. | timeline score: 3 | |
| S Oct 2, 2019 at 9:22 | history | suggested | CommunityBot | CC BY-SA 4.0 | Replace link returning 500 |
| Oct 1, 2019 at 14:43 | review | Suggested edits | |||
| S Oct 2, 2019 at 9:22 | |||||
| Apr 1, 2018 at 22:04 | comment | added | Adam Thompson | What is the benefit over option #1 if the values are determined to be unchanging in the future (besides the fact that humans can make mistakes and they may need to be changed in the future)? Is it just the improved flexibility? | |
| May 23, 2017 at 12:40 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Apr 12, 2016 at 13:53 | answer | added | José Margaça Lopes | timeline score: 8 | |
| Oct 16, 2015 at 20:31 | audit | Close votes | |||
| Oct 16, 2015 at 20:35 | |||||
| Oct 10, 2015 at 0:16 | audit | Close votes | |||
| Oct 10, 2015 at 21:57 | |||||
| Sep 28, 2015 at 19:55 | vote | accept | Dennis | ||
| Sep 28, 2015 at 19:55 | vote | accept | Dennis | ||
| Sep 28, 2015 at 19:55 | |||||
| Sep 28, 2015 at 19:55 | vote | accept | Dennis | ||
| Sep 28, 2015 at 19:55 | |||||
| Sep 28, 2015 at 19:51 | history | edited | Dennis | CC BY-SA 3.0 | context of using an ORM added |
| Sep 28, 2015 at 18:56 | history | edited | Dennis | CC BY-SA 3.0 | fix |
| Sep 28, 2015 at 18:45 | history | tweeted | twitter.com/#!/StackProgrammer/status/648569138806439937 | ||
| Sep 28, 2015 at 17:55 | answer | added | Mike Nakis | timeline score: 61 | |
| Sep 28, 2015 at 17:38 | comment | added | Mike Nakis | "is there a good guideline as to when one should use Option 3 and when Option 4?" I see no Option 4. do you mean Option 2 and 3? (If so, do use "edit" to fix it.) | |
| Sep 28, 2015 at 16:22 | history | edited | Dennis | CC BY-SA 3.0 | added 380 characters in body |
| Sep 28, 2015 at 16:20 | history | edited | Robert Harvey | CC BY-SA 3.0 | deleted 7 characters in body |
| Sep 28, 2015 at 16:19 | comment | added | Robert Harvey | I like Option 2. If you don't like the proliferation of lookup tables, use one table and add a "lookup type" column. But yeah, creating a lookup table is the "standard" way of doing this, as it allows you to do fun things like easily populate a dropdown in the UI. | |
| Sep 28, 2015 at 16:19 | history | edited | Dennis | CC BY-SA 3.0 | added 787 characters in body |
| Sep 28, 2015 at 16:04 | comment | added | RubberDuck | Whatever you do, don't do #3. The psychopath maintaining it will constantly have to figure out what those magic numbers mean. If you do that, you better hope they don't know where you live. blog.codinghorror.com/coding-for-violent-psychopaths | |
| Sep 28, 2015 at 15:57 | history | edited | Dennis | CC BY-SA 3.0 | added 110 characters in body |
| Sep 28, 2015 at 15:50 | history | asked | Dennis | CC BY-SA 3.0 |