2021-02-24 07:49:39 -05:00
|
|
|
defmodule Bones73k.Repo.Migrations.CreateProperties do
|
2020-09-14 12:22:25 -04:00
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create table(:properties) do
|
2021-02-24 07:49:39 -05:00
|
|
|
add(:name, :string)
|
|
|
|
add(:price, :decimal)
|
|
|
|
add(:description, :text)
|
|
|
|
add(:user_id, references(:users, on_delete: :nothing))
|
2020-09-14 12:22:25 -04:00
|
|
|
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
2021-02-24 07:49:39 -05:00
|
|
|
create(index(:properties, [:user_id]))
|
2020-09-14 12:22:25 -04:00
|
|
|
end
|
|
|
|
end
|