chessh/priv/repo/migrations/20221219215005_add_keys.exs

17 lines
333 B
Elixir
Raw Normal View History

defmodule Chessh.Repo.Migrations.AddKeys do
use Ecto.Migration
def change do
create table(:keys) do
2022-12-20 03:06:18 -05:00
add(:key, :text, null: false)
add(:name, :string, null: false)
add(:player_id, references(:players), null: false)
timestamps()
end
2022-12-20 03:06:18 -05:00
create(unique_index(:keys, [:player_id, :key]))
end
end