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

Wrong $saveMode parameter documentation in SchemaTool::updateSchema #5596

Closed
dcb opened this issue Jan 8, 2016 · 3 comments
Closed

Wrong $saveMode parameter documentation in SchemaTool::updateSchema #5596

dcb opened this issue Jan 8, 2016 · 3 comments
Assignees
Milestone

Comments

@dcb
Copy link

dcb commented Jan 8, 2016

In Doctrine\ORM\Tools\SchemaTool::updateSchema the documentation states that "If $saveMode is set to true the command is executed in the Database, else SQL is returned.". That is wrong since the method never returns anything.
What actually happens when $saveMode is true is that the method calls toSaveSql instead of toSql in SchemaDiff which produces a non-destructive update. The details can be found in the documentation of Doctrine\DBAL\Schema\SchemaDiff::toSaveSql(). This is very useful, for example, when you want to do a partial update of the schema, you need $saveMode set to true otherwise updateSchema would drop all the tables not included in the update, learned that the hard way.

@deeky666
Copy link
Member

deeky666 commented Jan 8, 2016

Yeah this seems to be a copy/paste issue from getUpdateSchemaSql()

@deeky666
Copy link
Member

deeky666 commented Jan 8, 2016

Noticing that also getUpdateSchemaSql() is wrong as is it oppositely states it will execute commands in DB eventually which is not true either.

@deeky666 deeky666 added this to the 2.6.0 milestone Jan 8, 2016
@deeky666 deeky666 self-assigned this Jan 8, 2016
@deeky666 deeky666 added the WIP label Jan 8, 2016
@deeky666 deeky666 added PR Created and removed WIP labels Jan 8, 2016
@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2016

Done via #5597

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

No branches or pull requests

4 participants