feat(db): migration 20260429130352 — alter Profile encrypted columns to text
Generated by `prisma migrate dev --name encrypt_profile_fields`. ALTER TABLE "profiles" sets weight_start_kg / weight_current_kg / weight_goal_kg / target_date to TEXT. Existing rows keep their decimal representation as plaintext text (e.g. "76.00") and prisma-field-encryption re-encrypts them on the next write — both ciphertext (v1.aesgcm256.<keyId>. <iv>.<ciphertext>) and legacy plaintext are decrypted transparently on read, so no app-level fallback was needed. Verified end-to-end: - pnpm test:e2e — all 4 specs pass, including profile signup → submit → BMR 1583 / TDEE 1899 round-trip - raw SQL on profiles shows ciphertext for new rows; older rows stay in clear text until their next update Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9555022143
commit
c85179659a
1 file changed
+5
@@ -0,0 +1,5 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "profiles" ALTER COLUMN "weight_start_kg" SET DATA TYPE TEXT,
|
||||||
|
ALTER COLUMN "weight_current_kg" SET DATA TYPE TEXT,
|
||||||
|
ALTER COLUMN "weight_goal_kg" SET DATA TYPE TEXT,
|
||||||
|
ALTER COLUMN "target_date" SET DATA TYPE TEXT;
|
||||||
Reference in new issue
Block a user