19 lines
358 B
Ruby
19 lines
358 B
Ruby
class AddReasonToPops < ActiveRecord::Migration[8.1]
|
|
def change
|
|
add_column :pops, :reason, :string
|
|
|
|
create_table :pop_reasons do |t|
|
|
t.references :account, index: true
|
|
t.string :label
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
execute <<~SQL
|
|
update pops set reason = 'Closed'
|
|
SQL
|
|
|
|
change_column_null :pops, :reason, false
|
|
end
|
|
end
|