Merge branch 'master' into client-routesv2
This commit is contained in:
14
db/migrate/20170205163247_create_exercise_collections.rb
Normal file
14
db/migrate/20170205163247_create_exercise_collections.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateExerciseCollections < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :exercise_collections do |t|
|
||||
t.string :name
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :exercise_collections_exercises, id: false do |t|
|
||||
t.belongs_to :exercise_collection, index: true
|
||||
t.belongs_to :exercise, index: true
|
||||
end
|
||||
|
||||
end
|
||||
end
|
23
db/migrate/20170205165450_create_proxy_exercises.rb
Normal file
23
db/migrate/20170205165450_create_proxy_exercises.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class CreateProxyExercises < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :proxy_exercises do |t|
|
||||
t.string :title
|
||||
t.string :description
|
||||
t.string :token
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :exercises_proxy_exercises, id: false do |t|
|
||||
t.belongs_to :proxy_exercise, index: true
|
||||
t.belongs_to :exercise, index: true
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :user_proxy_exercise_exercises do |t|
|
||||
t.belongs_to :user, polymorphic: true, index: true
|
||||
t.belongs_to :proxy_exercise, index: true
|
||||
t.belongs_to :exercise, index: true
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
23
db/migrate/20170205210357_create_interventions.rb
Normal file
23
db/migrate/20170205210357_create_interventions.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
class CreateInterventions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :user_exercise_interventions do |t|
|
||||
t.belongs_to :user, polymorphic: true
|
||||
t.belongs_to :exercise
|
||||
t.belongs_to :intervention
|
||||
t.integer :accumulated_worktime_s
|
||||
t.text :reason
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :interventions do |t|
|
||||
t.string :name
|
||||
t.text :markup
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
Intervention.createDefaultInterventions
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
19
db/migrate/20170206141210_add_tags.rb
Normal file
19
db/migrate/20170206141210_add_tags.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class AddTags < ActiveRecord::Migration
|
||||
|
||||
def change
|
||||
add_column :exercises, :expected_worktime_seconds, :integer, default: 60
|
||||
add_column :exercises, :expected_difficulty, :integer, default: 1
|
||||
|
||||
create_table :tags do |t|
|
||||
t.string :name, null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :exercise_tags do |t|
|
||||
t.belongs_to :exercise
|
||||
t.belongs_to :tag
|
||||
t.integer :factor, default: 1
|
||||
end
|
||||
end
|
||||
|
||||
end
|
11
db/migrate/20170206152503_add_user_feedback.rb
Normal file
11
db/migrate/20170206152503_add_user_feedback.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddUserFeedback < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :user_exercise_feedbacks do |t|
|
||||
t.belongs_to :exercise, null: false
|
||||
t.belongs_to :user, polymorphic: true, null: false
|
||||
t.integer :difficulty
|
||||
t.integer :working_time_seconds
|
||||
t.string :feedback_text
|
||||
end
|
||||
end
|
||||
end
|
10
db/migrate/20170228165741_add_search.rb
Normal file
10
db/migrate/20170228165741_add_search.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class AddSearch < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :searches do |t|
|
||||
t.belongs_to :exercise, null: false
|
||||
t.belongs_to :user, polymorphic: true, null: false
|
||||
t.string :search
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@@ -0,0 +1,7 @@
|
||||
class AddReasonToUserProxyExerciseExercise < ActiveRecord::Migration
|
||||
def change
|
||||
change_table :user_proxy_exercise_exercises do |t|
|
||||
t.string :reason
|
||||
end
|
||||
end
|
||||
end
|
6
db/migrate/20170323130756_add_index_to_submissions.rb
Normal file
6
db/migrate/20170323130756_add_index_to_submissions.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class AddIndexToSubmissions < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :submissions, :exercise_id
|
||||
add_index :submissions, :user_id
|
||||
end
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
class SetDefaultForRequestForCommentSolved < ActiveRecord::Migration
|
||||
def change
|
||||
change_column_default :request_for_comments, :solved, false
|
||||
RequestForComment.where(solved: nil).update_all(solved: false)
|
||||
end
|
||||
end
|
5
db/migrate/20170411090543_improve_user_feedback.rb
Normal file
5
db/migrate/20170411090543_improve_user_feedback.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class ImproveUserFeedback < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :user_exercise_feedbacks, :user_estimated_worktime, :integer
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user