Sha256: 6008668a1a4fc5a5fea8ebc141913f6e6942658267ca749926d83816102c09b8

Contents?: true

Size: 377 Bytes

Versions: 5

Compression:

Stored size: 377 Bytes

Contents

class UnreadMigration < ActiveRecord::Migration
  def self.up
    create_table :read_marks, force: true do |t|
      t.references :readable, polymorphic: { null: false }
      t.references :user,     null: false
      t.datetime :timestamp
    end

    add_index :read_marks, [:user_id, :readable_type, :readable_id]
  end

  def self.down
    drop_table :read_marks
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
unread-0.6.3 lib/generators/unread/migration/templates/migration.rb
unread-0.6.2 lib/generators/unread/migration/templates/migration.rb
unread-0.6.1 lib/generators/unread/migration/templates/migration.rb
unread-0.6.0 lib/generators/unread/migration/templates/migration.rb
unread-0.5.0 lib/generators/unread/migration/templates/migration.rb