Skip to content
Merged
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
19 changes: 19 additions & 0 deletions db/migrations/20260123123229_unassign_deleted_tags.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

use Phinx\Migration\AbstractMigration;

class UnassignDeletedTags extends AbstractMigration
{
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 = COALESCE(t.modified_by, 1)
WHERE tr.deleted_on IS NULL AND t.deleted > 0
Comment thread
pylipp marked this conversation as resolved.
');
$this->output->writeln('Updated rows: '.$updated_rows);
}

public function down(): void {}
}
Loading