15 lines
296 B
Elixir
15 lines
296 B
Elixir
defmodule Events.Events do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "events" do
|
|
field :title, :string
|
|
field :payload, :string
|
|
end
|
|
|
|
def changeset(user, params \\ %{}) do
|
|
user
|
|
|> cast(params, [:title, :payload])
|
|
|> validate_required([:title, :payload])
|
|
end
|
|
end
|