Skip to content

Commit 02f7935

Browse files
committed
add lead job invitations migration
Creates table to track job invitation statuses between users and lead jobs.
1 parent cb70c8f commit 02f7935

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
defmodule Algora.Repo.Migrations.CreateLeadJobInvitations do
2+
use Ecto.Migration
3+
4+
def change do
5+
create table(:lead_job_invitations, primary_key: false) do
6+
add :id, :string, primary_key: true
7+
add :status, :string, null: false, default: "pending"
8+
9+
add :user_id, references(:users, type: :string, on_delete: :delete_all), null: false
10+
add :lead_job_id, references(:lead_jobs, type: :string, on_delete: :delete_all), null: false
11+
12+
timestamps()
13+
end
14+
15+
create unique_index(:lead_job_invitations, [:user_id, :lead_job_id],
16+
name: :lead_job_invitations_user_id_lead_job_id_index
17+
)
18+
end
19+
end

0 commit comments

Comments
 (0)