pokemon-couture/priv/repo/migrations/20210628141736_create_cloth...

23 lines
502 B
Elixir
Raw Normal View History

defmodule PokemonCouture.Repo.Migrations.CreateClothes do
use Ecto.Migration
def change do
create table(:clothes) do
add :name, :string
2021-06-30 14:03:08 +02:00
add :color, :string
2021-09-24 14:43:41 +02:00
add :type, :string
add :location, :string
add :game, :string
timestamps()
end
create table(:ownerships, primary_key: false) do
add :user_id, references(:users)
add :clothes_id, references(:clothes)
end
create unique_index(:ownerships, [:user_id, :clothes_id])
end
end