shift73k/priv/repo/migrations/20200914162043_create_properties.exs

16 lines
354 B
Elixir

defmodule Bones73k.Repo.Migrations.CreateProperties do
use Ecto.Migration
def change do
create table(:properties) do
add(:name, :string)
add(:price, :decimal)
add(:description, :text)
add(:user_id, references(:users, on_delete: :nothing))
timestamps()
end
create(index(:properties, [:user_id]))
end
end