Skip to content

fix(db-postgres): add filenameCompoundIndex baseIndexes for upload collections#15182

Merged
DanRibbens merged 3 commits intopayloadcms:mainfrom
tapartdev:patch-1
Jan 13, 2026
Merged

fix(db-postgres): add filenameCompoundIndex baseIndexes for upload collections#15182
DanRibbens merged 3 commits intopayloadcms:mainfrom
tapartdev:patch-1

Conversation

@tapartdev
Copy link
Copy Markdown
Contributor

Description:
When using the filenameCompoundIndex property on an upload collection, this index was not being added to the database. By adding this rule, the compound index is now correctly applied.

What?

The filenameCompoundIndex property was ignored when defining upload collections, so compound indexes were not created in the database.

Why?

Without this index, queries that rely on the compound key (e.g., filename + some other field) are slower and may lead to unexpected duplicates.

How?

Updated the logic for creating upload collection indexes to include the filenameCompoundIndex rule. This ensures that the compound index is added to the database during collection setup.

@tapartdev tapartdev changed the title fix: Add filenameCompoundIndex baseIndexes for upload collections fix(upload): add filenameCompoundIndex baseIndexes for upload collections Jan 13, 2026
@tapartdev tapartdev changed the title fix(upload): add filenameCompoundIndex baseIndexes for upload collections fix(db-postgres): add filenameCompoundIndex baseIndexes for upload collections Jan 13, 2026
@DanRibbens DanRibbens requested a review from r1tsuu January 13, 2026 15:14
@DanRibbens DanRibbens merged commit 01f90c9 into payloadcms:main Jan 13, 2026
99 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.71.0

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.

3 participants