mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
adds a migrations to fix all statistic_sub_types of plans having label = nil
This commit is contained in:
parent
519dbefd2f
commit
7d1fae84fe
@ -2,7 +2,8 @@
|
||||
|
||||
## next deploy
|
||||
|
||||
- Fix a bug: statistic_subtype.label of plan was nil
|
||||
- Fix a bug: statistic_sub_type.label of plan was nil
|
||||
- adds a migrations to fix all statistic_sub_types of plans having label = nil
|
||||
|
||||
## v6.3.0 2023 November 3
|
||||
|
||||
|
13
db/migrate/20231108094433_fix_plan_statistic_sub_types.rb
Normal file
13
db/migrate/20231108094433_fix_plan_statistic_sub_types.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class FixPlanStatisticSubTypes < ActiveRecord::Migration[7.0]
|
||||
def up
|
||||
StatisticSubType.joins(statistic_types: :statistic_index).where(statistic_indices: { es_type_key: "subscription" }, label: nil).each do |statistic_sub_type|
|
||||
plan = Plan.find_by(slug: statistic_sub_type.key)
|
||||
if plan
|
||||
statistic_sub_type.update_column(:label, plan.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user