Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrige l'initialisation des données des reviewapps #1629

Merged
merged 4 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ajoute les classes locales dans les migrations pour éviter les effets…
… d'évolution de modèles dans d'autres migrations quand on les enchaine
  • Loading branch information
etienneCharignon committed Sep 2, 2024
commit 353ed526ae7f4150b2ac0a21b41bed4918b1d463
3 changes: 3 additions & 0 deletions db/migrate/20240807151045_migre_intitule_question.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class MigreIntituleQuestion < ActiveRecord::Migration[7.0]
class ::Question < ApplicationRecord; end
class ::Transcription < ApplicationRecord; end

def change
Question.where.not(intitule: nil).find_each do |question|
Transcription.find_or_create_by(ecrit: question.intitule, question_id: question.id)
Expand Down
2 changes: 2 additions & 0 deletions db/migrate/20240808043847_supprime_intitule_de_question.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class SupprimeIntituleDeQuestion < ActiveRecord::Migration[7.0]
class ::Question < ApplicationRecord; end

def up
remove_column :questions, :intitule, :string
end
Expand Down
3 changes: 3 additions & 0 deletions db/migrate/20240809100708_migre_modalite_reponse.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class MigreModaliteReponse < ActiveRecord::Migration[7.0]
class ::Question < ApplicationRecord; end
class ::Transcription < ApplicationRecord; end

def change
Question.where.not(modalite_reponse: nil).find_each do |question|
Transcription.find_or_create_by(ecrit: question.modalite_reponse, question_id: question.id, categorie: :modalite_reponse)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class SupprimeModaliteReponseDeQuestion < ActiveRecord::Migration[7.0]
class ::Question < ApplicationRecord; end

def up
remove_column :questions, :modalite_reponse, :string
end
Expand Down