Skip to content

Allow Plan Bounds to be Changed#1833

Draft
Mythicaeda wants to merge 6 commits into
developfrom
feat/change-plan-bounds
Draft

Allow Plan Bounds to be Changed#1833
Mythicaeda wants to merge 6 commits into
developfrom
feat/change-plan-bounds

Conversation

@Mythicaeda
Copy link
Copy Markdown
Contributor

Description

Adds a trigger to the Plan table to cascade updates to plan bounds to dependent tables
- specifically: activity_directive, simulation_dataset, and plan_dataset
- simulation bounds are NOT automatically updated by this trigger
- a snapshot is automatically taken when this trigger fires

Adds columns to the Plan Snapshots table to track plan boundaries at the time of snapshot creation

  • updates the Create and Restore Snapshot functions to restore plan boundaries

Updates the "Update Plan Revision when Activity Directive is Updated" trigger to not fire if another trigger updates the activity_directive table

  • Manually verified that the only trigger-originating update to Activity Directive is from the new trigger on Plan. All other updates to the Activity Directive table are either from function calls (ie commit_merge, delete_activity_by_pk_reanchor_subtree) or via user GQL requests
  • If we want to avoid this update, we could pull the trigger function into a manually-called Hasura function, similar to how we handled model migration and keep the restriction on updating the DB column

Verification

TODO

Documentation

Future work

- Adds a trigger to cascade boundary changes
- Allows snapshots to track and restore plan bounds
- This constraint is no longer necessary now that we have snapshot description to disambiguate identically-named snapshots
@Mythicaeda Mythicaeda self-assigned this Jun 1, 2026
@Mythicaeda Mythicaeda added feature A new feature or feature request database Anything related to the database labels Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

database Anything related to the database feature A new feature or feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change plan start and end bounds

1 participant