Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions db/migrations/20260123123229_unassign_deleted_tags.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use Phinx\Migration\AbstractMigration;

class UnassignDeletedTags extends AbstractMigration
{
public function change(): 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
WHERE tr.deleted_on IS NULL AND t.deleted > 0
');
$this->output->writeln('Updated rows: '.$updated_rows);
}
}