3x-ui/database
MHSanaei 8a28373a01
fix(nodes): use GREATEST for last_online merge on PostgreSQL
setRemoteTrafficLocked merged last_online with MAX(last_online, ?), which
is SQLite's two-argument scalar max. PostgreSQL's MAX() is aggregate-only,
so node traffic sync failed every cycle with "function max(bigint, unknown)
does not exist (SQLSTATE 42883)", flooding the logs.

Add a dialect-aware database.GreatestExpr helper (GREATEST on Postgres,
MAX on SQLite) and use it for the last_online merge. last_online is a
non-null int64, so the two functions are semantically identical here.

Closes #4633
2026-05-29 02:04:02 +02:00
..
model feat(fallbacks): add per-rule dest override 2026-05-28 21:17:49 +02:00
db.go fix(nodes): clean up orphaned client_inbounds on node inbound removal 2026-05-29 01:41:52 +02:00
db_seed_test.go fix(clients): backfill missing subId on startup and guard create/update 2026-05-28 18:20:34 +02:00
dialect.go fix(nodes): use GREATEST for last_online merge on PostgreSQL 2026-05-29 02:04:02 +02:00
migrate_data.go Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00