Compare commits

...
This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.

1 Commits

Author SHA1 Message Date
Sam Saffron
e3a6be3db7
PREF: allow notification ids a larger range
Out of the box we allow 2.2 billion notification, certain exceptionally
bit forums may overflow. This premtively raises the bar to big int.

The trade off is that all forums in the wild store an extra 4 byte in a bunch
of tables.
2023-03-02 15:57:28 +11:00
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
class ChangeNotificationsToBigInt < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def up
change_column :notifications, :id, :bigint
change_column :users, :seen_notification_id, :bigint
change_column :user_badges, :notification_id, :bigint
change_column :shelved_notifications, :notification_id, :bigint
end
def down
raise ActiveRecord::IrreversibleMigration
end
end

View File

@ -0,0 +1,13 @@
# frozen_string_literal: true
class ChangeNotificationsToBigIntChat < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def up
change_column :chat_mentions, :notification_id, :bigint
end
def down
raise ActiveRecord::IrreversibleMigration
end
end