({
table,
}: {
table: DBTable;
})
| 140 | }; |
| 141 | |
| 142 | export const getTableIndexesWithPrimaryKey = ({ |
| 143 | table, |
| 144 | }: { |
| 145 | table: DBTable; |
| 146 | }): DBIndex[] => { |
| 147 | const primaryKeyIndex = getTablePrimaryKeyIndex({ table }); |
| 148 | const indexesWithoutPKIndex = table.indexes.filter( |
| 149 | (idx) => !idx.isPrimaryKey |
| 150 | ); |
| 151 | return primaryKeyIndex |
| 152 | ? [primaryKeyIndex, ...indexesWithoutPKIndex] |
| 153 | : indexesWithoutPKIndex; |
| 154 | }; |
no test coverage detected