This commit is contained in:
parent
a92d8d7cec
commit
1f27c65b1a
@ -233,6 +233,26 @@ class Doctrine_Export_Mysql_TestCase extends Doctrine_UnitTestCase
|
||||
|
||||
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(4), INDEX myindex (id ASC, name DESC), PRIMARY KEY(id)) ENGINE = INNODB');
|
||||
}
|
||||
public function testCreateTableSupportsFulltextIndexes()
|
||||
{
|
||||
$fields = array('id' => array('type' => 'integer', 'unsigned' => 1, 'autoincrement' => true, 'unique' => true),
|
||||
'content' => array('type' => 'string', 'length' => 4),
|
||||
);
|
||||
|
||||
$options = array('primary' => array('id'),
|
||||
'indexes' => array('myindex' => array(
|
||||
'fields' => array(
|
||||
'content' => array('sorting' => 'DESC')
|
||||
),
|
||||
'type' => 'fulltext',
|
||||
)),
|
||||
'type' => 'MYISAM',
|
||||
);
|
||||
|
||||
$this->export->createTable('sometable', $fields, $options);
|
||||
|
||||
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, content VARCHAR(4), FULLTEXT INDEX myindex (content DESC), PRIMARY KEY(id)) ENGINE = MYISAM');
|
||||
}
|
||||
}
|
||||
class MysqlTestRecord extends Doctrine_Record
|
||||
{
|
||||
|
@ -123,5 +123,19 @@ class Doctrine_Export_Oracle_TestCase extends Doctrine_UnitTestCase
|
||||
$this->adapter->pop();
|
||||
$this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (id CHAR(3))');
|
||||
}
|
||||
public function testCreateTableSupportsIndexes()
|
||||
{
|
||||
$fields = array('id' => array('type' => 'integer', 'unsigned' => 1, 'autoincrement' => true, 'unique' => true),
|
||||
'name' => array('type' => 'string', 'length' => 4),
|
||||
);
|
||||
|
||||
$options = array('primary' => array('id'),
|
||||
'indexes' => array('myindex' => array('fields' => array('id', 'name')))
|
||||
);
|
||||
|
||||
$sql =$this->export->createTableSql('sometable', $fields, $options);
|
||||
|
||||
$this->assertEqual($sql, 'CREATE TABLE sometable (id INTEGER UNSIGNED PRIMARY KEY AUTOINCREMENT, name VARCHAR(4), INDEX myindex (id, name))');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user