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

TASK: Remove duplicate index #27

Merged
merged 4 commits into from
Oct 5, 2022
Merged

Conversation

dlubitz
Copy link
Contributor

@dlubitz dlubitz commented Sep 12, 2022

This migration removes the index sourceuripathhash as it is a dpulicate of the index flow_identity_neos_redirecthandler_databasestorage_domain_60892.

This is not necessary and leads to unwanted change requests in database migration generation (#9).

See also:

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am very sure the "properly named index" should be kept. No clue (yet) where the other comes from!

@dlubitz
Copy link
Contributor Author

dlubitz commented Sep 12, 2022

I am very sure the "properly named index" should be kept. No clue (yet) where the other comes from!

Ok, but the other one has a additional unique constaint.

@kdambekalns
Copy link
Member

This is where the index (should) come from

* @ORM\Table(
* indexes={
* @ORM\Index(name="sourceuripathhash",columns={"sourceuripathhash","host"}),
* @ORM\Index(name="targeturipathhash",columns={"targeturipathhash","host"})
* }
* )

@kdambekalns
Copy link
Member

The migration only the the named one…

https://github.com/neos/redirecthandler-databasestorage/blob/4d17a80ebbbb6997537374c1f9fe5d846d204226/Migrations/Mysql/Version20160418100005.php

Do you know where the index comes from? Is it implicitly created?

@dlubitz
Copy link
Contributor Author

dlubitz commented Sep 12, 2022

It seems to come from the migration only:
https://github.com/neos/redirecthandler-databasestorage/blob/master/Migrations/Mysql/Version20160418100005.php#L20

@kdambekalns
Copy link
Member

Ah, so this is the cause:

@dlubitz
Copy link
Contributor Author

dlubitz commented Sep 12, 2022

Yes, seems so. Removig it creates a migration for removing the flow_identity_neos_redirecthandler_databasestorage_domain_60892 index.

@kdambekalns
Copy link
Member

Ok, if you fix the platform comparison and remove the no longer needed index definition from Redirect, thou shall pass. 🧙‍♂️

@dlubitz
Copy link
Contributor Author

dlubitz commented Sep 12, 2022

Question is, if we can remove the unique constraint too? Or if it makes to move it to the other index?

@kdambekalns
Copy link
Member

kdambekalns commented Sep 12, 2022

Question is, if we can remove the unique constraint too? Or if it makes to move it to the other index?

No, that one is built from @Flow\Identity and must stay. Drop the "duplicate named index" (as it is now) but remove it's definition from the model class, too.

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 by 📚

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost missed it: please do this for PostgreSQL, too!

@dlubitz dlubitz changed the title Remove duplicate index TASK: Remove duplicate index Sep 12, 2022
@dlubitz
Copy link
Contributor Author

dlubitz commented Sep 12, 2022

Postgres migration is also added.

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 by 📚

@kdambekalns kdambekalns closed this Oct 5, 2022
@kdambekalns kdambekalns reopened this Oct 5, 2022
@kdambekalns kdambekalns changed the base branch from main to 2.0 October 5, 2022 09:17
@kdambekalns kdambekalns changed the base branch from 2.0 to main October 5, 2022 09:17
@kdambekalns kdambekalns merged commit 1db0950 into neos:main Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants