contao / installation-bundle

[READ-ONLY] Contao Installation Bundle
GNU Lesser General Public License v3.0
8 stars 9 forks source link

sqlCompileCommands Hook vanished without replacement #49

Closed backbone87 closed 7 years ago

backbone87 commented 7 years ago

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.

leofeyer commented 7 years ago

I think @aschempp had to remove the hook in favor of the Doctrine integration.

aschempp commented 7 years ago

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...

backbone87 commented 7 years ago

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?

backbone87 commented 7 years ago

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

aschempp commented 7 years ago

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.

backbone87 commented 7 years ago

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

aschempp commented 7 years ago

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.

backbone87 commented 7 years ago

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.

aschempp commented 7 years ago

see https://github.com/contao/installation-bundle/pull/51

leofeyer commented 7 years ago

Thank you @aschempp.