discourse/db/migrate/20210121001720_change_incom...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
429 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class ChangeIncomingEmailCreatedAtNull < ActiveRecord::Migration[6.0]
def up
# 0 signifies unknown
DB.exec("UPDATE incoming_emails SET created_via = 0 WHERE created_via IS NULL")
change_column_default :incoming_emails, :created_via, 0
change_column_null :incoming_emails, :created_via, false
end
def down
change_column_null :incoming_emails, :created_via, true
end
end