Hi,

I am wanting to make a table using the Schema API with the following setup:

CREATE TABLE `ttable` (
`tt_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`e_id` int(10) unsigned DEFAULT NULL,
`e_name` longtext NOT NULL,
`e_values` longtext NOT NULL,
PRIMARY KEY (`tt_id`),
FULLTEXT KEY `fulltxt` (`e_name`,`e_values`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1.

I need to have the Engine set to MyISAM and I need to set the FULLTEXT KEY as above but there is no mention in the schema API on how to set these values.

Anyone know where I can find info regarding this?

Thanks in advance,

Davin.

Comments

mattyoung’s picture

  mymodule_install() {
    drupal_install_schema('mymodule');
    db_query('ALTER TABLE {ttable} ADD FULLTEXT (e_name, e_values)');
  }


  mymodule_schema() {
    $schema['ttable'] = array(
      ...
      'mysql_suffix' => 'ENGINE = MyISAM DEFAULT CHARSET=latin1',
    );
    return $schema;
  }
Trappies’s picture

Awesome ta!