Skip to content

Commit

Permalink
Merge pull request #16751 from eduardoj/fix/event_payload_text_to_med…
Browse files Browse the repository at this point in the history
…iumtext

Change event_payload column size from TEXT to MEDIUMTEXT
  • Loading branch information
hennevogel authored Dec 11, 2024
2 parents 1d34bab + cb97492 commit 615a70a
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/api/app/models/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/notification_bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/notification_comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/notification_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/notification_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/notification_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/notification_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/notification_workflow_run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/api/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 615a70a

Please sign in to comment.