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

17 lines
351 B
Elixir
Raw Normal View History

2020-09-14 12:22:25 -04:00
defmodule RealEstate.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