Sha256: 897137da7231175952c0ce54f79dd4fa66cd93e42cd3f198aa19c4ed8723ac84

Contents?: true

Size: 701 Bytes

Versions: 7

Compression:

Stored size: 701 Bytes

Contents

# Migration responsible for creating a table with notifications
class CreateNotifications < ActiveRecord::Migration
  # Create table
  def change
    create_table :notifications do |t|
      t.belongs_to :target,     polymorphic: true, index: true, null: false
      t.belongs_to :notifiable, polymorphic: true, index: true, null: false
      t.string     :key                                       , null: false
      t.belongs_to :group,      polymorphic: true, index: true
      t.integer    :group_owner_id               , index: true
      t.belongs_to :notifier,   polymorphic: true, index: true
      t.text       :parameters
      t.datetime   :opened_at

      t.timestamps
    end
  end
end

Version data entries

7 entries across 6 versions & 1 rubygems

Version Path
activity_notification-1.0.2 spec/rails_app/db/migrate/20160715050420_create_notifications.rb
activity_notification-1.0.1 spec/rails_app/db/migrate/20160715050420_create_notifications.rb
activity_notification-1.0.0 spec/rails_app/db/migrate/20160715050420_create_notifications.rb
activity_notification-0.0.10 spec/rails_app/db/migrate/20160715050420_create_notifications.rb
activity_notification-0.0.9 spec/rails_app/db/migrate/20160715050420_create_notifications.rb
activity_notification-0.0.8 spec/rails_app/db/migrate/20160715050420_create_notifications.rb
activity_notification-0.0.8 lib/generators/templates/active_record/migration.rb