Storing in a new table or adding a column...
Added by Shaun Gilroy over 15 years ago
I'm working on a plugin that extends TimeEntries and I'm to the point where I'm considering adding a new table that will effectively add columns to the time_entries table. At which point I come to a 'best practices' question: Would there be any benefit to adding my columns to the time_entries table or should I stick with the separate table?
Theoretically this is a plugin I plan on distributing in the future, once It's complete and stable and I'm left curious what approach others have taken and where it got them.
Replies (2)
RE: Storing in a new table or adding a column...
-
Added by Eric Davis over 15 years ago
Depends on your data, I've done both (add columns to an existing table and add new tables with mapping). One gotcha I found is to watch what you name your columns, even with separate tables. For example I had a Deliverable table with a 'subject' column. Worked fine until I related Deliverables to Issues, then several places of Redmine failed because MySQL didn't know which 'subject' field to use: Issues or Deliverables.
Eric
RE: Storing in a new table or adding a column...
-
Added by Shaun Gilroy over 15 years ago
Thanks for the info! I'll keep that in mind when naming my columns.