2007-09-02 20:19:32 +04:00
|
|
|
<?php
|
|
|
|
class MysqlIndexTestRecord extends Doctrine_Record
|
|
|
|
{
|
2008-02-04 00:29:57 +03:00
|
|
|
public static function initMetadata($class)
|
2007-09-02 20:19:32 +04:00
|
|
|
{
|
2008-02-04 00:29:57 +03:00
|
|
|
$class->setColumn('name', 'string', null);
|
|
|
|
$class->setColumn('code', 'integer', 4);
|
|
|
|
$class->setColumn('content', 'string', 4000);
|
2007-09-02 20:19:32 +04:00
|
|
|
|
2008-02-04 00:29:57 +03:00
|
|
|
$class->addIndex('content', array('fields' => 'content', 'type' => 'fulltext'));
|
|
|
|
$class->addIndex('namecode', array('fields' => array('name', 'code'),
|
2007-09-02 20:19:32 +04:00
|
|
|
'type' => 'unique'));
|
|
|
|
|
2008-02-04 00:29:57 +03:00
|
|
|
$class->setTableOption('type', 'MYISAM');
|
2007-09-02 20:19:32 +04:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|