prepare database