Closed backbone87 closed 7 years ago
I think @aschempp had to remove the hook in favor of the Doctrine integration.
I don't think so. I'm just using the core database inspector, so whatever hooks run in Core should run here too. Dunno if we changed something by accident though, remember there was a core parser and one in the installation bundle...
I have found the sqlCompileCommands hook in 3 places:
I assume contao/installation-bundle is the only place where a DB update is run in contao 4? and there the hook is missing
also you cant reflect views, SPs or trigger in a doctrine schema, thats why the hook is probably run, but unknown SQL just dropped from the schema?
https://github.com/contao/core-bundle/blob/master/src/Doctrine/Schema/DcaSchemaProvider.php#L315
you call getFromDca and getFromFile, but these are low lvl function which were only called from the legacy Installer itself, but never from the outside (at least not from the "3 big users": install.php, ER2 client, composer-client). The sqlCompileCommands sits a lvl above at the end of Installer::compileCommands
which was used by all "3 big users" and therefore triggered the hook for all major DB update places
I also wonder why the DcaSchemaProvider sits in the core-bundle and not the installation-bundle
I also wonder why the DcaSchemaProvider sits in the core-bundle and not the installation-bundle
Because you want to use Doctrine Migrations and Doctrine Schema Update without requiring the installation-bundle.
I guess this is a bug then we should fix, dunno (and haven't checked) why we're not using sqlCompileCommands.
Because you want to use Doctrine Migrations and Doctrine Schema Update without requiring the installation-bundle.
you cant use doctrine migrations anyway together with the installation bundle, because the installation bundle wants to kick everything that doesnt fit into a doctrine schema. you actually want to use doctrine migrations to use the full power of your dbms that is not covered by doctrine schema and schema tool.
dunno (and haven't checked) why we're not using sqlCompileCommands.
because sqlCompileCommands is a hook of contao/core in Installer::compileCommands which isnt used by contao/installation-bundle Installer
you cant use doctrine migrations anyway together with the installation bundle, because the installation bundle wants to kick everything that doesnt fit into a doctrine schema.
Not really a broad use case, I never had anything not fitting into the Doctrine Schema, and neither does Contao DCAs by default. Sure you can come up with strange special cases, but that's where Migrations is fore. The core works perfectly the current way.
views, triggers, SPs strange special use cases? pls...
i mean the database update is kinda useless, if it cant display whole migration SQL. but thats a topic for the other ticket regarding migrations.
Thank you @aschempp.
https://github.com/contao/installation-bundle/commit/f73ed73ec68c6d70409949179359deab5658add4#diff-5417e6764e49e8dea064b342cf1d623fL220
If you want to do anything with views you need this hook unless you are want to build VERY big runonce files.