Since each revision now has files, associate comments with the
file relation rather than revisions so that the path is not stored
twice in the database.
Also correct a problem where comments could be left on empty files
or lines that are not in a file in the unified view.
The SQLAlchemy constraints API seems to have changed between
0.9.9 and 1.0.4. Support both behaviors to be user-friendly even
though we now specify 1.0.4.
Change-Id: If6593d279a432ea8a48f4bd74a157e4978e69eaa