rename ref_demarche into demarche_id
fix association between formulaire and type_piece_jointe fix association between formulaire and evenement_vie
This commit is contained in:
parent
c78a4f655b
commit
107b11d510
12 changed files with 85 additions and 40 deletions
|
@ -0,0 +1,5 @@
|
|||
class AddFormulaireIdToTypePieceJointe < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :types_piece_jointe, :formulaire_id, :integer
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class RenameRefDemarcheIntoDemarcheId < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :formulaires, :ref_demarche, :demarche_id
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class LinkTypePieceJointeToFormulaire < ActiveRecord::Migration
|
||||
def up
|
||||
TypePieceJointe.find_each do |type_piece_jointe|
|
||||
forms = Formulaire.find_by_demarche_id(type_piece_jointe.CERFA)
|
||||
type_piece_jointe.update_attributes(formulaire_id: forms.id) unless forms.nil?
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class RenameEvenementVieFromDemarcheIntoEvenementVieId < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :formulaires, :evenement_vie, :evenement_vie_id
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue