Page MenuHomePhorge

When deleting a Project, its direct Milestones remain orphan (should instead be dropped)
Open, LowPublic

Description

Steps to reproduce

  1. Create project "Project A"
  2. Create milestone "Milestone B"
  3. Run the script ./bin/remove destroy on the PHID of "Project A"

What happens

The project "A" is deleted successfully but its milestones remain in the database, forever, broken, pointing to an un-existing project.

$ SELECT * FROM project WHERE parentProjectPHID = 'phid of project a' \G;
*************************** 2. row ***************************
                id: 31
              name: Milestone B
              phid: PHID-PROJ-jnpbxhxisi2a4nhdlu4i
        authorPHID: PHID-USER-ktgdqflnaqzfirxfpu4z
       dateCreated: 1723495791
      dateModified: 1723495791
            status: 0
        viewPolicy: users
        editPolicy: users
        joinPolicy: users
isMembershipLocked: 0
  profileImagePHID: NULL
              icon: project
             color: blue
           mailKey: ricoc4jzkxwi5iqdl2ep
       primarySlug: NULL
 parentProjectPHID: PHID-PROJ-azatir2f7dush2ouz6bm
      hasWorkboard: 0
     hasMilestones: 0
    hasSubprojects: 0
   milestoneNumber: 1
       projectPath: nwns99xv
      projectDepth: 1
    projectPathKey: 99xv
        properties: []
         spacePHID: NULL
           subtype: default

What Should Happen Instead

A milestone cannot exist without its project.

So, deleting a project, we should also drop its milestones.

IMPORTANT: Indeed we MUST keep all related stuff like Tasks, etc. But, milestones themselves just have no sense to exist anymore.

Revisions and Commits