Create dependant rows before the rows that depend on them. #### This patch re-orders actions so that row that is referenced created in the Database before the row that references it Dedicated branch: MOODLE_29_FOREIGNKEY_ORDER_OF_THINGS