Add V127 (sub-project links) + V128 (project assignee) migrations#580
Merged
Conversation
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.
d8f4301 to
4cc0c8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renumbered V126/V127 → V127/V128 after rebasing onto main, which took V126 for standalone notifications (#579).
Core schema support for the
phoenix_kit_projectsnested-sub-projects + project-assignee feature. Two versioned migrations; bumps@current_version126 → 128.V127 — Sub-projects as tasks
Adds
child_project_uuidtophoenix_kit_project_assignmentsso an assignment can embed a child project instead of a task template:phoenix_kit_projects(uuid)ON DELETE RESTRICT (recursive teardown is orchestrated explicitly in the context, not via cascade).task_uuidNOT NULL; adds aCHECK ((task_uuid IS NOT NULL) <> (child_project_uuid IS NOT NULL))XOR.child_project_uuid(a project is a child of at most one parent) + a plain lookup index.down/1deletes the child-link rows (which havetask_uuid IS NULL) before restoringtask_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_uuidtophoenix_kit_projects(ON DELETE SET NULL), a single-assigneeCHECK (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_kitversion marker correctly in both directions (126↔125, 127↔126).Consumed by the
phoenix_kit_projectssub-projects PR (which pins the core release that ships these).