Commit 1f27c65b authored by zYne's avatar zYne

--no commit message

--no commit message
parent a92d8d7c
......@@ -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))');
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment