X-Git-Url: https://git.cweiske.de/paste/664.git/blobdiff_plain/61aaf0930456b86d8cbc177385ff4805a024d4ca..bdff9ef98bd11c0fe2cc642793d808e3a8fa4ca4:/1-add.sql

diff --git a/1-add.sql b/1-add.sql
index 126b4cc..f1c502b 100644
--- a/1-add.sql
+++ b/1-add.sql
@@ -1,3 +1,4 @@
+-- make "external" an JSON object if null
 UPDATE node_data
 JOIN nodes ON nodes.id = node_data.node_id
 SET external = "{}"
@@ -5,6 +6,7 @@ WHERE
   node_data.external IS NULL
   AND nodes.available_for_rent = 1;
 
+-- add "export_portals" array to "external" if it does not exist
 UPDATE node_data
 JOIN nodes ON nodes.id = node_data.node_id
 SET external = JSON_SET(external, '$.export_portals', JSON_ARRAY())
@@ -12,6 +14,7 @@ WHERE
   NOT JSON_CONTAINS_PATH(external, 'all', '$.export_portals')
   AND nodes.available_for_rent = 1;
 
+-- add "hpm-api" value to external.export_portals
 UPDATE node_data
 JOIN nodes ON nodes.id = node_data.node_id
 SET external = JSON_ARRAY_APPEND(external, '$.export_portals', 'hpm-api')
