[Dbix-class] create_ddl_dir with MySQL / InnoDB

Juan Camacho jc5826 at gmail.com
Fri Jun 6 15:36:11 BST 2008


I would really like to use the new schema version functionality, but
ran into a problem when the schema is generated for MySQL.  The
generated SQL contain CONSTRAINT clauses that cause an error.  Is
there a way to completely disable them?

$schema->create_ddl_dir(['MySQL'], '1.1', './sql', 0, {producer_args
=> {mysql_table_type => 'MyISAM'}});

For example:

CREATE TABLE `attendee` (
  `attendee_id` integer(10) NOT NULL,
  `company_id` integer(10) NOT NULL DEFAULT '0',
  `name` VARCHAR(255) NOT NULL DEFAULT '',
  `first` VARCHAR(100),
  `last` VARCHAR(100),
  `title` VARCHAR(100),
  `bank_rep` integer(10) DEFAULT '0',
  `email` VARCHAR(100),
  `foreign_id` VARCHAR(32),
  INDEX attendee_idx_company_id (`company_id`),
  PRIMARY KEY (`attendee_id`),
  UNIQUE `name_company_idx` (`company_id`, `name`),
  CONSTRAINT `attendee_fk_company_id` FOREIGN KEY (`company_id`)
REFERENCES `company` (`company_id`) ON DELETE CASCADE ON UPDATE CAS
CADE
) ENGINE=InnoDB;

FYI, I'm using the development release (0.08099_02) that's on CPAN,
since I realized that the regular release doesn't pass arguments
forward.



More information about the DBIx-Class mailing list