mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Wrong $saveMode parameter documentation in SchemaTool::updateSchema #4963
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dcb on GitHub (Jan 8, 2016).
Originally assigned to: @deeky666 on GitHub.
In
Doctrine\ORM\Tools\SchemaTool::updateSchemathe 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
$saveModeis true is that the method callstoSaveSqlinstead oftoSqlinSchemaDiffwhich produces a non-destructive update. The details can be found in the documentation ofDoctrine\DBAL\Schema\SchemaDiff::toSaveSql(). This is very useful, for example, when you want to do a partial update of the schema, you need$saveModeset to true otherwiseupdateSchemawould drop all the tables not included in the update, learned that the hard way.@deeky666 commented on GitHub (Jan 8, 2016):
Yeah this seems to be a copy/paste issue from
getUpdateSchemaSql()@deeky666 commented on GitHub (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.@Ocramius commented on GitHub (Jan 8, 2016):
Done via #5597