[Dbix-class] Q: Differing column names in DBIC and SQL
Jess Robinson
castaway at desert-island.me.uk
Thu Oct 23 17:14:23 BST 2008
On Tue, 21 Oct 2008, Bernhard Graf wrote:
> Jess Robinson wrote:
>
>> You could patch SQL::Translator::Parser::DBIx::Class (in the dbic
>> dist package) to use the name => .. key in the column_info.. then you
>> could use as you first mentioned and deploy (which uses sqlt) would
>> work.
>
> Maybe I could, so deploy would pass add_unique_constraint(), but
> $rs->create({name => ...}) et.al still fail this case.
Pardon? I don't understand what you said there at all.
My idea was if you patch the SQLT stuff, then you *can* have
add_columns('mycol' => { name => '_mycol', .. }) and use create({ mycol =>
stuff })
Look at the ::Parser::DBIx::Class file and see how it does add_field and
how it sets the field name.
> I think I give up.
Up to you I guess.
Jess
More information about the DBIx-Class
mailing list