fix(backend): retry transient database errors in schema and graph migrations (#10177)