[ic] Defining new complex key database table

paul jordan interchange-users@icdevgroup.org
Thu Nov 21 22:56:00 2002


> Quoting Alex Lofaso (Planetanime.com) (alex@planetanime.com):
> > Hello List!
> >
> > I am trying to define a new mysql table for ic.  It has a
> complex primary
> > key of sku and id.
> > I tried the following but got errors:
> >
> > Database  products  KEY          sku, id
> >
> > also I tried
> >
> > Database  products  KEY          sku
> > Database  products  KEY          id
> >
> > but ended up with 2 ids in the UI.
> >
> > Any suggestions?  Or can complex primary keys not be used?
>
> They cannot be used. I have looked at least having IC tolerate tables
> that use them, but the different databases which allow this all do it
> differently and I have not had any flashes of inspiration on how
> to 1) detect it is present and 2) do anything with it once it is
> detected.
>


You just can't define it within IC like that, but you can do it within
your database software or interface, and IC will benefit from the
outcome.

ALTER TABLE products ADD PRIMARY KEY (sku, id)

I use this sort of stuff on peripheral tables, NOT products. I think it
may render ADMIN pretty much unusable... but I don't know.


HTH

Paul