[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:
@@ -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
|
Reference in New Issue
Block a user