mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-19 16:55:02 +02:00
`projectId` was nullable, and a null one made the row unreadable: every read filters on that column, so an unattributed entry was written and then never surfaced to anyone. The column is now NOT NULL, and `ActivityEventInput` requires it. The nullable column existed for one case, and that case turns out to be fixable. `workflow-deleted` reaches a listener after the workflow row and its `shared_workflow` rows have cascaded away, so the project cannot be looked up at that point. But it can be captured before the delete: `workflow.service.ts` already resolves the workflow, already calls `ownershipService`, and already runs a `beforeWorkflowDeleted` hook whose stated purpose is capturing rows the delete is about to cascade away. Enriching the event is upstream work, tracked on the relay ticket. Instance-level credentials are not an exception either. `instance_credential_- assignment` maps a use slot to an ordinary credential that lives in a project; what is instance-level is the assignment, not the credential. Two test changes follow. The project-cascade test now writes to two projects and asserts only the deleted one's entries go, since it can no longer lean on an unattributed row surviving. And a new test confirms the column rejects an entry with no project. |
||
|---|---|---|
| .. | ||
| postgres-schema | ||
| sqlite-schema | ||