fix(mana-media): change userId from UUID to TEXT for Matrix user IDs

Matrix user IDs like @user:matrix.org are not UUIDs, so the schema
needs to accept text strings for the userId field in media_references.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-02-02 18:45:40 +01:00
parent cee30ff7ed
commit 5c19500748

View file

@ -65,8 +65,8 @@ export const mediaReferences = pgTable(
mediaId: uuid('media_id')
.references(() => media.id, { onDelete: 'cascade' })
.notNull(),
// Owner info
userId: uuid('user_id').notNull(),
// Owner info (can be UUID or Matrix user ID like @user:matrix.org)
userId: text('user_id').notNull(),
// Source app (nutriphi, contacts, chat, etc.)
app: text('app').notNull(),
// Optional: reference to the source (e.g., mxc:// URL from Matrix)