Google Groups Home
Help | Sign in
application constant versus foreign key belongs_to
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jason Boxman  
View profile
 More options Jul 13, 3:28 pm
From: Jason Boxman <jas...@edseek.com>
Date: Sun, 13 Jul 2008 15:28:08 -0400
Local: Sun, Jul 13 2008 3:28 pm
Subject: application constant versus foreign key belongs_to
Lately I've been using VARCHAR with unique character codes for what would
otherwise be a foreign key relationship with another table with a handful of
entries, like M/F for gender, or A1-A7 for address location types.  
Elsewhere, I define constants with the appropriate humanized values.

Anyone else doing that?

Unless you're dealing with a large number of values or they need to be easily
updateable without an application restart, it's probably sensible.  From a
normalization perspective, it just feels deeply wrong, though.

I'll entertain suggestions for the normalization approach if there's something
I'm missing, though.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google