[jifty-devel] additional SQL constraints?

Matt Zagrabelny mzagrabe at d.umn.edu
Tue Sep 28 17:00:34 EDT 2010


On Tue, Sep 28, 2010 at 3:26 PM, Thomas Sibley <trs at bestpractical.com> wrote:
> Hi Matt,
>
> On 28 Sep 2010 15:58, Matt Zagrabelny wrote:
>> Do I model the UNIQUE constraints within my AppName::Record schema { } ?
>
> The way to do this is to specify "is distinct" for each column in your
> AppName::Record schema { } definition.

Hmmm. That doesn't seem quite logical. I could have a unique
constraint for each column individually or the *combination* of
multiple columns.

For instance:

CREATE TABLE widgets (
  name TEXT,
  model_number TEXT,

  UNIQUE(name),
  UNIQUE(model_number)
);

is very different from:

CREATE TABLE widgets (
  name TEXT,
  model_number TEXT,

  UNIQUE(name, model_number)
);

How does jifty handle the above difference?

or do you manually tweak the DB?

Thanks,

-matt zagrabelny


More information about the jifty-devel mailing list