mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Replace 'processed' column on notifications with new table (#11864)
This commit is contained in:
committed by
GitHub
parent
60f10e9067
commit
809274fe0d
@@ -1,14 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddProcessedToNotifications < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
add_column :notifications, :processed, :boolean, default: false
|
||||
execute "UPDATE notifications SET processed = true"
|
||||
change_column_null(:notifications, :processed, false)
|
||||
add_index :notifications, [:processed], unique: false
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :notifications, :processed
|
||||
def change
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
class CreateShelvedNotifications < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
create_table :shelved_notifications do |t|
|
||||
t.integer :notification_id, null: false
|
||||
end
|
||||
add_index :shelved_notifications, [:notification_id]
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
class UndoAddProcessedToNotifications < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
execute "ALTER TABLE notifications DROP COLUMN IF EXISTS processed"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user