Skip to content

Conversation

@pylipp
Copy link
Contributor

@pylipp pylipp commented Jan 23, 2026

https://trello.com/c/fYH0ezlH

Testing:

  • start DB
  • list active tags_relations with deleted tags (should be 0):
select count(1) from tags_relations tr
inner join tags t
on t.id = tr.tag_id
where ((tr.deleted_on is NULL) and (t.deleted > 0))
  • soft-delete some tags: update tags set deleted = NOW() where id in (45, 47);
  • list active tags_relations with deleted tags again (should be 75 rows)
  • run the migration. Should print "Updated rows: 75"
  • list active tags_relations with deleted tags again (should be 0 rows)
  • compare deleted fields (should be the same):
select deleted from tags where id in (45, 47);
select deleted_on from tags_relations where tag_id in (45, 47);

I set tr.deleted_by_id = 1 because I find it inconsistent to have tags_relations rows with non-NULL deleted_on but NULL deleted_by_id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants