feat(pitch-admin): backfill first_activity_at for existing investors
Build pitch-deck / build-push-deploy (push) Successful in 1m22s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 30s
CI / test-python-voice (push) Successful in 31s
CI / test-bqas (push) Successful in 31s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-04-30 15:08:26 +02:00
parent 23b233bda3
commit 2f861cd6d7
@@ -16,6 +16,11 @@ export async function POST(request: NextRequest) {
`CREATE INDEX IF NOT EXISTS idx_pitch_investors_mask_check
ON pitch_investors (first_activity_at)
WHERE first_activity_at IS NOT NULL AND data_masked_at IS NULL`,
// 004b — backfill first_activity_at for existing investors from last_login_at
`UPDATE pitch_investors
SET first_activity_at = last_login_at
WHERE last_login_at IS NOT NULL
AND first_activity_at IS NULL`,
`CREATE TABLE IF NOT EXISTS fp_scenarios (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL DEFAULT 'Base Case',