1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Update moves migration

This commit is contained in:
Daniel Barber 2018-05-08 10:56:24 +02:00
parent caa68d41f8
commit fc5b500d27
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -3,7 +3,7 @@ defmodule Chess.Repo.Migrations.CreateMoves do
def change do
create table(:moves) do
add :game_id, references(:games)
add :game_id, references(:games, on_delete: :delete_all)
add :from, :map
add :to, :map
add :piece, :map
@ -11,5 +11,7 @@ defmodule Chess.Repo.Migrations.CreateMoves do
timestamps()
end
create index(:moves, [:game_id])
end
end