docbrown/db/migrate/20220401071321_create_context_notifications.rb
Anna Buianova 05d0464a78
Context Notifications (#17243)
* ContextNotification model

* Create and destroy context notifications when notifications are sent/unsent

* Added a transaction when creating notifications and context notifications

* Documentation for context notifications
2022-04-18 10:30:30 +03:00

13 lines
401 B
Ruby

class CreateContextNotifications < ActiveRecord::Migration[7.0]
def change
create_table :context_notifications do |t|
t.string :action
t.integer :context_id
t.string :context_type
t.timestamps
end
add_index :context_notifications, %i[context_id context_type action],
unique: true, name: "index_context_notification_on_context_and_action"
end
end