mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 03:35:25 +08:00
12 lines
467 B
Ruby
12 lines
467 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AddUniqueIndexToSystemNotifications < ActiveRecord::Migration[5.1]
|
|
def change
|
|
# remove not unique index and add new with uniq
|
|
remove_index :system_notifications, :source_id
|
|
add_index :system_notifications, :source_id, unique: true
|
|
|
|
add_index :user_system_notifications, %i(user_id system_notification_id), unique: true,
|
|
name: 'index_user_system_notifications_on_user_and_notification_id'
|
|
end
|
|
end
|