Sha256: 009855c96570247d3248571a207b796b08c557567238be3c37eb00c73bea6b8d

Contents?: true

Size: 581 Bytes

Versions: 5

Compression:

Stored size: 581 Bytes

Contents

class CreateTrends < ActiveRecord::Migration
  def self.up
    create_table :trends do |t|
      t.string :trendable_type
      t.integer :trendable_id
      t.string :name
      t.string :type
      t.string :fact_value
      t.string :fact_name

      t.timestamps
    end
    add_index :trends, :type
    add_index :trends, [:trendable_type, :trendable_id]
    add_index :trends, :fact_value
  end

  def self.down
    remove_index :trends, :type
    remove_index :trends, [:trendable_type, :trendable_id]
    remove_index :trends, :fact_value

    drop_table :trends
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/db/migrate/20121012170851_create_trends.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/db/migrate/20121012170851_create_trends.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/db/migrate/20121012170851_create_trends.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/db/migrate/20121012170851_create_trends.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/db/migrate/20121012170851_create_trends.rb