Commit ade10e9a authored by beberlei's avatar beberlei

Fix to support DDC-133 in the DBAL

parent e0e599f9
......@@ -81,6 +81,10 @@ abstract class AbstractAsset
}, $columnNames);
$parts[] = $postfix;
return trim(implode("_", $parts), '_');
$identifier = trim(implode("_", $parts), '_');
// using implicit schema support of DB2 and Postgres there might be dots in the auto-generated
// identifier names which can easily be replaced by underscores.
$identifier = str_replace(".", "_", $identifier);
return $identifier;
}
}
\ No newline at end of file
......@@ -359,4 +359,16 @@ class TableTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($column->getNotnull());
}
/**
* @group DDC-133
*/
public function testAllowImplicitSchemaTableInAutogeneratedIndexNames()
{
$table = new Table("foo.bar");
$table->addColumn('baz', 'integer', array());
$table->addIndex(array('baz'));
$this->assertTrue($table->hasIndex('foo_bar_baz_idx'));
}
}
\ No newline at end of file
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