Files
grecia/db/migrate/20160105170113_merge_activities_and_notifications.rb
Javi Martín df959b74f6 Make migrations reversible
While I don't use this feature, there are developers who do. It's useful
when running migrations and changing branches.

I'm raising an `ActiveRecord::IrreversibleMigration` exception in every
`drop_table` migration because these migrations were all done before
version 1.0.0, and so making all of them reversible would be too much
work for little benefit.
2019-10-24 21:20:17 +02:00

10 lines
337 B
Ruby

class MergeActivitiesAndNotifications < ActiveRecord::Migration[4.2]
def change
remove_column :notifications, :read, :boolean, default: false
remove_index :notifications, column: [:activity_id]
remove_column :notifications, :activity_id, :integer
add_reference :notifications, :notifiable, polymorphic: true
end
end