docbrown/db/migrate/20181026214021_add_columns_to_notifications.rb
Andy Zhao 2db2dd1e5a WIP Refactor/notifications (#1131)
* Add new columns to notifications table

* Remove stream from notifications and add new methods

* Turn off moderation comment notifications

* Add notifiable_type index to migration

* Stop creation of Stream-based notification model instances

* Add notification model create hooks

* Add badge achievement notification creation hook

* Fix some specs

* Add missing @ symbol

* Fix for tests and rename a few things

* forgot to uncomment code sigh
2018-11-19 16:09:02 -05:00

10 lines
385 B
Ruby

class AddColumnsToNotifications < ActiveRecord::Migration[5.1]
def change
add_index :notifications, :notifiable_id
add_index :notifications, :user_id
add_index :notifications, :notifiable_type
add_column :notifications, :json_data, :jsonb
add_index :notifications, :json_data, using: :gin
add_column :notifications, :read?, :boolean, default: false
end
end