From b596a1eb80be4b24142d131238dd5402db6bb855 Mon Sep 17 00:00:00 2001
From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com>
Date: Thu, 11 Nov 2021 16:01:13 +0100
Subject: [PATCH] Move sql file for `remove_deleted_devices_from_device_inbox`
 into v65 (#11303)

---
 changelog.d/11303.misc                                          | 1 +
 .../05remove_deleted_devices_from_device_inbox.sql}             | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
 create mode 100644 changelog.d/11303.misc
 rename synapse/storage/schema/main/delta/{64/02remove_deleted_devices_from_device_inbox.sql => 65/05remove_deleted_devices_from_device_inbox.sql} (93%)

diff --git a/changelog.d/11303.misc b/changelog.d/11303.misc
new file mode 100644
index 0000000000..50af92bfa5
--- /dev/null
+++ b/changelog.d/11303.misc
@@ -0,0 +1 @@
+Fix an issue which prevented the 'remove deleted devices from device_inbox column' background process from running when updating from a recent Synapse version.
diff --git a/synapse/storage/schema/main/delta/64/02remove_deleted_devices_from_device_inbox.sql b/synapse/storage/schema/main/delta/65/05remove_deleted_devices_from_device_inbox.sql
similarity index 93%
rename from synapse/storage/schema/main/delta/64/02remove_deleted_devices_from_device_inbox.sql
rename to synapse/storage/schema/main/delta/65/05remove_deleted_devices_from_device_inbox.sql
index fca7290741..076179123d 100644
--- a/synapse/storage/schema/main/delta/64/02remove_deleted_devices_from_device_inbox.sql
+++ b/synapse/storage/schema/main/delta/65/05remove_deleted_devices_from_device_inbox.sql
@@ -19,4 +19,4 @@
 -- This runs as background task, but may take a bit to finish.
 
 INSERT INTO background_updates (ordering, update_name, progress_json) VALUES
-  (6402, 'remove_deleted_devices_from_device_inbox', '{}');
+  (6505, 'remove_deleted_devices_from_device_inbox', '{}');
-- 
GitLab