discourse-akismet/db/migrate/20191031193436_remove_old_akismet_states.rb
2019-11-22 12:26:20 +01:00

14 lines
316 B
Ruby

# frozen_string_literal: true
class RemoveOldAkismetStates < ActiveRecord::Migration[5.2]
def up
DB.exec(<<~SQL, updated_at: 5.minutes.ago
DELETE FROM post_custom_fields
WHERE name = 'AKISMET_STATE' AND value = 'needs_review' AND updated_at < :updated_at
SQL
)
end
def down
end
end