Initial commit
This commit is contained in:
18
lib/something_erlang/forums/thread.ex
Normal file
18
lib/something_erlang/forums/thread.ex
Normal file
@ -0,0 +1,18 @@
|
||||
defmodule SomethingErlang.Forums.Thread do
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
schema "threads" do
|
||||
field :thread_id, :integer
|
||||
field :title, :string
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
@doc false
|
||||
def changeset(thread, attrs) do
|
||||
thread
|
||||
|> cast(attrs, [:title, :thread_id])
|
||||
|> validate_required([:title, :thread_id])
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user