Fix the checks in the migration script, and fix a mistaken tweak in the ...

...new graded_count field

@wedaly 

Would love to set up tests against this. Going to make a note of it; might involve populating a DB, rolling back, and migrating, to verify issues within forward migrations.