bones73k/priv/repo/migrations/20200914162043_create_properties.exs
Joao Gilberto Balsini Moura 4526435972 Run mix phx.gen.live properties
2020-09-14 13:22:25 -03:00

16 lines
351 B
Elixir

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