Skip to content

Add V127 (sub-project links) + V128 (project assignee) migrations#580

Merged
ddon merged 1 commit into
BeamLabEU:mainfrom
mdon:core-subprojects-v126-v127
Jun 1, 2026
Merged

Add V127 (sub-project links) + V128 (project assignee) migrations#580
ddon merged 1 commit into
BeamLabEU:mainfrom
mdon:core-subprojects-v126-v127

Conversation

@mdon

@mdon mdon commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Renumbered V126/V127 → V127/V128 after rebasing onto main, which took V126 for standalone notifications (#579).

Core schema support for the phoenix_kit_projects nested-sub-projects + project-assignee feature. Two versioned migrations; bumps @current_version 126 → 128.

V127 — Sub-projects as tasks

Adds child_project_uuid to phoenix_kit_project_assignments so an assignment can embed a child project instead of a task template:

  • FK → phoenix_kit_projects(uuid) ON DELETE RESTRICT (recursive teardown is orchestrated explicitly in the context, not via cascade).
  • Drops task_uuid NOT NULL; adds a CHECK ((task_uuid IS NOT NULL) <> (child_project_uuid IS NOT NULL)) XOR.
  • Partial UNIQUE index on child_project_uuid (a project is a child of at most one parent) + a plain lookup index.
  • down/1 deletes the child-link rows (which have task_uuid IS NULL) before restoring task_uuid NOT NULL, so rollback can't fail on those rows.

V128 — Assignee on projects (and sub-projects)

Adds assigned_team_uuid / assigned_department_uuid / assigned_person_uuid to phoenix_kit_projects (ON DELETE SET NULL), a single-assignee CHECK (num_nonnulls(...) <= 1), and partial indexes. Since a sub-project is a project, this one column set also covers assigning a sub-project.

Both migrations are idempotent (existence-guarded), prefix-aware, and set the COMMENT ON TABLE phoenix_kit version marker correctly in both directions (126↔125, 127↔126).

Consumed by the phoenix_kit_projects sub-projects PR (which pins the core release that ships these).

Core schema support for the phoenix_kit_projects nested-sub-projects +
project-assignee feature. Renumbered from V126/V127 → V127/V128 after
rebasing onto main, which took V126 for standalone notifications (BeamLabEU#579).
Bumps @current_version 126 → 128.

V127 — Sub-projects as tasks: adds child_project_uuid to
phoenix_kit_project_assignments (ON DELETE RESTRICT) so an assignment can
embed a child project instead of a task; task_uuid-XOR-child CHECK; partial
unique index (one parent per child); drops task_uuid NOT NULL. down/1 deletes
the child-link rows before restoring NOT NULL.

V128 — Assignee on projects: adds assigned_team/department/person_uuid to
phoenix_kit_projects (ON DELETE SET NULL) with a single-assignee CHECK +
partial indexes. A sub-project is a project, so this covers it too.
@mdon mdon force-pushed the core-subprojects-v126-v127 branch from d8f4301 to 4cc0c8d Compare June 1, 2026 21:17
@mdon mdon changed the title Add V126 (sub-project links) + V127 (project assignee) migrations Add V127 (sub-project links) + V128 (project assignee) migrations Jun 1, 2026
@ddon ddon merged commit f87e563 into BeamLabEU:main Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants