mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:43:54 -06:00
9ee8a01c3a
Follow up to https://review.discourse.org/t/dev-add-created-via-column-to-incomingemail-pr-11751/18366/6
15 lines
429 B
Ruby
15 lines
429 B
Ruby
# 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
|