charbase/lib/charbase/changelog.ex

20 lines
353 B
Elixir
Raw Normal View History

2019-08-06 19:33:53 -04:00
defmodule Charbase.Changelog do
use Ecto.Schema
import Ecto.Changeset
schema "changelog" do
field :text, :string
field :type, :string
field :character_id, :id
timestamps()
end
@doc false
def changeset(changelog, attrs) do
changelog
|> cast(attrs, [:type, :text])
|> validate_required([:type, :text])
end
end