Bill Moseley wrote:
On Tue, May 22, 2007 at 05:57:15PM -0700, mla wrote:
Consider this change...
create table cart_status (
id SERIAL PRIMARY KEY,
status text UNIQUE NOT NULL
name text NOT NULL,
active boolean NOT NULL DEFAULT TRUE
);
Now there's two primary keys...
Which is okay, AFAIK. No problems with multiple candidate keys.
Yes, that's an idea. Better use of the database's relationships, but
it does mean an extra select or join every time I want to fetch
cart(s) of a specific status.
Something to think about.
If it's a performance issue then next step could be to fetch all
the status rows at the start and then use the IDs from that as
your "constants."
Doesn't answer my question about best way to use constants -- but does
answer how not to use constants. ;)
Sorry.
Maurice
_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/