File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
services/datalake/pod-datalake/src/datalake Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -619,12 +619,24 @@ function migrationV2 (): [string, string] {
619
619
UPDATE blob.blob
620
620
SET workspace = w.uuid
621
621
FROM global_account.workspace w
622
- WHERE workspace = w.data_id;
622
+ WHERE workspace = w.data_id
623
+ AND NOT EXISTS (
624
+ SELECT 1
625
+ FROM blob.blob existing
626
+ WHERE existing.workspace = w.uuid::string
627
+ AND existing.name = blob.blob.name
628
+ );
623
629
624
630
UPDATE blob.meta
625
631
SET workspace = w.uuid
626
632
FROM global_account.workspace w
627
- WHERE workspace = w.data_id;
633
+ WHERE workspace = w.data_id
634
+ AND NOT EXISTS (
635
+ SELECT 1
636
+ FROM blob.meta existing
637
+ WHERE existing.workspace = w.uuid::string
638
+ AND existing.name = blob.meta.name
639
+ );
628
640
629
641
ALTER TABLE blob.meta ADD CONSTRAINT fk_blob_meta FOREIGN KEY (workspace, name) REFERENCES blob.blob (workspace, name);
630
642
`
You can’t perform that action at this time.
0 commit comments