Skip to content

Nulls not distinct#1609

Open
jkeuhlen wants to merge 8 commits into
yesodweb:masterfrom
jkeuhlen:NullsNotDistinct
Open

Nulls not distinct#1609
jkeuhlen wants to merge 8 commits into
yesodweb:masterfrom
jkeuhlen:NullsNotDistinct

Conversation

@jkeuhlen

@jkeuhlen jkeuhlen commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

Before submitting your PR, check that you've:

  • Documented new APIs with Haddock markup
  • Added @since declarations to the Haddock
  • Ran fourmolu on any changed files (restyled will do this for you, so
    accept the suggested changes if it makes them)
  • Adhered to the code style (see the .editorconfig and fourmolu.yaml files for details)

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Bumped the version number if there isn't an (unreleased) on the Changelog
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

This implements 2/3/4 from #1607

@jkeuhlen jkeuhlen marked this pull request as draft September 4, 2025 22:14
jkeuhlen and others added 3 commits January 12, 2026 16:11
Resolved conflicts:
- persistent-postgresql.cabal: kept both MigrationSpec and NullsNotDistinctTest modules
- TH/Internal.hs: merged error message to include both nullsNotDistinct option and getBy warning
- Internal.hs: took master's refactored version (migration code moved to Internal/Migration.hs)
- Applied NullsNotDistinct changes to the new Internal/Migration.hs location:
  - Added [Attr] parameter to AddUniqueConstraint
  - Updated udToPair to return triple including uniqueAttrs
  - Added NULLS NOT DISTINCT clause in showAlterTable
  - Updated getAlters and related functions for new tuple types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
# Conflicts:
#	persistent-postgresql/ChangeLog.md
#	persistent/ChangeLog.md
image: postgres:12-alpine
# Use a PostgreSQL version that supports UNIQUE NULLS NOT DISTINCT (15+),
# so the NullsNotDistinctTest suite actually exercises the feature.
image: postgres:16-alpine

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's unclear to me if this would generally be desirable, or if there would be a preference to run against a matrix of postgres versions, but 12 is a pretty old version of postgres so I bumped to something more recent here to make sure the tests for this branch are actually meaningful.

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.

1 participant