make signed up at default to now (#1284)

This commit is contained in:
Mantra 2026-03-23 15:02:43 -07:00 committed by GitHub
parent 238ed06120
commit 736c1a19b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,8 @@
-- Backward-compat: old code that doesn't know about `signedUpAt` omits it from
-- INSERT. Adding a DEFAULT lets Postgres fill it automatically.
--
-- CURRENT_TIMESTAMP is correct here: `createdAt` also defaults to
-- CURRENT_TIMESTAMP, so within the same transaction both columns receive the
-- same value. Old code never computes risk scores, so the negligible edge
-- case of an explicitly-backdated `createdAt` is harmless.
ALTER TABLE "ProjectUser" ALTER COLUMN "signedUpAt" SET DEFAULT CURRENT_TIMESTAMP;

View File

@ -276,7 +276,7 @@ model ProjectUser {
restrictedByAdminPrivateDetails String? // Private details (server access only)
// Sign-up metadata
signedUpAt DateTime
signedUpAt DateTime @default(now())
signUpIp String?
signUpIpTrusted Boolean?
signUpEmailNormalized String?