Skip to content

Move To Polymorphic Relationship For Governed Models #46

@mikebronner

Description

@mikebronner

Change reliance on governor_created_by database field to polymorphic model relationship with its own dedicated table. This will remove the burden of custom migrations and the requirement to add the field to all tables.


Acceptance Criteria

  • Governed models use polymorphic relationships instead of direct foreign keys
  • Migration is provided to move existing data to the new structure without data loss
  • All Governor queries and policies work correctly after the migration

Test Coverage

  • Unit test: governed model can be attached/detach via polymorphic relationship
  • Integration test: migration runs cleanly on existing data
  • Regression test: all existing policy and permission checks pass after refactor

WSJF Priority Score

  • Score: 1.05
  • User/Business Value: 7
  • Time Criticality: 8
  • Risk Reduction/Opportunity Enablement: 8
  • Calculation: (7 + 8 + 8) ÷ size

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions