1
0
mirror of synced 2025-01-18 06:21:40 +03:00
This commit is contained in:
zYne 2007-02-10 21:19:06 +00:00
parent a92d8d7cec
commit 1f27c65b1a
2 changed files with 34 additions and 0 deletions

View File

@ -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
{

View File

@ -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))');
}
}
?>