move db to it's own package