Add all data for individual regions/solar systems

This commit is contained in:
2025-06-14 02:15:49 +02:00
parent f657ca6990
commit 54bd0601fe
71 changed files with 175056 additions and 87 deletions

26
public/solarSystems.sql Normal file
View File

@@ -0,0 +1,26 @@
WITH SystemConnections AS (
SELECT
ss_from.solarSystemId AS fromSystemId,
ss_to.solarSystemName AS toSystemName
FROM StarGates sg
JOIN SolarSystems ss_from ON sg.fromSystemId = ss_from.solarSystemId
JOIN SolarSystems ss_to ON sg.toSystemId = ss_to.solarSystemId
),
ConnectedSystems AS (
SELECT
fromSystemId,
GROUP_CONCAT(DISTINCT toSystemName) AS connectedSystems
FROM SystemConnections
GROUP BY fromSystemId
)
SELECT
ss.solarSystemName AS solarSystemName,
ml.x,
ml.y,
re.regionName as regionName,
COALESCE(cs.connectedSystems, '') AS connectedSystems
FROM MapLayout ml
JOIN SolarSystems ss ON ss.solarSystemId = ml.solarSystemId
JOIN MapLayouts mls ON ml.layoutId = mls.layoutId
JOIN Regions re ON re.regionId = mls.regionId
LEFT JOIN ConnectedSystems cs ON ss.solarSystemId = cs.fromSystemId;