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