Sha256: 38b498d42eb2d31e7006bdcbdc1de9b17fdc89d8bf4bfd97513d5de041fb8564

Contents?: true

Size: 1018 Bytes

Versions: 8

Compression:

Stored size: 1018 Bytes

Contents

class ReputationCreateTables < ActiveRecord::Migration
  def self.up
    create_table :reputation_rules do |t|
      t.string  :name
      t.integer :weight
      t.string  :kind
      t.string  :function
      t.string  :constants
      t.string  :aggregate_function
      t.string  :aggregate_constants      
    end

    create_table :reputation_intermediate_values do |t|
      t.references :user
      t.references :rule
      t.string     :name
      t.decimal    :value
    end
    add_index :reputation_intermediate_values, :user_id
    add_index :reputation_intermediate_values, :rule_id
    add_index :reputation_intermediate_values, :name

    create_table :reputation_behaviours do |t|
      t.references :user
      t.references :rule
      t.decimal    :metric
    end
    add_index :reputation_behaviours, :user_id
    add_index :reputation_behaviours, :rule_id
  end

  def self.down
    drop_table :reputation_rules
    drop_table :reputation_user_rule
    drop_table :reputation_behaviours
  end
end

Version data entries

8 entries across 4 versions & 1 rubygems

Version Path
reputation-0.0.5 generators/reputation/templates/reputation_create_tables.rb
reputation-0.0.5 spec/rails_root/db/migrate/20110824180048_reputation_create_tables.rb
reputation-0.0.4 generators/reputation/templates/reputation_create_tables.rb
reputation-0.0.4 spec/rails_root/db/migrate/20110824180048_reputation_create_tables.rb
reputation-0.0.3 generators/reputation/templates/reputation_create_tables.rb
reputation-0.0.3 spec/rails_root/db/migrate/20110824162330_reputation_create_tables.rb
reputation-0.0.2 generators/reputation/templates/reputation_create_tables.rb
reputation-0.0.2 spec/rails_root/db/migrate/20110812160932_reputation_create_tables.rb