Class: QuestionableMigration

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/templates/questionable_migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/templates/questionable_migration.rb', line 2

def change
  create_table :questions do |t|
    t.integer :questionable_id
    t.string :questionable_type
    t.string :subject

    t.timestamps
  end

  create_table :answers do |t|
    t.integer :question_id
    t.string :text

    t.timestamps
  end
end