Skip to content

Commit

Permalink
Mark data migration as executed after replacing rake task is performed
Browse files Browse the repository at this point in the history
The rake task is a replacement for a data migration. After running
it, there is no requirement to perform the data migration. For this
reason, we have to mark the data migration as performed after
the task has been performed.
  • Loading branch information
krauselukas committed Feb 11, 2025
1 parent 2cbb21a commit ee3338a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/lib/tasks/data_backfill.rake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ namespace :data do
end
end
# rubocop:enable Rails/SkipsModelValidations

# this rake task replaces the 20250131143734_backfill_sources_on_bs_request_actions.rb data migration
# after this task has been performed, we need to mark the data migration as executed
if DataMigrate::DatabaseTasks.pending_data_migrations.find { |data_migration| data_migration[:version] == 20250131143734 }.present?
DataMigrate::DataSchemaMigration.create_version('20250131143734')
end
end
end
end

0 comments on commit ee3338a

Please sign in to comment.