mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-31 09:29:34 +00:00
SQLite AUTOINCREMENT keeps a high-water mark in sqlite_sequence that deleting rows never lowers, so after removing inbounds the next add kept climbing instead of reusing freed ids. DelInbound now realigns the counter to MAX(id) after each delete, clearing the sqlite_sequence row entirely when the table is empty so the next inbound starts at id 1. Guarded behind !IsPostgres(); Postgres sequences are left untouched.