[Dbix-class] Q: Differing column names in DBIC and SQL

Bernhard Graf dbic3 at augensalat.de
Tue Oct 21 09:30:39 BST 2008


One common practice to avoid problems with reserved words in column (or 
table) names is to prefix every name with an underscore.

Is there an elegant and working way in DBIC to accomplish this?

I already tried

__PACKAGE__->add_columns(
  user => {
    data_type => 'varchar',
    name => '_user',
  },
);

and deploy() actually generated an SQL column "_user", but then failed 
at the first

__PACKAGE__->add_unique_constraint(['user']);
-- 
Bernhard Graf



More information about the DBIx-Class mailing list