jobsworth icon indicating copy to clipboard operation
jobsworth copied to clipboard

Promote status to stage

Open ari opened this issue 8 years ago • 2 comments

https://github.com/ari/jobsworth/wiki/Stage

Make the following new schema...

[ stage_model ]
company_id
name
id
-> projects (one to many join)

On migration create one model per company with name "default".

[ stage ]
company_id
id
name
sort
-> stage_model (many to many join so they can be reused for several workflows) 

On migration look for a task property called "status", "state" or "stage" (in that order). Then create new stage records for each property_value. Join this to stage stage_model 'default' created above. Remember this is one set of records per company (tenant).

If there is no task property to migrate, then make a new set like this:

  • Review
    
  • In progress
    
  • Testing
    
  • Documentation
    

This new default set should also be created whenever a user creates a new company (tenant) or initialises a whole new database.

Add a new relationship to task:

[ task ]
-> current_stage

And finish the migration by copying over the existing propery-task joins to this new entity.

Finally, migrate over all the existing UI to the new schema. This involves adding the new entry field to:

  • task list view (including the dropdown of configurable columns)
  • task edit view (under the attributes section)
  • billing page (as an option to group on for pivot reports)
  • task search UI

Then finally delete the old custom attrbute from the database once the migration is done and successful.

ari avatar Jul 04 '16 03:07 ari

The above is just stage one: to migrate the existing field and pave the way for future new work.

ari avatar Jul 04 '16 03:07 ari

Oh, and I'm aware that at the end of this task we will no longer have a UI to edit the stages.

ari avatar Jul 04 '16 03:07 ari