Sha256: 2ae9c32032fc8f889f294043487dc2d1df97db9e343ad8db579d4686e5f464ea

Contents?: true

Size: 452 Bytes

Versions: 2

Compression:

Stored size: 452 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 :reader,   polymorphic: { null: false }
      t.datetime :timestamp
    end

    add_index :read_marks, [:reader_id, :reader_type, :readable_type, :readable_id], name: 'read_marks_reader_readable_index'
  end

  def self.down
    drop_table :read_marks
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unread-0.7.1 lib/generators/unread/migration/templates/migration.rb
unread-0.7.0 lib/generators/unread/migration/templates/migration.rb