raphael
d2fe15d3ae
- message now contains a second string which is meant for unencrypted title information, which can be displayed without e2e encryption. - senders can now be deleted - the same sender / token connection is no longer added to the database
21 lines
376 B
Elixir
21 lines
376 B
Elixir
defmodule Bump.Messages.Message do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "messages" do
|
|
field :sender, :string
|
|
field :title, :string, default: ""
|
|
field :data, :string, default: ""
|
|
field :timestamp, :utc_datetime
|
|
timestamps()
|
|
end
|
|
|
|
def changeset(message, params) do
|
|
message
|
|
|> cast(params, [:sender, :data, :timestamp])
|
|
end
|
|
end
|
|
|
|
|
|
|