$this->assertEqual($this->adapter->pop(),'CREATE TRIGGER mytable_AUTOINCREMENT_PK FOR mytable ACTIVE BEFORE INSERT POSITION 0 AS BEGIN IF (NEW.id IS NULL OR NEW.id = 0) THEN NEW.id = GEN_ID(mytable_seq, 1) END');
$this->assertEqual($this->adapter->pop(),'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(4), INDEX myindex_idx (name), PRIMARY KEY(id)) ENGINE = INNODB');
$this->assertEqual($this->adapter->pop(),'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(4) DEFAULT NULL, INDEX myindex_idx (name), PRIMARY KEY(id)) ENGINE = INNODB');
$this->assertEqual($this->adapter->pop(),'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(4), INDEX myindex_idx (id ASC, name DESC), PRIMARY KEY(id)) ENGINE = INNODB');
$this->assertEqual($this->adapter->pop(),'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(4) DEFAULT NULL, INDEX myindex_idx (id ASC, name DESC), PRIMARY KEY(id)) ENGINE = INNODB');
$this->assertEqual($sql[0],'CREATE TABLE sometable (id INT UNIQUE, name VARCHAR2(4), PRIMARY KEY(id), INDEX myindex (id, name))');
$this->assertEqual($sql[0],'CREATE TABLE sometable (id INT DEFAULT NULL UNIQUE, name VARCHAR2(4) DEFAULT NULL, PRIMARY KEY(id), INDEX myindex (id, name))');
$this->assertEqual($sql[0],'CREATE TABLE foreign_key_test (id BIGINT AUTO_INCREMENT, name TEXT, code INT, content TEXT, parent_id BIGINT, INDEX parent_id_idx (parent_id), PRIMARY KEY(id)) ENGINE = INNODB');
$this->assertEqual($sql[0],'CREATE TABLE foreign_key_test (id BIGINT AUTO_INCREMENT, name TEXT DEFAULT NULL, code INT DEFAULT NULL, content TEXT DEFAULT NULL, parent_id BIGINT DEFAULT NULL, INDEX parent_id_idx (parent_id), PRIMARY KEY(id)) ENGINE = INNODB');
if(isset($sql[1])){
$this->assertEqual($sql[1],'ALTER TABLE foreign_key_test ADD FOREIGN KEY (parent_id) REFERENCES foreign_key_test(id) ON UPDATE RESTRICT ON DELETE CASCADE');
}else{
...
...
@@ -61,21 +61,21 @@ class Doctrine_Export_Record_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($sql[0],'CREATE TABLE mysql_index_test_record (id BIGINT AUTO_INCREMENT, name TEXT, code INT, content TEXT, FULLTEXT INDEX content_idx (content), UNIQUE INDEX namecode_idx (name, code), PRIMARY KEY(id)) ENGINE = MYISAM');
$this->assertEqual($sql[0],'CREATE TABLE mysql_index_test_record (id BIGINT AUTO_INCREMENT, name TEXT DEFAULT NULL, code INT DEFAULT NULL, content TEXT DEFAULT NULL, FULLTEXT INDEX content_idx (content), UNIQUE INDEX namecode_idx (name, code), PRIMARY KEY(id)) ENGINE = MYISAM');
$this->assertEqual($sql[0],'CREATE TABLE foreign_key_test (id BIGINT AUTO_INCREMENT, name TEXT, code INT, content TEXT, parent_id BIGINT, INDEX parent_id_idx (parent_id), PRIMARY KEY(id)) ENGINE = INNODB');
$this->assertEqual($sql[0],'CREATE TABLE foreign_key_test (id BIGINT AUTO_INCREMENT, name TEXT DEFAULT NULL, code INT DEFAULT NULL, content TEXT DEFAULT NULL, parent_id BIGINT DEFAULT NULL, INDEX parent_id_idx (parent_id), PRIMARY KEY(id)) ENGINE = INNODB');
if(isset($sql[1])){
$this->assertEqual($sql[1],'ALTER TABLE foreign_key_test ADD FOREIGN KEY (parent_id) REFERENCES foreign_key_test(id) ON UPDATE RESTRICT ON DELETE CASCADE');
}else{
...
...
@@ -87,25 +87,20 @@ class Doctrine_Export_Record_TestCase extends Doctrine_UnitTestCase
'CREATE TABLE cms__category_languages (id BIGINT AUTO_INCREMENT, name TEXT, category_id BIGINT, language_id BIGINT, INDEX index_category_idx (category_id), INDEX index_language_idx (language_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB',
'CREATE TABLE cms__category (id BIGINT AUTO_INCREMENT, created DATETIME, parent BIGINT, position MEDIUMINT, active BIGINT, INDEX index_parent_idx (parent), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB'
$this->assertTrue($this->adapter->pop(),'CREATE TABLE cms__category_languages (id BIGINT AUTO_INCREMENT, name TEXT DEFAULT NULL, category_id BIGINT DEFAULT NULL, language_id BIGINT DEFAULT NULL, INDEX index_category_idx (category_id), INDEX index_language_idx (language_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB');
$this->assertTrue($this->adapter->pop(),'CREATE TABLE cms__category (id BIGINT AUTO_INCREMENT, created DATETIME DEFAULT NULL, parent BIGINT DEFAULT NULL, position MEDIUMINT DEFAULT NULL, active BIGINT DEFAULT NULL, INDEX index_parent_idx (parent), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB');
//removed this assertion and inserted the two below
// $this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(4), INDEX myindex (id ASC, name DESC))');
$this->assertEqual($this->adapter->pop(),"CREATE INDEX myindex_idx ON sometable (id ASC, name DESC)");
$this->assertEqual($this->adapter->pop(),'CREATE TABLE sometable (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(4))');
$this->assertEqual($this->adapter->pop(),'CREATE TABLE sometable (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(4) DEFAULT NULL)');