Hotfix: ensure gateway name fits varchar(255)

This commit is contained in:
Andrew Dryga
2023-12-19 11:33:25 -06:00
parent fa35658db6
commit 0133b507d2
2 changed files with 2 additions and 2 deletions

View File

@@ -76,7 +76,7 @@ defmodule Domain.Gateways.Gateway.Changeset do
defp changeset(changeset) do
changeset
|> trim_change(:name)
|> validate_length(:name, min: 1, max: 256)
|> validate_length(:name, min: 1, max: 255)
|> unique_constraint(:name, name: :gateways_group_id_name_index)
|> unique_constraint([:public_key])
|> unique_constraint(:external_id)

View File

@@ -786,7 +786,7 @@ defmodule Domain.GatewaysTest do
assert {:error, changeset} = update_gateway(gateway, attrs, subject)
assert errors_on(changeset) == %{
name: ["should be at most 256 character(s)"]
name: ["should be at most 255 character(s)"]
}
end