| 1852 | } |
| 1853 | |
| 1854 | func hasExternalEdges(addEdges, clearEdges map[Rel][]*EdgeSpec) bool { |
| 1855 | // M2M edges reside in a join-table, and O2M edges reside |
| 1856 | // in the M2O table (the entity that holds the FK). |
| 1857 | if len(clearEdges[M2M]) > 0 || len(addEdges[M2M]) > 0 || |
| 1858 | len(clearEdges[O2M]) > 0 || len(addEdges[O2M]) > 0 { |
| 1859 | return true |
| 1860 | } |
| 1861 | for _, edges := range [][]*EdgeSpec{clearEdges[O2O], addEdges[O2O]} { |
| 1862 | for _, e := range edges { |
| 1863 | if !e.Inverse { |
| 1864 | return true |
| 1865 | } |
| 1866 | } |
| 1867 | } |
| 1868 | return false |
| 1869 | } |
| 1870 | |
| 1871 | // isExternalEdge reports if the given edge requires an UPDATE |
| 1872 | // or an INSERT to other table. |