Create files table: id, ownerId → users.id, storagePath, size, mimeType, sha256 (of ciphertext), contentType (file/image/video/audio), createdAt, deletedAt. NO file key column — the key lives only inside the E2EE message envelope. Add relations + types.
Acceptance criteria:
- File metadata stored; no key material in DB
sha256 of ciphertext stored for integrity
- Soft-delete via
deletedAt
Create
filestable:id, ownerId → users.id, storagePath, size, mimeType, sha256(of ciphertext),contentType(file/image/video/audio),createdAt, deletedAt. NO file key column — the key lives only inside the E2EE message envelope. Add relations + types.Acceptance criteria:
sha256of ciphertext stored for integritydeletedAt