Add database migration to merge findings
Merge nonconformities and continual_improvements tables into a unified findings table with kind (NONCONFORMITY, OBSERVATION, EXCEPTION), status, and priority enums. Create findings_audits junction table for the many-to-many audit relationship. The migration generates new FND-XXX reference IDs per organization, migrates both live and snapshot records preserving source_id links, and carries over audit associations to the junction table. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
4
pkg/coredata/migrations/20260315T100000Z.sql
Normal file
4
pkg/coredata/migrations/20260315T100000Z.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Add FINDINGS value to snapshots_type enum
|
||||
-- This must be in its own migration because PostgreSQL requires the new enum
|
||||
-- value to be committed before it can be used in DML statements.
|
||||
ALTER TYPE snapshots_type ADD VALUE IF NOT EXISTS 'FINDINGS';
|
||||
Reference in New Issue
Block a user