PhoenixKit.Migrations.Postgres.V128 (phoenix_kit v1.7.130)

Copy Markdown View Source

V128: Assignee on projects (and sub-projects).

Lets a whole project be assigned to a Department / Team / Person, exactly like a task (phoenix_kit_project_assignments) already can. Because a sub-project is a project (V127), this single set of columns covers both top-level projects and sub-projects — a sub-project's assignee lives on its own project row.

Adds to phoenix_kit_projects:

  • assigned_team_uuid → FK phoenix_kit_staff_teams(uuid) ON DELETE SET NULL
  • assigned_department_uuid → FK phoenix_kit_staff_departments(uuid) ON DELETE SET NULL
  • assigned_person_uuid → FK phoenix_kit_staff_people(uuid) ON DELETE SET NULL
  • CHECK num_nonnulls(team, department, person) <= 1 — at most one assignee (the same single-assignee rule the assignments table uses).
  • a partial index per FK for "what's assigned to X" lookups.

ON DELETE SET NULL so removing a team/department/person un-assigns the project rather than deleting it. Idempotent DO-blocks throughout.

Summary

Functions

down(opts)

up(opts)