Remove delete votes where there are no users because that cannot happen

This commit is contained in:
Nat 2024-08-02 18:44:12 +08:00
parent 5522634d7f
commit e4b785a76e
No known key found for this signature in database
GPG Key ID: 4938B35D927EC773
1 changed files with 0 additions and 8 deletions

View File

@ -24,14 +24,6 @@ class EnsureConsistency < ActiveRecord::Migration[7.0]
dvv1.archive = dvv2.archive
SQL
# delete votes associated with no user
DB.exec(<<~SQL)
DELETE FROM topic_voting_votes
USING topic_voting_votes tvv
LEFT JOIN users u ON tvv.user_id = u.id
WHERE u.id IS NULL;
SQL
# delete votes associated with no topics
DB.exec(<<~SQL)
DELETE FROM topic_voting_votes