- Media (voice/video/image/file): private bucket, presigned PUT upload, reference-only publish, membership-gated presigned GET for viewing - Avatars: public bucket, presigned PUT + direct public URL, profile.update event - messages.media_key + media_meta (migration 1720000000005_media) - Explicit MinIO region on presigning client (avoids getBucketRegion network call) - Event type values sourced from EventType constants (no raw string literals) - Web: attach button, MediaView renderer, avatar upload in topbar Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFRyKxkKEjfAgpXygzoNiD
16 lines
587 B
JavaScript
16 lines
587 B
JavaScript
// Phase 6 — media messages. The media reference is kept in dedicated columns
|
|
// (server-visible object key + metadata) separate from `content` (the caption),
|
|
// so E2EE can later encrypt the caption without hiding the storage pointer.
|
|
|
|
/** @param {import('node-pg-migrate').MigrationBuilder} pgm */
|
|
exports.up = (pgm) => {
|
|
pgm.addColumns('messages', {
|
|
media_key: { type: 'text' },
|
|
media_meta: { type: 'jsonb' },
|
|
});
|
|
};
|
|
|
|
/** @param {import('node-pg-migrate').MigrationBuilder} pgm */
|
|
exports.down = (pgm) => {
|
|
pgm.dropColumns('messages', ['media_key', 'media_meta']);
|
|
};
|