nextcloud / polls

🗳️ Polls app for Nextcloud
https://apps.nextcloud.com/apps/polls
GNU Affero General Public License v3.0
257 stars 73 forks source link

feat: Keep unchanged indices and foreign keys instead of recreating #3689

Closed come-nc closed 2 months ago

come-nc commented 2 months ago

Hello,

As an alternative to switching to the standard way of handling schemas and indices, this PR avoid recreating already correct indices and foreign keys.

On foreign keys I’m less sure because I fail to see why they were recreated to start with, given that they are only removed on tables from TableSchema::FK_CHILD_TABLES, and I do not think the name of the parent table can ever change?

come-nc commented 2 months ago

I should’ve duplicate the methods instead of renaming them, not sure how I missed that they were also used elsewhere -_-

come-nc commented 2 months ago

Closing this since indices are not dropped by the repair step anymore in master :+1: