FIX: Skip migrating null/blank custom field values in migrations
This commit is contained in:
parent
2bd2600476
commit
835b3580b7
|
@ -15,6 +15,7 @@ class CreateDiscourseVotingVotes < ActiveRecord::Migration[6.0]
|
|||
SELECT value::integer, user_id, 'false', created_at, updated_at
|
||||
FROM user_custom_fields
|
||||
WHERE name = 'votes'
|
||||
AND value <> ''
|
||||
ON CONFLICT(user_id, topic_id) DO NOTHING
|
||||
SQL
|
||||
|
||||
|
@ -23,6 +24,7 @@ class CreateDiscourseVotingVotes < ActiveRecord::Migration[6.0]
|
|||
SELECT value::integer, user_id, 'true', created_at, updated_at
|
||||
FROM user_custom_fields
|
||||
WHERE name = 'votes_archive'
|
||||
AND value <> ''
|
||||
ON CONFLICT(user_id, topic_id) DO NOTHING
|
||||
SQL
|
||||
end
|
||||
|
|
|
@ -14,6 +14,7 @@ class CreateDiscourseVotingTopicVoteCount < ActiveRecord::Migration[6.0]
|
|||
SELECT topic_id::integer, value::integer, created_at, updated_at
|
||||
FROM topic_custom_fields
|
||||
WHERE name = 'vote_count'
|
||||
AND value <> ''
|
||||
SQL
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue