Skip to content

Commit

Permalink
Merge pull request #7045 from romayalon/romy-pg-indexes-4.11
Browse files Browse the repository at this point in the history
[BACKPORT to 4.11] | fix postgres unique indexes
  • Loading branch information
nimrod-becker authored Aug 22, 2022
2 parents b9cc107 + cf9af08 commit 92069ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/object_services/schemas/object_md_indexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module.exports = [
fields: {
bucket: 1,
key: 1,
// we include version_past as extra index field to separate from null_version_index.
// For MONGO deployments - we include version_past as extra index field to separate from null_version_index.
// note that version_past is always null here by partialFilterExpression.
version_past: 1,
...(process.env.DB_TYPE === 'postgres' ? {} : { version_past: 1 })
},
options: {
name: 'latest_version_index',
Expand All @@ -36,9 +36,9 @@ module.exports = [
fields: {
bucket: 1,
key: 1,
// we include version_enabled as extra index field to separate from latest_version_index.
// For MONGO deployments - we include version_enabled as extra index field to separate from latest_version_index.
// note that version_enabled is always null here by partialFilterExpression.
version_enabled: 1,
...(process.env.DB_TYPE === 'postgres' ? {} : { version_enabled: 1 })
},
options: {
name: 'null_version_index',
Expand Down

0 comments on commit 92069ea

Please sign in to comment.