Added database migration files and refactored code to calculate story total score