Sets up the database