Commit b4cf287ada2fd7a7158d9c42ce9513d39b77bcca

Thomas de Grivel 2022-02-05T11:44:56

unique users_organisations

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/priv/repo/migrations/20220205091136_add_unique_index_to_users_organisations.exs b/priv/repo/migrations/20220205091136_add_unique_index_to_users_organisations.exs
new file mode 100644
index 0000000..5528c98
--- /dev/null
+++ b/priv/repo/migrations/20220205091136_add_unique_index_to_users_organisations.exs
@@ -0,0 +1,7 @@
+defmodule Kmxgit.Repo.Migrations.AddUniqueIndexToUsersOrganisations do
+  use Ecto.Migration
+
+  def change do
+    create index(:users_organisations, [:user_id, :organisation_id], unique: true)
+  end
+end