You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/db/migrate/20200320152708_uniq_index_o...

8 lines
293 B

class UniqIndexOnCollections < ActiveRecord::Migration[5.2]
def change
remove_index :collections, [:container_type, :container_id]
add_index :collections, [:container_type, :container_id]
add_index :collections, [:user_id, :container_type, :container_id], unique: true
end
end