Prepare to remove dossier procedure_id
This commit is contained in:
parent
4af64d2bc1
commit
c4896b45ad
6 changed files with 4 additions and 55 deletions
|
@ -1,15 +0,0 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: link_dossier_and_groupe_instructeur'
|
||||
task link_dossier_and_groupe_instructeur: :environment do
|
||||
sql = <<~SQL
|
||||
UPDATE dossiers AS d1 SET groupe_instructeur_id = g.id
|
||||
FROM groupe_instructeurs AS g
|
||||
WHERE g.procedure_id = d1.procedure_id
|
||||
and d1.groupe_instructeur_id is null;
|
||||
SQL
|
||||
|
||||
ActiveRecord::Base.connection.execute(sql)
|
||||
|
||||
AfterParty::TaskRecord.create version: '20190826153115'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue