Create FK for parent_uuid on ALTER TABLE

Due to the fact that in MySQL a foreign key constraint requires indexes
for all involved fields it should be defined after these indexes.

The backref definition was corrected for the parent relationship.

Change-Id: I891af2cf6efbcb401c6a2c38e65c8aaf22d171b0
Merge "Create FK for parent_uuid on ALTER TABLE"