Files
nairobi/db/migrate/20161028104156_create_poll_questions.rb
2016-10-28 18:02:28 +02:00

22 lines
630 B
Ruby

class CreatePollQuestions < ActiveRecord::Migration
def change
create_table :poll_questions do |t|
t.references :proposal, index: true, foreign_key: true
t.references :poll, index: true, foreign_key: true
t.references :author, index: true # foreign key added later due to rails 4
t.string :author_visible_name
t.string :title
t.string :question
t.string :summary
t.string :valid_answers
t.text :description
t.integer :comments_count
t.datetime :hidden_at
t.timestamps
end
add_foreign_key :poll_questions, :users, column: :author_id
end
end