Skip to content

Commit

Permalink
Add uniqueness index on reminder notification
Browse files Browse the repository at this point in the history
A notification cannot be linked to more than one reminder, every reminder should generate it's own
unique notification.
  • Loading branch information
akabiru committed Nov 22, 2024
1 parent fdf09b9 commit d6cd810
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/migrate/20241121113638_create_reminder_notifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ def change

t.timestamps
end

add_index :reminder_notifications, :notification_id,
unique: true,
name: "index_reminder_notifications_unique"
end
end

0 comments on commit d6cd810

Please sign in to comment.