[jifty-devel] additional SQL constraints?

Matt Zagrabelny mzagrabe at d.umn.edu
Tue Sep 28 15:58:24 EDT 2010


I'm working through some jifty tutorials, particular the Model stuff.
I can use the schema language to create most of the following:

CREATE TABLE incoming_components (
  id            BIGINT      PRIMARY KEY,

  -- mac MACADDR,
  mac_as_int    BIGINT      NOT NULL DEFAULT -1,
  mac           VARCHAR(17) NOT NULL DEFAULT '',

  serial_number TEXT        NOT NULL DEFAULT '',
  model_number  TEXT        NOT NULL DEFAULT '',

  UNIQUE(
         mac_as_int,
         mac,
         serial_number,
         model_number
        )
);


Do I model the UNIQUE constraints within my AppName::Record schema { } ?

or

Do I add in the constraints as supplementary sql statements?

Thanks for the help,

-matt zagrabelny


More information about the jifty-devel mailing list