Skip to content

fix(migration): stop using the removed IIndex::hasColumnAtPosition() - #1493

Closed
solracsf wants to merge 1 commit into
mainfrom
fix/psalm-iindex-hascolumnatposition
Closed

fix(migration): stop using the removed IIndex::hasColumnAtPosition()#1493
solracsf wants to merge 1 commit into
mainfrom
fix/psalm-iindex-hascolumnatposition

Conversation

@solracsf

Copy link
Copy Markdown
Member

Nextcloud 35 reduced the schema API surface and dropped hasColumnAtPosition() from OCP\DB\Schema\IIndex, which fails the static-psalm-analysis dev-master job with four UndefinedInterfaceMethod errors in this migration.

Use getColumns() instead, which exists both on the new IIndex and on the Doctrine index objects still returned by Nextcloud 29 to 34, and compare the first column the way Doctrine did, unquoted and case insensitively, so the behaviour is unchanged on every supported server version.

@CarlSchwan

Copy link
Copy Markdown
Member

We can add hasColumnAtPosition back

@solracsf

solracsf commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Happy either way, though I don't think it needs to come back just for this.

There's also an argument for leaving it out. Index::hasColumnAtPosition() is deprecated in doctrine/dbal 4.4 in favour of getIndexedColumns(), and it's built on top of getUnquotedColumns() and getColumns(), which are deprecated in the same release.

Putting it back on IIndex would tie a public @since API to something DBAL is already retiring.

Your call here.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf
solracsf force-pushed the fix/psalm-iindex-hascolumnatposition branch from 1b41d1d to 16e655c Compare August 11, 2026 11:18
@solracsf solracsf self-assigned this Aug 11, 2026
@solracsf
solracsf requested a review from CarlSchwan August 11, 2026 12:06
@CarlSchwan

Copy link
Copy Markdown
Member

Done in nextcloud/server#63152 this would obsolete your PR

@solracsf

Copy link
Copy Markdown
Member Author

Feel free to close it once merged :)

@CarlSchwan

Copy link
Copy Markdown
Member

Merged

@CarlSchwan CarlSchwan closed this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants