adds api calls for getting, setting, removing

- using Ecto queries, the api can now get newest
  message or get the last message
- delete all messages of a sender id
- add a message (auto adding a time stamp)
This commit is contained in:
2021-12-10 12:46:34 +01:00
parent de81aaaef7
commit 3b1657e18a
3 changed files with 29 additions and 5 deletions

View File

@ -5,8 +5,7 @@ defmodule Bump.Messages.Message do
schema "messages" do
field :sender, :string
field :data, :string, default: ""
field :timestamp, :utc_datetime, default: DateTime.utc_now |> DateTime.truncate(:second)
field :timestamp, :utc_datetime
timestamps()
end