mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Update moves migration
This commit is contained in:
parent
caa68d41f8
commit
fc5b500d27
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user