diff --git a/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb b/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb index c673777db9..b83b1166eb 100644 --- a/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb +++ b/db/migrate/20190111170824_migrate_reviewable_queued_posts.rb @@ -17,7 +17,7 @@ class MigrateReviewableQueuedPosts < ActiveRecord::Migration[5.2] user_id, true, topic_id, - nullif(post_options->>'category', '')::int, + NULLIF(REGEXP_REPLACE(post_options->>'category', '[^0-9]+', '', 'g'), '')::int, json_build_object( 'old_queued_post_id', id, 'raw', raw