Fix ordering of db updates and syntax errors.

Thanks to Richa for pointing this out to me.

* Before, on a clean install the index_rev_id wouldn't work since
  annotation_rev_id didn't have the old name.
* To resolve this, this does the rename before the index is added, and
  has the index refer to the new name.  modifyExtensionField
  automatically skips if the old column name doesn't exist.
* It also moves the index file into the patch directory (this changes
  the key in the updatelog table, but it doesn't matter since if it's
  already run, it will still skip since the old name is missing).
* Fixes syntax errors in the create table.

Change-Id: I7e74d8b574f12e981ead275e95fa62adca252041
Merge "Fix ordering of db updates and syntax errors."