From cb974928b4813ee54ac1a0668b084b1a406e2d14 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Thu, 5 Dec 2024 11:52:35 +0100 Subject: [PATCH] Change event_payload column size from TEXT to MEDIUMTEXT This change was missing when the payload colum size of table events was changed in 13aa8d7529456caac607dcab8f6bda67cfd6be8d --- src/api/app/models/notification.rb | 2 +- src/api/app/models/notification_bs_request.rb | 2 +- src/api/app/models/notification_comment.rb | 2 +- src/api/app/models/notification_group.rb | 2 +- src/api/app/models/notification_package.rb | 2 +- src/api/app/models/notification_project.rb | 2 +- src/api/app/models/notification_report.rb | 2 +- src/api/app/models/notification_workflow_run.rb | 2 +- ...19_change_notification_event_payload_to_mediumtext.rb | 9 +++++++++ src/api/db/schema.rb | 4 ++-- 10 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 src/api/db/migrate/20241205104819_change_notification_event_payload_to_mediumtext.rb diff --git a/src/api/app/models/notification.rb b/src/api/app/models/notification.rb index 8a718f8a80d..d394469a6d5 100644 --- a/src/api/app/models/notification.rb +++ b/src/api/app/models/notification.rb @@ -105,7 +105,7 @@ def track_notification_delivered # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/app/models/notification_bs_request.rb b/src/api/app/models/notification_bs_request.rb index f5f3859bb7d..6f420222f03 100644 --- a/src/api/app/models/notification_bs_request.rb +++ b/src/api/app/models/notification_bs_request.rb @@ -37,7 +37,7 @@ def bs_request # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/app/models/notification_comment.rb b/src/api/app/models/notification_comment.rb index 91e455f6f78..a93623ddf9c 100644 --- a/src/api/app/models/notification_comment.rb +++ b/src/api/app/models/notification_comment.rb @@ -75,7 +75,7 @@ def bs_request # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/app/models/notification_group.rb b/src/api/app/models/notification_group.rb index d34a5213455..1577a2bec51 100644 --- a/src/api/app/models/notification_group.rb +++ b/src/api/app/models/notification_group.rb @@ -35,7 +35,7 @@ def link_path # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/app/models/notification_package.rb b/src/api/app/models/notification_package.rb index 68e74fcff67..9509681ef76 100644 --- a/src/api/app/models/notification_package.rb +++ b/src/api/app/models/notification_package.rb @@ -54,7 +54,7 @@ def link_path # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/app/models/notification_project.rb b/src/api/app/models/notification_project.rb index 42d89b0fe45..78fc6ac64be 100644 --- a/src/api/app/models/notification_project.rb +++ b/src/api/app/models/notification_project.rb @@ -42,7 +42,7 @@ def link_path # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/app/models/notification_report.rb b/src/api/app/models/notification_report.rb index 453371b911f..29f1f3e860f 100644 --- a/src/api/app/models/notification_report.rb +++ b/src/api/app/models/notification_report.rb @@ -150,7 +150,7 @@ def path_to_commentables_on_reports(event_payload:, notification_id:) # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/app/models/notification_workflow_run.rb b/src/api/app/models/notification_workflow_run.rb index 3e4d1ca6145..2794abaf21d 100644 --- a/src/api/app/models/notification_workflow_run.rb +++ b/src/api/app/models/notification_workflow_run.rb @@ -30,7 +30,7 @@ def link_path # bs_request_oldstate :string(255) # bs_request_state :string(255) # delivered :boolean default(FALSE), indexed -# event_payload :text(65535) not null +# event_payload :text(16777215) not null # event_type :string(255) not null, indexed # last_seen_at :datetime # notifiable_type :string(255) indexed => [notifiable_id] diff --git a/src/api/db/migrate/20241205104819_change_notification_event_payload_to_mediumtext.rb b/src/api/db/migrate/20241205104819_change_notification_event_payload_to_mediumtext.rb new file mode 100644 index 00000000000..8c0762dbc2a --- /dev/null +++ b/src/api/db/migrate/20241205104819_change_notification_event_payload_to_mediumtext.rb @@ -0,0 +1,9 @@ +class ChangeNotificationEventPayloadToMediumtext < ActiveRecord::Migration[7.0] + def up + safety_assured { change_column :notifications, :event_payload, :mediumtext } + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/src/api/db/schema.rb b/src/api/db/schema.rb index a21fd8a1cf2..10543b43168 100644 --- a/src/api/db/schema.rb +++ b/src/api/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_10_22_134922) do +ActiveRecord::Schema[7.0].define(version: 2024_12_05_104819) do create_table "active_storage_attachments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false @@ -778,7 +778,7 @@ create_table "notifications", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", options: "ENGINE=InnoDB ROW_FORMAT=DYNAMIC", force: :cascade do |t| t.string "event_type", null: false - t.text "event_payload", null: false + t.text "event_payload", size: :medium, null: false t.string "subscription_receiver_role", null: false t.boolean "delivered", default: false t.datetime "created_at", precision: nil, null: false