[html-formfu] Re: constraints_from_dbic

Ian Wells ijw at cack.org.uk
Fri Mar 13 09:59:12 GMT 2009


2009/3/10 Ian Wells <ijw at cack.org.uk>:
> I thought the HTML::FormFu::ObjectUtil::constraints_from_dbic method
> might be a good idea to reduce the number of times I have to state the
> length of character fields (an old favourite for inconsistencies).
> But it appears to be suffering from bitrot - specifically,
>
>    if ( $type =~ /(char|text|binary)\z/ && defined $info->{size} ) {
>
> doesn't match the type of varchars coming from DBIx::Class, which is
> {data_type => "character varying"}.

OK, the data_type name came out of the DBIX::Class schema dumper, run
on a Postgres database.  (The schema it produced wasn't portable.)
I've fixed the schema to use more portable data types (varchar,
specifically), which should stop the above problem happening.

-- 
Ian.



More information about the HTML-FormFu mailing list