Wrong migration.

This is incomplete.
TODO: name all the damn foreign-key constraints, or fix dbdiff.
drop bad migrations file
Switch to flask_sqlalchemy

and fix a few bugs while we're at it
doc file I forgot to add to git :-/