diff --git a/db/migrate/20151113025341_exercise.rb b/db/migrate/20151113025341_exercise.rb new file mode 100644 index 000000000..8fdcf0a9e --- /dev/null +++ b/db/migrate/20151113025341_exercise.rb @@ -0,0 +1,18 @@ +class Exercise < ActiveRecord::Migration + def up + create_table :exercise do |t| + t.string :exercise_name + t.text :exercise_description + t.integer :course_id + t.integer :exercise_status + t.integer :user_id + t.datetime :start_at + t.datetime :end_at + t.timestamps + end + end + + def down + drop_table :exercise + end +end diff --git a/db/migrate/20151113025459_exercise_question.rb b/db/migrate/20151113025459_exercise_question.rb new file mode 100644 index 000000000..3ab084f13 --- /dev/null +++ b/db/migrate/20151113025459_exercise_question.rb @@ -0,0 +1,14 @@ +class ExerciseQuestion < ActiveRecord::Migration + def up + create_table :exercise_question do |t| + t.string :question_title + t.integer :question_type + t.integer :exercise_id + t.timestamps + end + end + + def down + drop_table :exercise_question + end +end diff --git a/db/migrate/20151113025524_exercise_choices.rb b/db/migrate/20151113025524_exercise_choices.rb new file mode 100644 index 000000000..782cb5f7d --- /dev/null +++ b/db/migrate/20151113025524_exercise_choices.rb @@ -0,0 +1,14 @@ +class ExerciseChoices < ActiveRecord::Migration + def up + create_table :exercise_choices do |t| + t.integer :exercise_question_id + t.text :choice_text + t.integer :choice_position + t.timestamps + end + end + + def down + drop_table :exercise_choices + end +end diff --git a/db/migrate/20151113025549_exercise_standard_answer.rb b/db/migrate/20151113025549_exercise_standard_answer.rb new file mode 100644 index 000000000..17e59eaf8 --- /dev/null +++ b/db/migrate/20151113025549_exercise_standard_answer.rb @@ -0,0 +1,14 @@ +class ExerciseStandardAnswer < ActiveRecord::Migration + def up + create_table :exercise_standard_answer do |t| + t.integer :exercise_question_id + t.integer :exercise_choices_id + t.text :answer_text + t.timestamps + end + end + + def down + drop_table :exercise_standard_answer + end +end diff --git a/db/migrate/20151113025721_exercise_answer.rb b/db/migrate/20151113025721_exercise_answer.rb new file mode 100644 index 000000000..0a34c15ea --- /dev/null +++ b/db/migrate/20151113025721_exercise_answer.rb @@ -0,0 +1,15 @@ +class ExerciseAnswer < ActiveRecord::Migration + def up + create_table :exercise_answer do |t| + t.integer :user_id + t.integer :exercise_question_id + t.integer :exercise_choices_id + t.text :answer_text + t.timestamps + end + end + + def down + drop_table :exercise_answer + end +end diff --git a/db/migrate/20151113025751_user_exercise.rb b/db/migrate/20151113025751_user_exercise.rb new file mode 100644 index 000000000..b0a003d1d --- /dev/null +++ b/db/migrate/20151113025751_user_exercise.rb @@ -0,0 +1,14 @@ +class UserExercise < ActiveRecord::Migration + def up + create_table :user_exercise do |t| + t.integer :user_id + t.integer :exercise_id + t.integer :score + t.timestamps + end + end + + def down + drop_table :user_exercise + end +end