Skip to content

Commit 45ef867

Browse files
committed
add database constraint to ensure tenant has a value to be used
1 parent 7530f32 commit 45ef867

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

priv/repo/migrations/20251204170944_nullable_jwt_secrets.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ defmodule Realtime.Repo.Migrations.NullableJwtSecrets do
55
alter table(:tenants) do
66
modify :jwt_secret, :string, null: true
77
end
8+
9+
create constraint(:tenants, :jwt_secret_or_jwt_jwks_required,
10+
check: "jwt_secret IS NOT NULL OR jwt_jwks IS NOT NULL"
11+
)
812
end
913
end

0 commit comments

Comments
 (0)