Improve local db script.
Merge remote-tracking branch 'refs/remotes/drebs/feature/improve-local-db-script' into develop