后台管理页面的数据问题及500修改
This commit is contained in:
parent
7ca8dcbebd
commit
6646ee02fc
|
@ -0,0 +1,18 @@
|
|||
class AddIndexForProjectLanguageAndCategory < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_index :project_categories, :id unless index_exists?(:project_categories, :id)
|
||||
add_index :project_laguages, :id unless index_exists?(:project_laguages, :id)
|
||||
|
||||
project_categories = ProejctCategory.includes(:projects)
|
||||
project_categories.each do |i|
|
||||
puts "#######____update_project_category_id____##############{i.id}"
|
||||
ProejctCategory.reset_counters(i, :projects)
|
||||
end
|
||||
|
||||
project_languages = ProjectLanguage.includes(:projects)
|
||||
project_languages.each do |i|
|
||||
puts "#######____update_project_language_id____##############{i.id}"
|
||||
ProjectLanguage.reset_counters(i, :projects)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue