forked from potsda.mn/mobilizon
fix(backend): validate length of instance actor details and set description column to text
Closes #1393 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
eb43b7c79c
commit
f7585cfc75
|
@ -34,6 +34,10 @@ defmodule Mobilizon.Instances.InstanceActor do
|
||||||
instance_actor
|
instance_actor
|
||||||
|> cast(attrs, @attrs)
|
|> cast(attrs, @attrs)
|
||||||
|> validate_required(@required_attrs)
|
|> validate_required(@required_attrs)
|
||||||
|
|> validate_length(:domain, max: 254)
|
||||||
|
|> validate_length(:instance_name, max: 254)
|
||||||
|
|> validate_length(:software, max: 254)
|
||||||
|
|> validate_length(:software_version, max: 254)
|
||||||
|> unique_constraint(:domain)
|
|> unique_constraint(:domain)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
defmodule Mobilizon.Storage.Repo.Migrations.ChangeActorInstanceDescriptionTypeToText do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def up do
|
||||||
|
alter table(:instance_actors) do
|
||||||
|
modify(:instance_description, :text)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down do
|
||||||
|
alter table(:instance_actors) do
|
||||||
|
modify(:instance_description, :string)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue