Open darmstaedter opened 5 years ago
Thanks for the issue. It's a known issue in a way. I saw this already, and figured we need to update things in our side.
The reason for this might be many: subtle changes to Doctrine or DB defaults, forgotten migrations in the past development, …
I'll check that carefully…
One reason for differences detected in older setups (Neos 3.x): https://github.com/doctrine/orm/issues/6565 - caused by a change in MariadDB 10.2 and fixed in DBAL 2.7. That causes changes that are no changes, like:
ALTER TABLE neos_media_domain_model_asset CHANGE resource resource VARCHAR(40) DEFAULT NULL
even though the table structure matches exactly.
The parentpath
index on NodeData
is supposed to be limited to 255 characters, see this comment from the PHP class:
* The parentpath index above is actually limited to a size of 255 characters in the corresponding MySQL migration,
* something that cannot be expressed through the annotation.
This can be properly done using annotations as of DBAL 2.9.0 (used in Neos 4.3 / Flow 5.3), see https://github.com/doctrine/dbal/pull/2412
Even if doing that, generated migrations will pick up a DROP/CREATE cycle for that index. Doh.
Some other changes are actually "forgotten" adjustments that we need to fix.
Still open:
$this->addSql('DROP TABLE neos_demo_domain_model_registration');
$this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');
as these are not part of the development distribution…
Note there will still be some differences to be detected, due to mismatches between what the DB reports and what Doctrine thinks it should report. That is true for MySQL/MariaDB as well as PostgreSQL.
The DROP TABLE neos_demo_domain_model_registration
is the result of the demo site being removed. A package that no longer exists doesn't need any tables… :)
The DROP INDEX sourceuripathhash …
confuses me, as that index is clearly requested in https://github.com/neos/redirecthandler-databasestorage/blob/89afaf857bb79286127544e659fa00d5124e5499/Classes/Domain/Model/Redirect.php#L27
Description
A fresh Neos installation has missing migrations. But when you run them they result in a SQL error.
Steps to Reproduce
./flow doctrine:migrationgenerate
Expected behavior
There shouldn't be any migrations classes to be generated.
Actual behavior
There is a migrations class created with the following content:
When you run
./flow doctrine:migrate
after the creation the following error occurs:Affected Versions
Neos: 4.3.0
Flow: 5.3.0
PHP: 7.3.4
MariDB: 10.3.14