dwyl / dwyl/phoenix-liveview-chat-example

Postgres error on long message

Open
#149 0 comments 2 reactions 1 assignee Claimed by @SimonLab View on GitHub
bug
Dominant language
Elixir
Stars
162
Forks
12
Avg merge
1d 9h
Merged PRs (30d)
3

Description

![image](https://github.com/dwyl/phoenix-liveview-chat-example/assets/6057298/97095865-a045-4952-94ef-6ecf562835be)

The schema is using the `string` type value for the `message` which means for long message the value can't be saved and postgres returns an error:
https://github.com/dwyl/phoenix-liveview-chat-example/blob/f4812190ac7f9620a6244f91c00e1d2425170dae/priv/repo/migrations/20211122121548_create_messages.exs

We can either use a differnt type for the field:
![image](https://github.com/dwyl/phoenix-liveview-chat-example/assets/6057298/23dded42-448b-4625-8349-3f23223bf390)
https://hexdocs.pm/ecto_sql/Ecto.Migration.html#module-field-types

Or display an error on the client. It is easy to add a new migration to update the field type and I'm tempted to go in that direction

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.