16 lines
354 B
Elixir
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
|