[Catalyst] Constants that refer to rows in a lookup table.

Bill Moseley moseley at hank.org
Wed May 23 03:11:40 GMT 2007


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...

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.

Doesn't answer my question about best way to use constants -- but does
answer how not to use constants. ;)

Thanks,

-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list