forked from bofh/fetsite
AutoCommit Don Jul 30 00:03:02 CEST 2015
This commit is contained in:
12
db/migrate/20150729210826_create_survey_questions.rb
Normal file
12
db/migrate/20150729210826_create_survey_questions.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateSurveyQuestions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :survey_questions do |t|
|
||||
t.string :title
|
||||
t.text :text
|
||||
t.integer :typ
|
||||
t.string :parent_type
|
||||
t.integer :parent_id
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
13
db/migrate/20150729211328_create_survey_choices.rb
Normal file
13
db/migrate/20150729211328_create_survey_choices.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class CreateSurveyChoices < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :survey_choices do |t|
|
||||
t.string :text
|
||||
t.references :question
|
||||
t.integer :sort
|
||||
t.string :picture
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :survey_choices, :question_id
|
||||
end
|
||||
end
|
||||
12
db/migrate/20150729211914_create_survey_answers.rb
Normal file
12
db/migrate/20150729211914_create_survey_answers.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class CreateSurveyAnswers < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :survey_answers do |t|
|
||||
t.references :choice
|
||||
t.references :user
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :survey_answers, :choice_id
|
||||
add_index :survey_answers, :user_id
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user