* Finds the difference between the indexes index1 and index2. * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences.
(index1: IndexDef, index2: IndexDef)
| 984 | * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences. |
| 985 | */ |
| 986 | diffIndex(index1: IndexDef, index2: IndexDef): boolean { |
| 987 | // Opaque raw expressions (`expression` escape hatch) and full-text indexes can't be |
| 988 | // compared structurally — fall back to name-only matching. |
| 989 | if (index1.expression || index2.expression || index1.type === 'fulltext' || index2.type === 'fulltext') { |
| 990 | return index1.keyName !== index2.keyName; |
| 991 | } |
| 992 | |
| 993 | return !this.isIndexFulfilledBy(index1, index2) || !this.isIndexFulfilledBy(index2, index1); |
| 994 | } |
| 995 | |
| 996 | /** |
| 997 | * Checks if the other index already fulfills all the indexing and constraint needs of the current one. |
no test coverage detected