Added the database creation logic.