1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00
chess/priv/repo/migrations/20180504172433_create_moves.exs

18 lines
388 B
Elixir

defmodule Chess.Repo.Migrations.CreateMoves do
use Ecto.Migration
def change do
create table(:moves) do
add :game_id, references(:games, on_delete: :delete_all)
add :from, :map, null: false
add :to, :map, null: false
add :piece, :map, null: false
add :piece_captured, :map
timestamps()
end
create index(:moves, [:game_id])
end
end