Cleanup: remove champ_pj feature flag
This commit is contained in:
parent
57a136c861
commit
97eb72a047
1 changed files with 20 additions and 0 deletions
|
@ -0,0 +1,20 @@
|
||||||
|
namespace :after_party do
|
||||||
|
desc 'Deployment task: remove_champ_pj_feature'
|
||||||
|
task remove_champ_pj_feature: :environment do
|
||||||
|
rake_puts "Running deploy task 'remove_champ_pj_feature'"
|
||||||
|
|
||||||
|
Administrateur.find_by_sql(
|
||||||
|
<<~SQL
|
||||||
|
SELECT administrateurs.*
|
||||||
|
FROM administrateurs, lateral jsonb_each(features)
|
||||||
|
WHERE key = 'champ_pj'
|
||||||
|
GROUP BY id
|
||||||
|
SQL
|
||||||
|
).each do |admin|
|
||||||
|
admin.features.delete('champ_pj')
|
||||||
|
admin.save
|
||||||
|
end
|
||||||
|
|
||||||
|
AfterParty::TaskRecord.create version: '20181210185634'
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue