core: Fix 64-bit ID SQLite -> Postgres migration