From a307a73b51add165eedd07e08d70703d60c0d2a7 Mon Sep 17 00:00:00 2001 From: MarkPotato777 Date: Mon, 30 Dec 2024 10:34:22 +0800 Subject: [PATCH 1/2] complete connect_database.connect_type if is null --- .../migrate/common/V_4_3_3_6__complete_connect_database.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql diff --git a/server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql b/server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql new file mode 100644 index 0000000000..60d45e4a25 --- /dev/null +++ b/server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql @@ -0,0 +1,4 @@ +UPDATE connect_database AS cd +JOIN connect_connection AS cc ON cd.connection_id = cc.id +SET cd.connect_type = cc.type +WHERE cd.connect_type IS NULL AND cd.type = 'PHYSICAL'; \ No newline at end of file From 9b2a3d3522cf5b7864f1f069dcdd115adfffe51f Mon Sep 17 00:00:00 2001 From: MarkPotato777 Date: Mon, 30 Dec 2024 15:15:40 +0800 Subject: [PATCH 2/2] update sql --- .../common/V_4_3_3_6__complete_connect_database.sql | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql b/server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql index 60d45e4a25..6c3a76cb56 100644 --- a/server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql +++ b/server/odc-migrate/src/main/resources/migrate/common/V_4_3_3_6__complete_connect_database.sql @@ -1,4 +1,6 @@ -UPDATE connect_database AS cd -JOIN connect_connection AS cc ON cd.connection_id = cc.id -SET cd.connect_type = cc.type -WHERE cd.connect_type IS NULL AND cd.type = 'PHYSICAL'; \ No newline at end of file +UPDATE connect_database +SET connect_type = ( + SELECT cc.type FROM connect_connection cc + WHERE connect_database.connection_id = cc.id + ) +WHERE connect_type IS NULL AND type = 'PHYSICAL'; \ No newline at end of file