apps change
This commit is contained in:
+24
-10
@@ -7,16 +7,30 @@ def get_apps():
|
|||||||
rows = con.execute(
|
rows = con.execute(
|
||||||
"""
|
"""
|
||||||
SELECT
|
SELECT
|
||||||
id,
|
a.id,
|
||||||
name,
|
a.name,
|
||||||
language,
|
a.language,
|
||||||
version,
|
a.version,
|
||||||
status,
|
a.status,
|
||||||
COALESCE(memory, '') AS memory,
|
COALESCE(a.memory, '') AS memory,
|
||||||
COALESCE(cpus, '') AS cpus,
|
COALESCE(a.cpus, '') AS cpus,
|
||||||
updated_at
|
a.updated_at,
|
||||||
FROM apps
|
(
|
||||||
ORDER BY id
|
SELECT d.status
|
||||||
|
FROM deployments d
|
||||||
|
WHERE d.app_id = a.id
|
||||||
|
ORDER BY d.id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) AS last_deploy_status,
|
||||||
|
(
|
||||||
|
SELECT d.started_at
|
||||||
|
FROM deployments d
|
||||||
|
WHERE d.app_id = a.id
|
||||||
|
ORDER BY d.id DESC
|
||||||
|
LIMIT 1
|
||||||
|
) AS last_deploy_started_at
|
||||||
|
FROM apps a
|
||||||
|
ORDER BY a.id
|
||||||
"""
|
"""
|
||||||
).fetchall()
|
).fetchall()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user