Files
nairobi/db/migrate/20161028104156_create_poll_questions.rb
Julian Herrero 65c30c8d2d Remove migrations warning
DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration
is deprecated. Please specify the Rails release the migration was
written for:

class MigrationClass < ActiveRecord::Migration[4.2]

(called from require at bin/rails:4)
2019-04-17 17:40:56 +02:00

22 lines
635 B
Ruby

class CreatePollQuestions < ActiveRecord::Migration[4.2]
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