class HasNotificationsMigration

Public Class Methods

down() click to toggle source
# File lib/generators/has_notifications/migration/templates/migration.rb, line 15
def self.down
    drop_table :hn_notifications
end
up() click to toggle source
# File lib/generators/has_notifications/migration/templates/migration.rb, line 2
def self.up
    create_table :hn_notifications do |t|
        t.references :destination, polymorphic: true
        t.references :notification, polymorphic: true

        t.boolean :watched, default: false
 
        t.timestamps
    end

    add_index :hn_notifications, [:destination_id, :watched]
end