Skip to content

Commit

Permalink
Change event_payload column size from TEXT to MEDIUMTEXT
Browse files Browse the repository at this point in the history
This change was missing when the payload colum size of table events was
changed.
  • Loading branch information
eduardoj committed Aug 26, 2024
1 parent 529e6e1 commit a0a624f
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 @@ -152,7 +152,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 ChangeColumnEventPayloadFromTextToMediumtext < ActiveRecord::Migration[7.0]
def up
safety_assured { change_column :notifications, :event_payload, :text, limit: 16.megabytes - 1 }
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_08_14_141544) do
ActiveRecord::Schema[7.0].define(version: 2024_08_26_083624) 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 @@ -775,7 +775,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 a0a624f

Please sign in to comment.