GispoCoding / hame-ryhti

HAME regional land use planning database compatible with national Ryhti data model
MIT License
0 stars 0 forks source link

Add lifecycle date started_at when a new plan, plan regulation, plan proposition or plan feature is created #303

Open Rikuoja opened 2 weeks ago

Rikuoja commented 2 weeks ago

Creating the plan matter (#273 ) requires that a plan has non-zero initiation date.

So let's add a new trigger: when INSERTing NEW plan, let's save the current time in lifecycle_date with lifecycle_status "02" (vireilletullut).

Also, we want a date to be present for all regulations, propositions and plan objects, so let's add the trigger in all the tables with lifecycle status. However, the date should always have same status as plan, so let's set the lifecycle_status by looking at plan lifecycle_status.

Will have to do this now to get plan matter tests up and running. Or at the very least, will have to add statuses to newly created objects.