20 lines
526 B
Elixir
20 lines
526 B
Elixir
|
|
defmodule MyFirstElixirVibeCode.Repo.Migrations.CreateReviews do
|
||
|
|
use Ecto.Migration
|
||
|
|
|
||
|
|
def change do
|
||
|
|
create table(:reviews) do
|
||
|
|
add :rating, :integer
|
||
|
|
add :title, :string
|
||
|
|
add :content, :text
|
||
|
|
add :project_type, :string
|
||
|
|
add :contractor_id, references(:contractors, on_delete: :nothing)
|
||
|
|
add :client_id, references(:clients, on_delete: :nothing)
|
||
|
|
|
||
|
|
timestamps(type: :utc_datetime)
|
||
|
|
end
|
||
|
|
|
||
|
|
create index(:reviews, [:contractor_id])
|
||
|
|
create index(:reviews, [:client_id])
|
||
|
|
end
|
||
|
|
end
|