(type: 'index' | 'unique')
| 763 | |
| 764 | protected getPropertyIndexes(prop: EntityProperty, options: Dictionary): string[] { |
| 765 | const processIndex = (type: 'index' | 'unique') => { |
| 766 | const propType = prop[type]; |
| 767 | if (!propType) { |
| 768 | return; |
| 769 | } |
| 770 | |
| 771 | const defaultName = this.platform.getIndexName(this.meta.collection, prop.fieldNames, type); |
| 772 | options[type] = propType === true || defaultName === propType ? 'true' : this.quote(propType); |
| 773 | const expected = { |
| 774 | index: this.platform.indexForeignKeys(), |
| 775 | unique: prop.kind === ReferenceKind.ONE_TO_ONE, |
| 776 | }; |
| 777 | |
| 778 | if (expected[type] && options[type] === 'true') { |
| 779 | delete options[type]; |
| 780 | } |
| 781 | }; |
| 782 | |
| 783 | processIndex('index'); |
| 784 | processIndex('unique'); |
nothing calls this directly
no test coverage detected