conditionally create db