Skip to content

Commit

Permalink
Fix error when attempting to delete posts that triggered a notificati…
Browse files Browse the repository at this point in the history
…on request (mastodon#29666)
  • Loading branch information
ClearlyClaire committed Mar 20, 2024
1 parent 58a606e commit 821fc53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/notification_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# id :bigint(8) not null, primary key
# account_id :bigint(8) not null
# from_account_id :bigint(8) not null
# last_status_id :bigint(8) not null
# last_status_id :bigint(8)
# notifications_count :bigint(8) default(0), not null
# dismissed :boolean default(FALSE), not null
# created_at :datetime not null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class ChangeNotificationRequestLastStatusIdNullable < ActiveRecord::Migration[7.1]
def change
change_column_null :notification_requests, :last_status_id, true
end
end
4 changes: 2 additions & 2 deletions 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.1].define(version: 2024_03_10_123453) do
ActiveRecord::Schema[7.1].define(version: 2024_03_20_163441) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -689,7 +689,7 @@
create_table "notification_requests", id: :bigint, default: -> { "timestamp_id('notification_requests'::text)" }, force: :cascade do |t|
t.bigint "account_id", null: false
t.bigint "from_account_id", null: false
t.bigint "last_status_id", null: false
t.bigint "last_status_id"
t.bigint "notifications_count", default: 0, null: false
t.boolean "dismissed", default: false, null: false
t.datetime "created_at", null: false
Expand Down

0 comments on commit 821fc53

Please sign in to comment.