Add unique indexes for Collection(Item) URIs (#38409)

This commit is contained in:
David Roetzel authored and GitHub committed 2026-03-26 10:17:08 +00:00
1 parent df479d598f
commit 1fb5cb1e67
2 files changed
+13 -1

No files matched your search

@@ -0,0 +1,10 @@
# frozen_string_literal: true
class AddUniqueIndexesToCollectionsAndItems < ActiveRecord::Migration[8.1]
disable_ddl_transaction!
def change
add_index :collections, :uri, unique: true, where: 'uri IS NOT NULL', algorithm: :concurrently
add_index :collection_items, :uri, unique: true, where: 'uri IS NOT NULL', algorithm: :concurrently
end
end