Skip to content

Orphan entries in projects_nodes table #7076

@giancarloromeo

Description

@giancarloromeo

After merging #7010 the migration would fail.
The following query shows you entries inside project_nodes that have no match in the projects table.

The following query will help find the entries that need removal so the migration can be unstuck.

SELECT projects_nodes.*
FROM projects_nodes
LEFT JOIN (
    SELECT
        projects.uuid AS project_id,
        js.key AS node_id
    FROM projects, json_each(projects.workbench) AS js
) AS subquery
ON projects_nodes.project_uuid = subquery.project_id
AND projects_nodes.node_id = subquery.node_id
WHERE subquery.project_id IS NULL;

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions