you might wanna try: http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/
On 25 Jan., 00:11, cricket <[email protected]> wrote: > On Mon, Jan 24, 2011 at 4:26 PM, Stephen <[email protected]> > wrote: > > Hey there > > > I am designing a database layout for a project and it has quite a few drop > > down menus, these are mostly static, lets say for example: > > > Income: > > - Do not disclose > > - £15,000 - £25,000 > > - £25,000 - £35,000 > > - etc. > > > These are unlikely to change over time whilst the website grows, normally I > > would create my select boxes by creating tables and having a hasOne > > relationship. This seems overkill for static select boxes, how would you > > guys normally do it? And what field type would you use? > > I agree that it sometimes can seem like overkill. However, defining > such things in bootstrap creates a separation that doesn't seem very > elegant to me. I'd rather have the association completely within the > DB. Using an ENUM column within the main table might be better, if > Cake supported them (I believe it still doesn't), but it's not really > too big a deal from the database's perspective to have a bunch of very > small tables for this purpose. Not all tables need be updated often, > and some databases allow for optimisation of just these sorts of > tables, in any case. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
