A social knowledge tool for researchers built on ATProto
45
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: resolve Drizzle ORM index and import errors

Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>

+9 -13
+3 -4
src/modules/cards/infrastructure/repositories/schema/card.sql.ts
··· 7 7 integer, 8 8 index, 9 9 type PgTableWithColumns, 10 - sql, 11 10 } from 'drizzle-orm/pg-core'; 11 + import { sql } from 'drizzle-orm'; 12 12 import { publishedRecords } from './publishedRecord.sql'; 13 13 14 14 export const cards: PgTableWithColumns<any> = pgTable( ··· 39 39 // Optimizes sorting cards by type and update time in query results 40 40 typeUpdatedAtIdx: index('idx_cards_type_updated_at') 41 41 .on(table.type, table.updatedAt.desc()), 42 - // Covering index for getLibrariesForUrl - fast URL+type lookups with card ID included 42 + // Index for getLibrariesForUrl - fast URL+type lookups 43 43 urlTypeIdx: index('idx_cards_url_type') 44 - .on(table.url, table.type) 45 - .include(table.id), 44 + .on(table.url, table.type), 46 45 // Partial index for finding NOTE cards by parent - only indexes NOTE type cards 47 46 parentTypeIdx: index('idx_cards_parent_type') 48 47 .on(table.parentCardId, table.type)
+4 -6
src/modules/cards/infrastructure/repositories/schema/collection.sql.ts
··· 73 73 table.collectionId, 74 74 ), 75 75 // Performance indexes 76 - // Covering index for getCardsInCollection - sorted by add time with cardId included 76 + // Index for getCardsInCollection - sorted by add time 77 77 collectionAddedIdx: index('idx_collection_cards_collection_added') 78 - .on(table.collectionId, table.addedAt.desc()) 79 - .include(table.cardId), 80 - // Covering index for finding collections containing a card - avoids table lookups 78 + .on(table.collectionId, table.addedAt.desc()), 79 + // Index for finding collections containing a card 81 80 cardCollectionIdx: index('idx_collection_cards_card_collection') 82 - .on(table.cardId) 83 - .include(table.collectionId), 81 + .on(table.cardId), 84 82 }; 85 83 }, 86 84 );
+2 -3
src/modules/cards/infrastructure/repositories/schema/libraryMembership.sql.ts
··· 27 27 userCardsIdx: index('idx_user_cards').on(table.userId), 28 28 cardUsersIdx: index('idx_card_users').on(table.cardId), 29 29 // Performance indexes 30 - // Covering index for getUrlCardsOfUser - avoids table lookups by including cardId 30 + // Index for getUrlCardsOfUser 31 31 userTypeCoveringIdx: index('idx_library_memberships_user_type_covering') 32 - .on(table.userId, table.addedAt.desc()) 33 - .include(table.cardId), 32 + .on(table.userId, table.addedAt.desc()), 34 33 }; 35 34 }, 36 35 );