import { getSimpleHash } from '@directus/shared/utils' ; see https export function getDefaultIndexName ( type , collection , fields ) { if ( ! Array . isArray ( fields ) ) fields = fields ? [ fields ] : [ ] ; const table = collection . replace ( /\.|-/g , '_' ) ; const indexName = ( table + '_' + fields . join ( '_' ) + '_' + type ) . toLowerCase ( ) ; if ( indexName . length <= 60 ) return indexName ; const suffix = `__${ getSimpleHash ( indexName ) }_${ type }` ; const prefix = indexName . substring ( 0 , 60 - suffix . length ) ; return `${ prefix }${ suffix }` ; }