[day-04] add exercise schema

So a training is a collection of exercises that have a description and a
protocol to be followed.
This commit is contained in:
Joao P Dubas
2021-06-26 17:23:27 +00:00
parent ea5616addf
commit 58c4601203
3 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
defmodule Wabanex.Repo.Migrations.CreateExercisesTable do
use Ecto.Migration
def change do
create table(:exercises) do
add :name, :string, null: false
add :video_url, :string
add :protocol_description, :string, null: false
add :repetitions, :string, null: false
add :training_id, references(:trainings), null: false
timestamps()
end
end
end