Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Backfill presenter from author

Oliver Günther61fe67a8fdf1
diff --git a/modules/meeting/db/migrate/20240313102951_add_responsible_to_meeting.rb b/modules/meeting/db/migrate/20240313102951_add_presenter_to_meeting.rb
similarity index 81%
rename from modules/meeting/db/migrate/20240313102951_add_responsible_to_meeting.rb
rename to modules/meeting/db/migrate/20240313102951_add_presenter_to_meeting.rb
index ce9e93e3550..1af9e328a7e 100644
--- a/modules/meeting/db/migrate/20240313102951_add_responsible_to_meeting.rb
+++ b/modules/meeting/db/migrate/20240313102951_add_presenter_to_meeting.rb
@@ -1,4 +1,4 @@
-class AddResponsibleToMeeting < ActiveRecord::Migration[7.1]
+class AddPresenterToMeeting < ActiveRecord::Migration[7.1]
def change
add_reference :meeting_agenda_items, :presenter, type: :bigint, foreign_key: { to_table: :users }, index: true
add_reference :meeting_agenda_item_journals, :presenter, type: :bigint, foreign_key: { to_table: :users }, index: true
diff --git a/modules/meeting/db/migrate/20240418110249_set_author_as_presenter.rb b/modules/meeting/db/migrate/20240418110249_set_author_as_presenter.rb
new file mode 100644
index 00000000000..9b437563bad
--- /dev/null
+++ b/modules/meeting/db/migrate/20240418110249_set_author_as_presenter.rb
@@ -0,0 +1,9 @@
+class SetAuthorAsPresenter < ActiveRecord::Migration[7.1]
+ def up
+ execute "UPDATE meeting_agenda_items SET presenter_id = author_id WHERE presenter_id IS NULL"
+ end
+
+ def down
+ # Nothing to do
+ end
+end