Closed SimonLab closed 1 year ago
The application can fail to create a new item when the text content is too long:
(Postgrex.Error) ERROR 22001 (string_data_right_truncation) value too long for type character varying(255)
This is due to the migration defining the text value as :string: https://github.com/dwyl/mvp/blob/f5bd6f1880378260091de62fa7528f8753649cb9/priv/repo/migrations/20220627162154_create_items.exs#L6
:string
items
:text
alter table(:items) do modify :text, :text end
Also: https://github.com/dwyl/mvp/blob/f5bd6f1880378260091de62fa7528f8753649cb9/lib/app/item.ex#L10
Ecto is using the type :sring in the schema, see: https://github.com/dwyl/mvp/pull/205#issuecomment-1314039013
:sring
Fixed with #205
Thanks @SimonLab 👌
The application can fail to create a new item when the text content is too long:
This is due to the migration defining the text value as
:string
: https://github.com/dwyl/mvp/blob/f5bd6f1880378260091de62fa7528f8753649cb9/priv/repo/migrations/20220627162154_create_items.exs#L6items
table to define the field with the:text
type instead of:string