Files
fizzy/db/migrate/20250116163344_change_notification_read_to_read_at.rb
T
2025-01-16 17:48:38 +00:00

13 lines
387 B
Ruby

class ChangeNotificationReadToReadAt < ActiveRecord::Migration[8.1]
def change
remove_index :notifications, %i[ user_id read created_at ], order: { read: :desc, created_at: :desc }
change_table :notifications do |t|
t.remove :read
t.datetime :read_at
t.index %i[ user_id read_at created_at ], order: { read_at: :desc, created_at: :desc }
end
end
end