public function providerForTestGetModifyColumnRemoveDefaultValueDDL() { $t1 = new Table('test'); $t1->setIdentifierQuoting(true); $c1 = new Column(); $c1->setName('test'); $c1->getDomain()->setType('INTEGER'); $c1->setDefaultValue(0); $t1->addColumn($c1); $t2 = new Table('test'); $t2->setIdentifierQuoting(true); $c2 = new Column(); $c2->setName('test'); $c2->getDomain()->setType('INTEGER'); $t2->addColumn($c2); return [[ColumnComparator::computeDiff($c1, $c2)]]; }
public function testGetModifyColumnDDLWithVarcharWithoutSizeAndPlatform() { $t1 = new Table('foo'); $t1->setIdentifierQuoting(true); $c1 = new Column('bar'); $c1->setTable($t1); $c1->getDomain()->copy($this->getPlatform()->getDomainForType('VARCHAR')); $c1->getDomain()->replaceSize(null); $c1->getDomain()->replaceScale(null); $t1->addColumn($c1); $schema = <<<EOF <database name="test" identifierQuoting="true"> <table name="foo"> <column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" /> <column name="bar"/> </table> </database> EOF; $xtad = new SchemaReader(null); $appData = $xtad->parseString($schema); $db = $appData->getDatabase(); $table = $db->getTable('foo'); $c2 = $table->getColumn('bar'); $columnDiff = ColumnComparator::computeDiff($c1, $c2); $expected = false; $this->assertSame($expected, $columnDiff); }
public function testGetIndexDDLFulltext() { $table = new Table('foo'); $table->setIdentifierQuoting(true); $column1 = new Column('bar1'); $column1->getDomain()->copy($this->getPlatform()->getDomainForType('LONGVARCHAR')); $table->addColumn($column1); $index = new Index('bar_index'); $index->addColumn($column1); $vendor = new VendorInfo('mysql'); $vendor->setParameter('Index_type', 'FULLTEXT'); $index->addVendorInfo($vendor); $table->addIndex($index); $expected = 'FULLTEXT INDEX `bar_index` (`bar1`)'; $this->assertEquals($expected, $this->getPlatform()->getIndexDDL($index)); }
public function providerForTestPrimaryKeyDDL() { $table = new Table('foo'); $table->setIdentifierQuoting(true); $column = new Column('bar'); $column->setPrimaryKey(true); $table->addColumn($column); return array(array($table)); }