Skip to content
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

Doctrine-Migration INCOHERENCES on fresh Neos setup of versions 5.x || 7.x || 8.x #3118

Open
chkoeppel opened this issue Sep 25, 2020 · 5 comments
Assignees
Labels

Comments

@chkoeppel
Copy link
Contributor

chkoeppel commented Sep 25, 2020

"Migration-incoherences" (mysql) on FRESH Neos installations (updated on 07 May 2023)


Neos "8.3.0 with PR-'patch'" -> ./flow doctrine:migrationgenerate => generated migration-class
----> see PR #4236 with 2 migrations ... (= PR not merged yet)
===> that would fix almost all, - except the leftover incoherence originated in package: https://github.com/neos/redirecthandler-databasestorage
:-)


     $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');

Neos 8.3.0 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');

    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');

    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');

Neos 8.2.0 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');

    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');

    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');

Neos 8.1.2 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');

    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');

... see PR #3889 which improves here the first of those 3 issues ... :-)



Neos 8.0.1 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    $this->addSql('DROP INDEX path ON neos_contentrepository_domain_model_nodedata');
    $this->addSql('CREATE INDEX pathindex ON neos_contentrepository_domain_model_nodedata (path(255))');

    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');

    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 7.3.1 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    $this->addSql('DROP INDEX path ON neos_contentrepository_domain_model_nodedata');
    $this->addSql('CREATE INDEX pathindex ON neos_contentrepository_domain_model_nodedata (path(255))');
    
    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 7.2.3 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    $this->addSql('DROP INDEX path ON neos_contentrepository_domain_model_nodedata');
    $this->addSql('CREATE INDEX pathindex ON neos_contentrepository_domain_model_nodedata (path(255))');
    
    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 7.1 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    $this->addSql('DROP INDEX path ON neos_contentrepository_domain_model_nodedata');
    $this->addSql('CREATE INDEX pathindex ON neos_contentrepository_domain_model_nodedata (path(255))');
    
    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 7.0 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata RENAME INDEX path TO pathindex');
    
    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 5.3 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)'); 
    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata RENAME INDEX path TO pathindex');

    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');

    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 5.2 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata RENAME INDEX path TO pathindex');
    
    $this->addSql('ALTER TABLE neos_media_domain_model_tag DROP FOREIGN KEY FK_CA4889693D8E604F');
    $this->addSql('ALTER TABLE neos_media_domain_model_tag ADD CONSTRAINT FK_CA4889693D8E604F FOREIGN KEY (parent) REFERENCES neos_media_domain_model_tag (persistence_object_identifier) ON DELETE SET NULL');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 5.1 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata RENAME INDEX path TO pathindex');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 5.0 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Neos 4.3 -> ./flow doctrine:migrationgenerate => generated migration-class


    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');
    
    $this->addSql('DROP INDEX sourceuripathhash ON neos_redirecthandler_databasestorage_domain_model_redirect');


Steps to Reproduce

  1. composer create-project neos/neos-base-distribution neos-example (= fresh Neos setup with composer ... )
  2. ./flow doctrine:migrate ... to a fresh empty database (on each version above)
  3. ./flow doctrine:migrationgenerate
  4. check generated migration-class ...

Expected behavior

... an empty migration-class ... (shouldn't ...?)

Actual behavior

see migration-classes listed above ...

Affected Versions

SEE: Neos-Distribution Version mentioned on migration-classes listed above in the 'Description' ...

  • Neos.Media -> 5.2 AND 5.3
    --> 'Tag'-Model -> mutation introduced on Version Neos.Media 5.2
  • Neos.ContentRepository ....
    --> ........
  • Neos.RedirectHandler.DatabaseStorage ....
    --> ........

NOTE:
I just wanted to mention this behavior for now, - as I suppose this to be important to get cleared once ... (??)
Nevertheless I am aware that this needs deeper investigation to gain clear overview ... and fixes.

@chkoeppel
Copy link
Contributor Author

chkoeppel commented Oct 14, 2020

see PR #2477 that should resolve the following one (?)

    $this->addSql('ALTER TABLE neos_contentrepository_domain_model_nodedata DROP INDEX IDX_CE6515692D45FE4D, ADD UNIQUE INDEX UNIQ_CE6515692D45FE4D (movedto)');

See issue #3264 that mentions incorrect Doctrine mapping in Neos.Media ...

@chkoeppel chkoeppel changed the title Doctrine-Migration INCOHERENCES on fresh Neos 5-x installations Doctrine-Migration INCOHERENCES on fresh Neos 5.x || 7.0 installations Dec 26, 2020
@chkoeppel chkoeppel changed the title Doctrine-Migration INCOHERENCES on fresh Neos 5.x || 7.0 installations Doctrine-Migration INCOHERENCES on fresh Neos 5.x || 7.0 setup Dec 26, 2020
@kdambekalns kdambekalns self-assigned this Feb 3, 2022
@chkoeppel chkoeppel changed the title Doctrine-Migration INCOHERENCES on fresh Neos 5.x || 7.0 setup Doctrine-Migration INCOHERENCES on fresh Neos 5.x || 8.x setup Nov 14, 2022
@chkoeppel chkoeppel changed the title Doctrine-Migration INCOHERENCES on fresh Neos 5.x || 8.x setup Doctrine-Migration INCOHERENCES on fresh Neos setup of versions 5.x || 7.x || 8.x Nov 14, 2022
@mhsdesign
Copy link
Member

mhsdesign commented Apr 5, 2023

wow thanks for the detailed writedown ;) ❤️

maybe this is related? #2475

@chkoeppel
Copy link
Contributor Author

chkoeppel commented Apr 5, 2023

Sure, this must be related ...
:-)

So apparently 2 topics from 2019 have outlast history, - somehow ... ;-)

@mhsdesign
Copy link
Member

So apparently 2 topics from 2019 have outlast history, - somehow ... ;-)

hehe yes as it seems ^^

Ill be on vacation soon so i cant currently take care of it, but ill try remember it for the next sprint ^^

Sorry for no feedback over such long time ^^

Happy Easter / Holiday for now!

kdambekalns added a commit to kdambekalns/neos-development-collection that referenced this issue Apr 30, 2023
@kdambekalns
Copy link
Member

kdambekalns added a commit to kdambekalns/neos-development-collection that referenced this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

3 participants