Always use local IDs at the database level. Fixes #150.

Fixes  #150