commit
3cbca56431
@ -0,0 +1,4 @@
|
||||
class CompetitionManager < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :competition
|
||||
end
|
@ -0,0 +1,10 @@
|
||||
class CreateCompetitionManagers < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :competition_managers do |t|
|
||||
t.references :user
|
||||
t.references :competition
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class AddStatisticsToCourseModule < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
Course.includes(:course_modules).all.each do |course|
|
||||
CourseModule.create!(course_id: course.id, module_type: "statistics", hidden:0, module_name: "统计", position: course.course_modules.pluck(:position).max + 1)
|
||||
end
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue