Skip to content

Conversation

@JamesGriffin
Copy link
Contributor

@JamesGriffin JamesGriffin commented Jul 4, 2025

This PR fixes a bug where a unique constraint with expressions produces invalid SQL when used with SaferAddUniqueConstraint and SaferRemoveUniqueConstraint.

These changes are based on a previous PR which solved a similar issue for unique constraints with conditions.

@JamesGriffin JamesGriffin force-pushed the unique-constraint/with-expressions branch from 313f340 to 46fc4c6 Compare July 4, 2025 16:57
@JamesGriffin JamesGriffin marked this pull request as ready for review July 4, 2025 17:03
Copy link
Contributor

@marcelofern marcelofern left a comment

Choose a reason for hiding this comment

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

Nice! The coverage job isn't running (don't know why) - it seems like a permission given that you're running from a fork. It passes locally on the branch though:

---------------------------------------------------------------------------------------------------------------------
src/django_pg_migration_tools/indexes.py                                                9      0      0      0   100%
src/django_pg_migration_tools/management/commands/migrate_with_timeouts.py            138      0     20      0   100%
src/django_pg_migration_tools/operations.py                                           453      0     90      0   100%
src/django_pg_migration_tools/timeouts.py                                              73      0     30      0   100%
tests/django_pg_migration_tools/management/commands/test_migrate_with_timeouts.py     126      0      0      0   100%
tests/django_pg_migration_tools/test_indexes.py                                        33      0      0      0   100%
tests/django_pg_migration_tools/test_operations.py                                   1740      0      0      0   100%
tests/django_pg_migration_tools/test_package.py                                         3      0      0      0   100%
tests/django_pg_migration_tools/test_timeouts.py                                       75      0      0      0   100%
---------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                2650      0    140      0   100%

@marcelofern marcelofern merged commit 6857589 into kraken-tech:main Jul 6, 2025
10 of 12 checks passed
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.

2 participants