MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / ensureAvatarColumn

Function ensureAvatarColumn

packages/core/src/query/member-ops.ts:142–150  ·  view source on GitHub ↗
(db: DatabaseAdapter)

Source from the content-addressed store, hash-verified

140 * Ensure the `avatar` column exists on the `member` table (DDL migration).
141 */
142export function ensureAvatarColumn(db: DatabaseAdapter): boolean {
143 const columns = db.prepare('PRAGMA table_info(member)').all() as unknown as Array<{ name: string }>
144 const has = columns.some((col) => col.name === 'avatar')
145 if (!has) {
146 db.exec('ALTER TABLE member ADD COLUMN avatar TEXT')
147 return true
148 }
149 return false
150}

Callers 4

member-ops.test.tsFile · 0.90
getMemberActivityFunction · 0.90
getMembersFunction · 0.90
getMembersPaginatedFunction · 0.90

Calls 3

allMethod · 0.65
prepareMethod · 0.65
execMethod · 0.65

Tested by

no test coverage detected