From 5a153637b7629e37f89b407279d92d1b09671b17 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 13 Nov 2015 11:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9C=A8=E7=BA=BF=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E8=BF=81=E7=A7=BB=E9=97=AE=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20151113025341_exercise.rb | 18 ++++++++++++++++++ db/migrate/20151113025459_exercise_question.rb | 14 ++++++++++++++ db/migrate/20151113025524_exercise_choices.rb | 14 ++++++++++++++ .../20151113025549_exercise_standard_answer.rb | 14 ++++++++++++++ db/migrate/20151113025721_exercise_answer.rb | 15 +++++++++++++++ db/migrate/20151113025751_user_exercise.rb | 14 ++++++++++++++ 6 files changed, 89 insertions(+) create mode 100644 db/migrate/20151113025341_exercise.rb create mode 100644 db/migrate/20151113025459_exercise_question.rb create mode 100644 db/migrate/20151113025524_exercise_choices.rb create mode 100644 db/migrate/20151113025549_exercise_standard_answer.rb create mode 100644 db/migrate/20151113025721_exercise_answer.rb create mode 100644 db/migrate/20151113025751_user_exercise.rb 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