Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres error on long message #149

Open
SimonLab opened this issue Jul 24, 2023 · 0 comments
Open

Postgres error on long message #149

SimonLab opened this issue Jul 24, 2023 · 0 comments
Assignees
Labels
bug Suspected or confirmed bug (defect) in the code

Comments

@SimonLab
Copy link
Member

image

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://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

@SimonLab SimonLab added the bug Suspected or confirmed bug (defect) in the code label Jul 24, 2023
@SimonLab SimonLab self-assigned this Jul 24, 2023
SimonLab added a commit that referenced this issue Jul 26, 2023
Use :text instead of :string to allow long text as message
see: #149
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Suspected or confirmed bug (defect) in the code
Projects
None yet
Development

No branches or pull requests

1 participant