17 lines
333 B
Elixir
17 lines
333 B
Elixir
defmodule Chessh.Repo.Migrations.AddKeys do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:keys) do
|
|
add(:key, :text, null: false)
|
|
add(:name, :string, null: false)
|
|
|
|
add(:player_id, references(:players), null: false)
|
|
|
|
timestamps()
|
|
end
|
|
|
|
create(unique_index(:keys, [:player_id, :key]))
|
|
end
|
|
end
|