-
-
Notifications
You must be signed in to change notification settings - Fork 59
Comparing changes
Open a pull request
base repository: adamchainz/django-upgrade
base: 1.17.0
head repository: adamchainz/django-upgrade
compare: 1.19.0
- 19 commits
- 49 files changed
- 2 contributors
Commits on May 14, 2024
-
[pre-commit.ci] pre-commit autoupdate (#451)
<!--pre-commit.ci start--> updates: - [github.com/tox-dev/pyproject-fmt: 1.8.0 → 2.0.4](tox-dev/pyproject-fmt@1.8.0...2.0.4) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adam Johnson <me@adamj.eu>
Configuration menu - View commit details
-
Copy full SHA for 0d47a58 - Browse repository at this point
Copy the full SHA 0d47a58View commit details
Commits on May 21, 2024
-
[pre-commit.ci] pre-commit autoupdate (#452)
<!--pre-commit.ci start--> updates: - [github.com/tox-dev/pyproject-fmt: 2.0.4 → 2.1.1](tox-dev/pyproject-fmt@2.0.4...2.1.1) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 1519dc0 - Browse repository at this point
Copy the full SHA 1519dc0View commit details
Commits on May 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d83874b - Browse repository at this point
Copy the full SHA d83874bView commit details
Commits on May 28, 2024
-
[pre-commit.ci] pre-commit autoupdate (#454)
<!--pre-commit.ci start--> updates: - [github.com/tox-dev/pyproject-fmt: 2.1.1 → 2.1.3](tox-dev/pyproject-fmt@2.1.1...2.1.3) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 4f85470 - Browse repository at this point
Copy the full SHA 4f85470View commit details -
Configuration menu - View commit details
-
Copy full SHA for 585dbe0 - Browse repository at this point
Copy the full SHA 585dbe0View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0fc922 - Browse repository at this point
Copy the full SHA d0fc922View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1effd6c - Browse repository at this point
Copy the full SHA 1effd6cView commit details
Commits on Jun 12, 2024
-
[pre-commit.ci] pre-commit autoupdate (#458)
<!--pre-commit.ci start--> updates: - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](asottile/pyupgrade@v3.15.2...v3.16.0) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 9f1189a - Browse repository at this point
Copy the full SHA 9f1189aView commit details
Commits on Jun 15, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 454d858 - Browse repository at this point
Copy the full SHA 454d858View commit details
Commits on Jun 17, 2024
-
[pre-commit.ci] pre-commit autoupdate (#461)
<!--pre-commit.ci start--> updates: - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](PyCQA/flake8@7.0.0...7.1.0) <!--pre-commit.ci end--> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 42dfa59 - Browse repository at this point
Copy the full SHA 42dfa59View commit details
Commits on Jun 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b8f89ea - Browse repository at this point
Copy the full SHA b8f89eaView commit details -
Some improvments flagged by Repo-Review: https://learn.scientific-python.org/development/guides/repo-review/ 1. Remove now-default show_error_codes. 2. Enable some optional error codes with extra checks.
Configuration menu - View commit details
-
Copy full SHA for 4d17c1c - Browse repository at this point
Copy the full SHA 4d17c1cView commit details
Commits on Jun 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c0e116e - Browse repository at this point
Copy the full SHA c0e116eView commit details -
Add missing empty Django versions to README (#463)
Just being explicit.
Configuration menu - View commit details
-
Copy full SHA for e97aab5 - Browse repository at this point
Copy the full SHA e97aab5View commit details
Commits on Jun 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d3bdf2e - Browse repository at this point
Copy the full SHA d3bdf2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 40c275e - Browse repository at this point
Copy the full SHA 40c275eView commit details -
Remove pushing of state onto nodes stack (#466)
Vestigial from pyupgrade skeleton.
Configuration menu - View commit details
-
Copy full SHA for c50e9f9 - Browse repository at this point
Copy the full SHA c50e9f9View commit details
Commits on Jun 27, 2024
-
Add Model.Meta.index_together fixer (#464)
Fixes #344. Handles both forms of `index_together`, in list and tuple, and with/without existing `indexes` definition. Tried to cover every edge case I could think of, per tests. Tested on Sentry, the only project I could find with historical `index_together` definitions. Use this commit: getsentry/sentry@a32270c, just before github.com/getsentry/sentry/commit/00884d133eaaedf3e69bc8ab3d3bca781e0c425f and later commits updated `index_together`. Saw successful rewrites: ```console $ git ls-files -z '*.py' | xargs -0 django-upgrade --target-version 4.2 --only index_together Rewriting src/sentry/feedback/models.py Rewriting src/sentry/incidents/models.py Rewriting src/sentry/models/activity.py Rewriting src/sentry/models/artifactbundle.py Rewriting src/sentry/models/commit.py Rewriting src/sentry/models/debugfile.py Rewriting src/sentry/models/eventattachment.py Rewriting src/sentry/models/group.py Rewriting src/sentry/models/grouphistory.py Rewriting src/sentry/models/groupinbox.py Rewriting src/sentry/models/grouprelease.py Rewriting src/sentry/models/organizationmembermapping.py Rewriting src/sentry/models/outbox.py Rewriting src/sentry/models/pullrequest.py Rewriting src/sentry/models/release.py Rewriting src/sentry/models/releasefile.py Rewriting src/sentry/models/releaseprojectenvironment.py Rewriting src/sentry/models/rule.py Rewriting src/sentry/models/statistical_detectors.py Rewriting src/sentry/models/userreport.py Rewriting src/sentry/replays/models.py ``` ...and the diff looks good: ```diff $ git diff '*.py' | head -n 50 diff --git src/sentry/feedback/models.py src/sentry/feedback/models.py index 3527d584bc4..b15d3a8ba45 100644 --- src/sentry/feedback/models.py +++ src/sentry/feedback/models.py @@ -27,6 +27,6 @@ class Feedback(Model): class Meta: app_label = "feedback" db_table = "feedback_feedback" - index_together = [("project_id", "date_added")] + indexes = [models.Index(fields=("project_id", "date_added"))] __repr__ = sane_repr("project_id", "feedback_id") diff --git src/sentry/incidents/models.py src/sentry/incidents/models.py index 6a4f4f6ae39..06e84dc7136 100644 --- src/sentry/incidents/models.py +++ src/sentry/incidents/models.py @@ -205,7 +205,7 @@ class Meta: app_label = "sentry" db_table = "sentry_incident" unique_together = (("organization", "identifier"),) - index_together = (("alert_rule", "type", "status"),) + indexes = [models.Index(fields=("alert_rule", "type", "status"))] @Property def current_end_date(self): @@ -561,7 +561,7 @@ class Meta: app_label = "sentry" db_table = "sentry_incidenttrigger" unique_together = (("incident", "alert_rule_trigger"),) - index_together = (("alert_rule_trigger", "incident_id"),) + indexes = [models.Index(fields=("alert_rule_trigger", "incident_id"))] class AlertRuleTriggerManager(BaseManager["AlertRuleTrigger"]): diff --git src/sentry/models/activity.py src/sentry/models/activity.py index aa9e0545adc..57575e9ac6b 100644 --- src/sentry/models/activity.py +++ src/sentry/models/activity.py @@ -109,7 +109,7 @@ class Activity(Model): class Meta: app_label = "sentry" db_table = "sentry_activity" - index_together = (("project", "datetime"),) + indexes = [models.Index(fields=("project", "datetime"))] __repr__ = sane_repr("project_id", "group_id", "event_id", "user_id", "type", "ident") diff --git src/sentry/models/artifactbundle.py src/sentry/models/artifactbundle.py index 323912d6d98..cbfb61c8805 100644 --- src/sentry/models/artifactbundle.py ``` One model was missed due to no `from django.db import models` in the file - I am gonna leave that for extension, if anyone wants.
Configuration menu - View commit details
-
Copy full SHA for d940d0e - Browse repository at this point
Copy the full SHA d940d0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b6dc726 - Browse repository at this point
Copy the full SHA b6dc726View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 1.17.0...1.19.0