[Dbix-class] Table attributes for deploy()

Bernhard Graf dbic4 at augensalat.de
Mon Aug 3 15:50:08 GMT 2009


Hi,

to set (RDBMS specific) column attributes in deploy() or
create_ddl_dir() DBIC::ResultSource::add_columns has the "extra"
attribute, e.g. for MySQL:

  __PACKAGE__->add_columns(
    address => {
      data_type => 'varchar',
      is_nullable => 0,
      default_value => '',
      size => '255',
      extra => {
        mysql_charset => 'utf8',
        mysql_collate => 'utf8_bin',
      }
  );

creates

  `address` varchar(255) character set utf8 collate utf8_bin
            NOT NULL DEFAULT '',

Nice.

I'm unable to find out, how to set attributes for a table, e.g.

  CREATE TABLE `url` (
  ...
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

("ENGINE=InnoDB" is a default - I want "CHARSET=utf8")

Is that possible in DBIC?

-- 
Bernhard Graf



More information about the DBIx-Class mailing list