[Dbix-class] DBIx::Class::Schema::Loader limitations

Matt S Trout dbix-class at trout.me.uk
Thu Jun 29 23:43:30 CEST 2006


Daniel McBrearty wrote:
> thanks.
> 
> so presumably if you have constraints that are a bit more complex than
> unique/PK, you code these somehow into your model classes, and never
> really touch the sql itself?
> 
> (we currently have stuff like :
> 
> CREATE TABLE languages(
>   id SERIAL PRIMARY KEY,
>   language_code TEXT UNIQUE,
>   is_original BOOLEAN NOT NULL DEFAULT FALSE
> );
> 
> -- there can only be ONE base language
> CREATE UNIQUE index languages_only_one_true_base_idx
> ON languages (is_original)
> WHERE is_original;
> 
> in db.sql - I guess I'd have to overload the accessor or something with DBIx?

add_unique_constraint

Which are handled by deploy as of 06999.

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list