question builder

This commit is contained in:
Stella 2014-02-09 18:05:57 +02:00
parent 4356616566
commit 3105c8da5d
28 changed files with 338 additions and 15 deletions

View file

@ -0,0 +1,12 @@
class CreateQuestions < ActiveRecord::Migration
def change
create_table :questions do |t|
t.string :title
t.references :question_type
t.integer :conference_id
t.boolean :global
t.timestamps
end
end
end

View file

@ -0,0 +1,9 @@
class CreateQuestionTypes < ActiveRecord::Migration
def change
create_table :question_types do |t|
t.string :title
t.timestamps
end
end
end

View file

@ -0,0 +1,9 @@
class CreateAnswers < ActiveRecord::Migration
def change
create_table :answers do |t|
t.string :title
t.timestamps
end
end
end

View file

@ -0,0 +1,8 @@
class CreateQanswers < ActiveRecord::Migration
def change
create_table :qanswers do |t|
t.references :question
t.references :answer
end
end
end

View file

@ -0,0 +1,8 @@
class CreateConferencesQuestions < ActiveRecord::Migration
def change
create_table :conferences_questions, :id => false do |t|
t.references :conference
t.references :question
end
end
end

View file

@ -0,0 +1,8 @@
class CreateQanswersRegistrations < ActiveRecord::Migration
def change
create_table :qanswers_registrations, :id => false do |t|
t.references :registration, :null => false
t.references :qanswer, :null => false
end
end
end