NYCPlanning / db-developments

🏠 🏘️ 🏗️ Developments Database
https://nycplanning.github.io/db-developments
8 stars 2 forks source link

Set `job_inactive` to `Inactive: Stalled` only if all date fields show >3 years without a change #560

Closed SashaWeinstein closed 2 years ago

SashaWeinstein commented 2 years ago

Small PR, one reviewer 📆 Addresses issues #546. We don't want to change the date_lastupdt field but we also know it's wrong sometimes. We've addressed this in the past with manual corrections that change job_inactive from Stalled: Inactive to NULL. This is a programmatic solution that constructs a new temporary date last updated field (_date_lastupdt) in the DRAFT_STATUS_devdb common table expression. This new field is used only once to set job_inactive.

I have have missed a usable date field when constructing _date_lastupdt so I would have appreciate a careful check that I didn't leave anything out.

This code makes the 6 manual correction that change job_inaction from Inactive: Stalled to NULL obsolete