Sha256: 28abc4a412a0f99e606d769e64b610ed9513c13f3c61ce08090179f683b03af9

Contents?: true

Size: 385 Bytes

Versions: 13

Compression:

Stored size: 385 Bytes

Contents

class CreateAnswers < ActiveRecord::Migration
  def change
    create_table :answers do |t|
      t.belongs_to :answerer, :polymorphic => true
      t.belongs_to :question
      t.belongs_to :choice
      t.text :answer

      t.timestamps
    end
    add_index :answers, [:answerer_id, :answerer_type]
    add_index :answers, :question_id
    add_index :answers, :choice_id
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ask-0.5.4 db/migrate/20110913214050_create_answers.rb
ask-0.5.3 db/migrate/20110913214050_create_answers.rb
ask-0.5.2 db/migrate/20110913214050_create_answers.rb
ask-0.5.1 db/migrate/20110913214050_create_answers.rb
ask-0.5.0 db/migrate/20110913214050_create_answers.rb
ask-0.4.1 db/migrate/20110913214050_create_answers.rb
ask-0.4.0 db/migrate/20110913214050_create_answers.rb
ask-0.3.1 db/migrate/20110913214050_create_answers.rb
ask-0.3.0 db/migrate/20110913214050_create_answers.rb
ask-0.2.0 db/migrate/20110913214050_create_answers.rb
ask-0.1.2 db/migrate/20110913214050_create_answers.rb
ask-0.1.1 db/migrate/20110913214050_create_answers.rb
ask-0.1.0 db/migrate/20110913214050_create_answers.rb