Skip to content

Commit

Permalink
Set unique_index on resource_id instead of dataset_id
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineAugusti committed Feb 5, 2025
1 parent e696f16 commit 3d5ea7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/transport/lib/db/reuser_improved_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ defmodule DB.ReuserImprovedData do
|> assoc_constraint(:resource)
|> assoc_constraint(:contact)
|> assoc_constraint(:organization)
|> unique_constraint([:dataset_id, :organization_id])
|> unique_constraint([:resource_id, :organization_id])
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ defmodule DB.Repo.Migrations.ReuserImprovedData do

create(index(:reuser_improved_data, [:dataset_id]))
create(index(:reuser_improved_data, [:organization_id]))
create(unique_index(:reuser_improved_data, [:dataset_id, :organization_id]))
create(unique_index(:reuser_improved_data, [:resource_id, :organization_id]))
end
end

0 comments on commit 3d5ea7c

Please sign in to comment.