[day-04] add training schema

With this we can represent a traning program for a user.
This commit is contained in:
Joao P Dubas
2021-06-26 17:21:29 +00:00
parent 96a3e2e9f0
commit ea5616addf
4 changed files with 54 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ defmodule Wabanex.User do
import Ecto.Changeset
alias Wabanex.Training
@primary_key {:id, :binary_id, autogenerate: true}
@fields ~w(name email password)a
@@ -12,6 +14,8 @@ defmodule Wabanex.User do
field :email, :string
field :password, :string
has_many :trainings, Training
timestamps()
end