-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add official support for Django 5.0 #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for PR
I left small comment for tox
changes.
I also see changes for null_distinct
in django/db/backends/base.py
django/django@4.2...5.0#diff-f7637259acc1ecbb74910a7df2879cae5f3209d7a87ab0ad06dbd594b27f1831L112-L133 than nice to add, for example in django_zero_downtime_migrations/backends/postgres/schema.py
:
if django.VERSION[:2] >= (5, 0):
sql_create_unique = MultiStatementSQL(
PGShareUpdateExclusive(
"CREATE UNIQUE INDEX CONCURRENTLY %(name)s ON %(table)s (%(columns)s)s%(nulls_distinct)s",
disable_statement_timeout=True
),
PGAccessExclusive("ALTER TABLE %(table)s ADD CONSTRAINT %(name)s UNIQUE USING INDEX %(name)s"),
)
else:
sql_create_unique = MultiStatementSQL(
PGShareUpdateExclusive("CREATE UNIQUE INDEX CONCURRENTLY %(name)s ON %(table)s (%(columns)s)",
disable_statement_timeout=True),
PGAccessExclusive("ALTER TABLE %(table)s ADD CONSTRAINT %(name)s UNIQUE USING INDEX %(name)s"),
)
and
if django.VERSION[:2] >= (5, 0):
sql_create_unique_index = PGShareUpdateExclusive(
"CREATE UNIQUE INDEX CONCURRENTLY %(name)s ON %(table)s "
"(%(columns)s)%(include)s%(condition)s%(nulls_distinct)s",
disable_statement_timeout=True
)
else:
sql_create_unique_index = PGShareUpdateExclusive(
"CREATE UNIQUE INDEX CONCURRENTLY %(name)s ON %(table)s (%(columns)s)%(condition)s",
disable_statement_timeout=True
)
and add null_distinct
unit tests in tests/unit/test_schema.py
And also nice to add changes to CHANGES.md
Found the PRs where support for nulls distinct was added to Django:
I feel like I've tested only 1 of the 2 attributes, hoping to find some inspiration on how to test the other in these PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thanks
Didn't find anything that needed fixing, but let me know if I missed anything.