diff -pruN 2.0.9-1/debian/.gitignore 2.0.9-1ubuntu1/debian/.gitignore
--- 2.0.9-1/debian/.gitignore	2025-08-12 12:23:27.000000000 +0000
+++ 2.0.9-1ubuntu1/debian/.gitignore	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-/files
diff -pruN 2.0.9-1/debian/changelog 2.0.9-1ubuntu1/debian/changelog
--- 2.0.9-1/debian/changelog	2025-08-12 12:23:27.000000000 +0000
+++ 2.0.9-1ubuntu1/debian/changelog	2025-09-08 20:00:47.000000000 +0000
@@ -1,3 +1,15 @@
+python-django-postgres-extra (2.0.9-1ubuntu1) questing; urgency=medium
+
+  * Fix Django 5.2 compatibility.
+    - d/p/django-5-fix-rename_annotation.patch: Fix rename_annotation for
+      Django 5.2+.
+    - d/p/django-5-fix-index_together.patch: Replace index_together usage for
+      Django 5.2+.
+    - d/p/django-5-remove-ops-checks.patch: Remove introspection and ops checks
+      for Django 5.0+.
+
+ -- Lena Voytek <lena.voytek@canonical.com>  Mon, 08 Sep 2025 16:00:47 -0400
+
 python-django-postgres-extra (2.0.9-1) unstable; urgency=medium
 
   * Team upload.
diff -pruN 2.0.9-1/debian/control 2.0.9-1ubuntu1/debian/control
--- 2.0.9-1/debian/control	2025-08-12 12:23:27.000000000 +0000
+++ 2.0.9-1ubuntu1/debian/control	2025-09-08 20:00:47.000000000 +0000
@@ -1,7 +1,8 @@
 Source: python-django-postgres-extra
 Section: python
 Priority: optional
-Maintainer: Debian Python Team <team+python@tracker.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
 Uploaders:
  Michael Fladischer <fladi@debian.org>,
 Build-Depends:
diff -pruN 2.0.9-1/debian/patches/django-5-fix-index_together.patch 2.0.9-1ubuntu1/debian/patches/django-5-fix-index_together.patch
--- 2.0.9-1/debian/patches/django-5-fix-index_together.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.0.9-1ubuntu1/debian/patches/django-5-fix-index_together.patch	2025-09-08 16:53:12.000000000 +0000
@@ -0,0 +1,100 @@
+From 70c0ee27b4a4e0801726f82f5154577693505a8d Mon Sep 17 00:00:00 2001
+From: Swen Kooij <swen@sectorlabs.ro>
+Date: Sun, 8 Jun 2025 09:48:45 +0200
+Subject: [PATCH] Account for `index_together` removal in Django 5.2
+
+---
+ psqlextra/backend/schema.py                   |  9 ++--
+ ...est_schema_editor_clone_model_to_schema.py | 52 ++++++++++---------
+ 2 files changed, 33 insertions(+), 28 deletions(-)
+
+diff --git a/psqlextra/backend/schema.py b/psqlextra/backend/schema.py
+index 31a23414..81acbbb3 100644
+--- a/psqlextra/backend/schema.py
++++ b/psqlextra/backend/schema.py
+@@ -250,10 +250,11 @@ def clone_model_constraints_and_indexes_to_schema(
+                     model, tuple(), model._meta.unique_together
+                 )
+ 
+-            if model._meta.index_together:
+-                self.alter_index_together(
+-                    model, tuple(), model._meta.index_together
+-                )
++            if django.VERSION < (5, 2):
++                if model._meta.index_together:
++                    self.alter_index_together(
++                        model, tuple(), model._meta.index_together
++                    )
+ 
+             for field in model._meta.local_concrete_fields:  # type: ignore[attr-defined]
+                 # Django creates primary keys later added to the model with
+diff --git a/tests/test_schema_editor_clone_model_to_schema.py b/tests/test_schema_editor_clone_model_to_schema.py
+index c3d41917..ef919bcd 100644
+--- a/tests/test_schema_editor_clone_model_to_schema.py
++++ b/tests/test_schema_editor_clone_model_to_schema.py
+@@ -156,6 +156,33 @@ def fake_model_fk_target_2():
+ 
+ @pytest.fixture
+ def fake_model(fake_model_fk_target_1, fake_model_fk_target_2):
++    meta_options = {
++        "indexes": [
++            models.Index(fields=["age", "height"]),
++            models.Index(fields=["age"], name="age_index"),
++            GinIndex(fields=["nicknames"], name="nickname_index"),
++        ],
++        "constraints": [
++            models.UniqueConstraint(
++                fields=["first_name", "last_name"],
++                name="first_last_name_uniq",
++            ),
++            models.CheckConstraint(
++                check=Q(age__gt=0, height__gt=0), name="age_height_check"
++            ),
++        ],
++        "unique_together": (
++            "first_name",
++            "nicknames",
++        ),
++    }
++
++    if django.VERSION < (5, 2):
++        meta_options["index_together"] = (
++            "blob",
++            "age",
++        )
++
+     model = get_fake_model(
+         {
+             "first_name": models.TextField(null=True),
+@@ -171,30 +198,7 @@ def fake_model(fake_model_fk_target_1, fake_model_fk_target_2):
+                 fake_model_fk_target_2, null=True, on_delete=models.SET_NULL
+             ),
+         },
+-        meta_options={
+-            "indexes": [
+-                models.Index(fields=["age", "height"]),
+-                models.Index(fields=["age"], name="age_index"),
+-                GinIndex(fields=["nicknames"], name="nickname_index"),
+-            ],
+-            "constraints": [
+-                models.UniqueConstraint(
+-                    fields=["first_name", "last_name"],
+-                    name="first_last_name_uniq",
+-                ),
+-                models.CheckConstraint(
+-                    check=Q(age__gt=0, height__gt=0), name="age_height_check"
+-                ),
+-            ],
+-            "unique_together": (
+-                "first_name",
+-                "nicknames",
+-            ),
+-            "index_together": (
+-                "blob",
+-                "age",
+-            ),
+-        },
++        meta_options=meta_options,
+     )
+ 
+     yield model
diff -pruN 2.0.9-1/debian/patches/django-5-fix-rename_annotation.patch 2.0.9-1ubuntu1/debian/patches/django-5-fix-rename_annotation.patch
--- 2.0.9-1/debian/patches/django-5-fix-rename_annotation.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.0.9-1ubuntu1/debian/patches/django-5-fix-rename_annotation.patch	2025-09-08 20:00:23.000000000 +0000
@@ -0,0 +1,30 @@
+From 8760a67a6ad8790de54b90f1edf11a60ae2da863 Mon Sep 17 00:00:00 2001
+From: Swen Kooij <swen@sectorlabs.ro>
+Date: Sun, 8 Jun 2025 09:44:47 +0200
+Subject: [PATCH] Fix `rename_annotation` for Django 5.2 and newer
+
+Was broken by this change:
+https://github.com/django/django/commit/65ad4ade74dc9208b9d686a451cd6045df0c9c3a
+---
+ psqlextra/sql.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/psqlextra/sql.py b/psqlextra/sql.py
+index cf12d8c..750287c 100644
+--- a/psqlextra/sql.py
++++ b/psqlextra/sql.py
+@@ -70,8 +70,12 @@ def rename_annotations(self, annotations) -> None:
+                 # and a list in Django 5.x and newer.
+                 # https://github.com/django/django/commit/d6b6e5d0fd4e6b6d0183b4cf6e4bd4f9afc7bf67
+                 if isinstance(self.annotation_select_mask, set):
+-                    self.annotation_select_mask.discard(old_name)
+-                    self.annotation_select_mask.add(new_name)
++                    updated_annotation_select_mask = set(
++                        self.annotation_select_mask
++                    )
++                    updated_annotation_select_mask.discard(old_name)
++                    updated_annotation_select_mask.add(new_name)
++                    self.set_annotation_mask(updated_annotation_select_mask)
+                 elif isinstance(self.annotation_select_mask, list):
+                     self.annotation_select_mask.remove(old_name)
+                     self.annotation_select_mask.append(new_name)
diff -pruN 2.0.9-1/debian/patches/django-5-remove-ops-checks.patch 2.0.9-1ubuntu1/debian/patches/django-5-remove-ops-checks.patch
--- 2.0.9-1/debian/patches/django-5-remove-ops-checks.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.0.9-1ubuntu1/debian/patches/django-5-remove-ops-checks.patch	2025-08-14 17:09:55.000000000 +0000
@@ -0,0 +1,29 @@
+From a5bd4a6df40a45abe09b86e55f3114c45be14218 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tudor=20V=C4=83ran?= <tudor@sectorlabs.ro>
+Date: Thu, 10 Jul 2025 15:41:42 +0300
+Subject: [PATCH] Remove introspection and ops checks on Django >= 5.0 (#264)
+
+---
+ psqlextra/backend/base.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/psqlextra/backend/base.py
++++ b/psqlextra/backend/base.py
+@@ -2,6 +2,7 @@
+ 
+ from typing import TYPE_CHECKING
+ 
++from django import VERSION
+ from django.conf import settings
+ from django.contrib.postgres.signals import (
+     get_hstore_oids,
+@@ -45,6 +46,9 @@
+     def __init__(self, *args, **kwargs):
+         super().__init__(*args, **kwargs)
+ 
++        if VERSION >= (5, 0):
++            return
++
+         # Some base back-ends such as the PostGIS back-end don't properly
+         # set `ops_class` and `introspection_class` and initialize these
+         # classes themselves.
diff -pruN 2.0.9-1/debian/patches/series 2.0.9-1ubuntu1/debian/patches/series
--- 2.0.9-1/debian/patches/series	2025-08-12 12:23:27.000000000 +0000
+++ 2.0.9-1ubuntu1/debian/patches/series	2025-09-08 20:00:23.000000000 +0000
@@ -1 +1,4 @@
 0001-Use-local-objects.inv-in-intersphinx-mapping.patch
+django-5-fix-rename_annotation.patch
+django-5-fix-index_together.patch
+django-5-remove-ops-checks.patch
