From 82b186172c3cfc7db0f448ccb6631cbfcfa80b22 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Fri, 23 Jan 2026 13:00:14 +0100 Subject: [PATCH 1/4] DB migration to unassign deleted tags --- .../20260123123229_unassign_deleted_tags.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 db/migrations/20260123123229_unassign_deleted_tags.php diff --git a/db/migrations/20260123123229_unassign_deleted_tags.php b/db/migrations/20260123123229_unassign_deleted_tags.php new file mode 100644 index 000000000..fb2e950f6 --- /dev/null +++ b/db/migrations/20260123123229_unassign_deleted_tags.php @@ -0,0 +1,17 @@ +execute(' + UPDATE tags_relations tr + INNER JOIN tags t ON t.id = tr.tag_id + SET tr.deleted_on = t.deleted, tr.deleted_by_id = 1 + WHERE tr.deleted_on IS NULL AND t.deleted > 0 + '); + $this->output->writeln('Updated rows: '.$updated_rows); + } +} From 155f37e3aa32bb8d2a83453dd6ee995bbcd574cc Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Wed, 20 May 2026 17:05:46 +0200 Subject: [PATCH 2/4] up-down --- db/migrations/20260123123229_unassign_deleted_tags.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/migrations/20260123123229_unassign_deleted_tags.php b/db/migrations/20260123123229_unassign_deleted_tags.php index fb2e950f6..78d2bec01 100644 --- a/db/migrations/20260123123229_unassign_deleted_tags.php +++ b/db/migrations/20260123123229_unassign_deleted_tags.php @@ -4,7 +4,7 @@ class UnassignDeletedTags extends AbstractMigration { - public function change(): void + public function up(): void { $updated_rows = $this->execute(' UPDATE tags_relations tr @@ -14,4 +14,7 @@ public function change(): void '); $this->output->writeln('Updated rows: '.$updated_rows); } + + public function down(): void + { } } From e0ec2ca123e32f9612bb43a5851438e849a6a41f Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Wed, 20 May 2026 17:06:24 +0200 Subject: [PATCH 3/4] use-modified-by --- db/migrations/20260123123229_unassign_deleted_tags.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrations/20260123123229_unassign_deleted_tags.php b/db/migrations/20260123123229_unassign_deleted_tags.php index 78d2bec01..99c5499f7 100644 --- a/db/migrations/20260123123229_unassign_deleted_tags.php +++ b/db/migrations/20260123123229_unassign_deleted_tags.php @@ -9,7 +9,7 @@ public function up(): void $updated_rows = $this->execute(' UPDATE tags_relations tr INNER JOIN tags t ON t.id = tr.tag_id - SET tr.deleted_on = t.deleted, tr.deleted_by_id = 1 + SET tr.deleted_on = t.deleted, tr.deleted_by_id = COALESCE(t.modified_by, 1) WHERE tr.deleted_on IS NULL AND t.deleted > 0 '); $this->output->writeln('Updated rows: '.$updated_rows); From 7a213cdf0c7c9b442ad90e5ec2e04990939de454 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Wed, 20 May 2026 17:08:51 +0200 Subject: [PATCH 4/4] fix-format --- db/migrations/20260123123229_unassign_deleted_tags.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/migrations/20260123123229_unassign_deleted_tags.php b/db/migrations/20260123123229_unassign_deleted_tags.php index 99c5499f7..7ddd5f87b 100644 --- a/db/migrations/20260123123229_unassign_deleted_tags.php +++ b/db/migrations/20260123123229_unassign_deleted_tags.php @@ -15,6 +15,5 @@ public function up(): void $this->output->writeln('Updated rows: '.$updated_rows); } - public function down(): void - { } + public function down(): void {} }