Order should be 1. We delete all the file records (from core.file table) 2. We add the foreign key file / applicationId (pg constraint) 3. We further update the table structure: fullPath is deleted; path is created; unicity constraint between workspaceId/applicationId/path is created (pg constraint) 4. we migrate the workflow steps (this will create files in core.file) 5. we backfill the application package (same) --------- Co-authored-by: Charles Bochet <charles@twenty.com>