File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
app/controlplane/pkg/data/ent/migrate/migrations Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change
1
+ -- find project_versions referenced by cas_mapping with a wrong project_id
2
+ with WRONG_MAPPINGS as (select id from cas_mappings
3
+ WHERE workflow_run_id is NULL AND project_id is not NULL
4
+ AND project_id NOT IN (SELECT id FROM projects))
5
+ -- update cas_mapping.project_id to the correct project_id
6
+ UPDATE cas_mappings cm
7
+ SET project_id = (SELECT project_id FROM project_versions pv
8
+ WHERE pv .id = cm .project_id )
9
+ WHERE id IN (SELECT id FROM WRONG_MAPPINGS);
Original file line number Diff line number Diff line change 1
- h1:W2BrLHso2p2/duPEctqndT0qwM/1/93RkVMgtBvVqBM =
1
+ h1:IWmhHm1HHN+aqWErXZaZcoJKrFm50tAr0P/n5PwyMLM =
2
2
20230706165452_init-schema.sql h1:VvqbNFEQnCvUVyj2iDYVQQxDM0+sSXqocpt/5H64k8M=
3
3
20230710111950-cas-backend.sql h1:A8iBuSzZIEbdsv9ipBtscZQuaBp3V5/VMw7eZH6GX+g=
4
4
20230712094107-cas-backends-workflow-runs.sql h1:a5rzxpVGyd56nLRSsKrmCFc9sebg65RWzLghKHh5xvI=
@@ -101,3 +101,4 @@ h1:W2BrLHso2p2/duPEctqndT0qwM/1/93RkVMgtBvVqBM=
101
101
20250723114128.sql h1:OZDXg9CdImiwPsi7X9TJoZ4uPnSa17oY/9HjsxG7WNk=
102
102
20250723171233.sql h1:Aq4IUr4ForrwmK9jMPPtwl4V8e2plYff/IcSgIc0XFo=
103
103
20250728123421.sql h1:VaxxLhVF2PXQ6Vjv4nSWHQjHLM8O9anMxgDMnCkL21I=
104
+ 20250805225449.sql h1:L1M7mR2PuAVoT7bDo9rAoy+eUN7C25sm5Yj1o+zlvhk=
You can’t perform that action at this time.
0 commit comments