* 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
13 lines
401 B
Ruby
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
|