From 6e971e3f07c4661edea5ddfd32ff20dafde7c7d1 Mon Sep 17 00:00:00 2001 From: Thomas Leese Date: Sun, 24 Sep 2023 16:13:29 +0100 Subject: [PATCH] Add Rake task to migrate timeline events We're going to rename the `state_changed` event type to `status_changed`. --- lib/tasks/timeline_events.rake | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/tasks/timeline_events.rake diff --git a/lib/tasks/timeline_events.rake b/lib/tasks/timeline_events.rake new file mode 100644 index 0000000000..13bceac257 --- /dev/null +++ b/lib/tasks/timeline_events.rake @@ -0,0 +1,8 @@ +namespace :timeline_events do + desc "Migrate state_changed events" + task migrate_state_changed: :environment do + TimelineEvent.where(event_type: "state_changed").update_all( + event_type: "status_changed", + ) + end +end