Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote the name of an index in the create table statement. #723

Merged
merged 2 commits into from
Jan 12, 2015

Conversation

digilist
Copy link
Contributor

@digilist digilist commented Nov 8, 2014

Currently, in the method getCreateTableSQL all names of tables, columns and foreign keys are quoted but not the names of indexes. This PR fixes this problem.

It would be very nice, if this fix can be backported into at least the 2.4 branch :)

@Ocramius
Copy link
Member

Ocramius commented Nov 8, 2014

@digilist needs a test case first

@digilist digilist force-pushed the master branch 2 times, most recently from db9ebb0 to 08bab83 Compare November 8, 2014 10:02
digilist added a commit to digilist/dbal that referenced this pull request Nov 8, 2014
@digilist
Copy link
Contributor Author

digilist commented Nov 8, 2014

Yes, sry, you are absolutely right. I added the tests.

$table->addIndex(array('column1'), '`key`');

$sql = $this->_platform->getCreateTableSQL($table);
$this->assertEquals($this->getQuotedNameInIndexSQL(), $sql);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to create an abstract protected getQuotedNameInIndexSQL() method in this class

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method is declared in line 537. Or do I misinterpret your comment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry didn't see that line. Nevermind then.

deeky666 added a commit that referenced this pull request Jan 12, 2015
Quote the name of an index in the create table statement.
@deeky666 deeky666 merged commit 057c07b into doctrine:master Jan 12, 2015
deeky666 pushed a commit that referenced this pull request Jan 12, 2015
deeky666 pushed a commit that referenced this pull request Jan 12, 2015
@deeky666
Copy link
Member

@digilist thanks! Backported to 2.5 and 2.4.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants