AfterParty: link dossier and groupe_instructeur
This commit is contained in:
parent
6a83adf336
commit
3ead6bde9d
2 changed files with 50 additions and 0 deletions
|
@ -0,0 +1,14 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: link_dossier_and_groupe_instructeur'
|
||||
task link_dossier_and_groupe_instructeur: :environment do
|
||||
sql = <<~SQL
|
||||
UPDATE dossiers SET groupe_instructeur_id = groupe_instructeurs.id
|
||||
FROM dossiers AS d1 INNER JOIN groupe_instructeurs ON groupe_instructeurs.procedure_id = d1.procedure_id
|
||||
WHERE dossiers.id = d1.id;
|
||||
SQL
|
||||
|
||||
ActiveRecord::Base.connection.execute(sql)
|
||||
|
||||
AfterParty::TaskRecord.create version: '20190826153115'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue