@@ -292,10 +292,17 @@ func (i *inspect) indexes(
292292
293293 // secondary indexes
294294 for _ , idx := range tableDesc .Indexes {
295+ isUnique := idx .Type == options .GlobalUniqueIndex ()
296+ isAsync := idx .Type == options .GlobalAsyncIndex ()
297+
298+ fmt .Printf ("[INSPECT] index=%q type=%v isUnique=%v isAsync=%v (GlobalUniqueIndex=%v, GlobalAsyncIndex=%v, GlobalIndex=%v)\n " ,
299+ idx .Name , idx .Type , isUnique , isAsync ,
300+ options .GlobalUniqueIndex (), options .GlobalAsyncIndex (), options .GlobalIndex ())
301+
295302 atlasIdx := & schema.Index {
296303 Name : idx .Name ,
297304 Table : table ,
298- Unique : idx . Type == options . GlobalUniqueIndex () ,
305+ Unique : isUnique ,
299306 }
300307
301308 for _ , columnName := range idx .IndexColumns {
@@ -310,7 +317,7 @@ func (i *inspect) indexes(
310317 }
311318
312319 indexAttrs := & IndexAttributes {
313- Async : idx . Type == options . GlobalAsyncIndex () ,
320+ Async : isAsync ,
314321 }
315322
316323 for _ , dataCol := range idx .DataColumns {
@@ -323,6 +330,9 @@ func (i *inspect) indexes(
323330
324331 atlasIdx .Attrs = append (atlasIdx .Attrs , indexAttrs )
325332
333+ fmt .Printf ("[INSPECT] index=%q final: Unique=%v Async=%v CoverColumns=%d\n " ,
334+ idx .Name , atlasIdx .Unique , indexAttrs .Async , len (indexAttrs .CoverColumns ))
335+
326336 table .AddIndexes (atlasIdx )
327337 }
328338
0 commit comments