8000 [Messenger Doctrine] Fixed regression by #50524 causing data loss by brusch · Pull Request #50717 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger Doctrine] Fixed regression by #50524 causing data loss #50717

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

Closed
wants to merge 1 commit into from
Closed

[Messenger Doctrine] Fixed regression by #50524 causing data loss #50717

wants to merge 1 commit into from

Conversation

brusch
Copy link
Contributor
@brusch brusch commented Jun 20, 2023

Regression caused by #50524

When using $platform->getAlterSchemaSQL($schemaDiff) instead of $schemaDiff->toSaveSql($platform) causes to call \Doctrine\DBAL\Schema\SchemaDiff::_toSql($platform, false) instead of \Doctrine\DBAL\Schema\SchemaDiff::_toSql($platform, true). When $saveMode=false the diff from the schema is getting remove, so actually all other tables ... in the DB are getting deleted

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no >
License MIT

Follow up to #50716 which was closed automatically by mistake 😊

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "5.4" but it seems your PR description refers to branch "6.3".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@brusch
Copy link
Contributor Author
brusch commented Jun 20, 2023

Ok, according to doctrine/dbal#5766 there's no replacement for SchemaDiff::toSaveSql().
But still, in Symfony we can't change to getAlterSchemaSQL() in a minor version as it would be a breaking change.

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Jun 22, 2023

Replaced by #50742, thanks for raising this.

nicolas-grekas added a commit that referenced this pull request Jun 22, 2023
…rekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[Messenger] Preserve existing Doctrine schema

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no (fixing a not released bug)
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #50717
| License       | MIT
| Doc PR        | -

[Inlining](https://github.com/symfony/symfony/pull/50742/files#diff-2a38c9deb498eec50126c297bb3d094c8efb29364934e902d6481761ace6f20a) since Doctrine deprecated "toSaveSql" without providing an alternative.

Cleaning up a few unneeded calls to `ORMSetup::createConfiguration()` also.

Commits
-------

96c227a [Messenger] Preserve existing Doctrine schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0