Closed ghost closed 4 months ago
Two things:
'
'SQL'
as the marker, there will be better syntactic coloration with some editors, is there something else I'm missing?@greg0ire Yes, nowdoc too, why not 😉
Benefits
More readable SQL statements
How exactly would they become more readable?
More readable SQL git diffs
This is not obvious to me either
Easier copy-paste for local testing
Because you can copy entire lines, or for another reason?
The --formatted
option already does part of the job, but quote escaping makes it more difficult to read/compare.
Yes, using nowdoc or heredoc, you can copy-paste and test SQL queries without any modification (such as unescaping).
TIL about --formatted
… I guess it could indeed be nicer with NOWDOC. Now I'm not sure we should support too many scenarios. Maybe we should just switch to NOWDOC and not expose any other option. I'm curious what other maintainers think.
@greg0ire you’re right. Nowdoc is a better choice in this case 👍
@derrabus @SenseException what do you think about this change? @michael-barchy-bf would you be willing to implement it?
Would you mind opening a pull request? Since it's a new feature, please target 3.8.x
Sorry, i'm not familiar with github, someone else should do it
This issue might be a duplicate of this one : https://github.com/doctrine/migrations/issues/939
Duplicate of #939
Feature Request
Add heredoc format for auto-generated migrations
Summary
e.g. https://github.com/doctrine/migrations/blob/3.7.x/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php
Without the new option
With the new option