fix the replacement in database.yml and the missing database initialization part