Sha256: da9247434ba1a5bc7bdf34f77b53a78335b3ec9100d8e95b321b34c14c97bd86

Contents?: true

Size: 508 Bytes

Versions: 4

Compression:

Stored size: 508 Bytes

Contents

# coding: utf-8
class ActsAsFootprintableMigration < ActiveRecord::Migration
  def self.up
    create_table :footprints do |t|
      t.references :footprintable, :polymorphic => true
      t.references :footprinter, :polymorphic => true
      t.timestamps
    end

    if ActiveRecord::VERSION::MAJOR < 4
      add_index :footprints, [:footprintable_id, :footprintable_type]
      add_index :footprints, [:footprinter_id, :footprinter_type]
    end
  end

  def self.down
    drop_table :footprints
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
acts_as_footprintable-0.2.2 lib/generators/acts_as_footprintable/migration/templates/active_record/migration.rb
acts_as_footprintable-0.2.1 lib/generators/acts_as_footprintable/migration/templates/active_record/migration.rb
acts_as_footprintable-0.2.0 lib/generators/acts_as_footprintable/migration/templates/active_record/migration.rb
acts_as_footprintable-0.1.0 lib/generators/acts_as_footprintable/migration/templates/active_record/migration.rb