aboutsummaryrefslogtreecommitdiff
path: root/crates/secd/store/pg/sql/write_email_validation.sql
blob: 98fc60ead600d7e782147f3b39bd6821a22f3946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
insert into auth.email_validation
       (
           email_validation_public_id
           , identity_email_id
           , attempts
           , code
           , is_validated
           , created_at
           , expires_at
       )
values (
           $1
           , (
               select identity_email_id
               from auth.identity_email
               where identity_id = $2
               and email_id = $3
           )
           , $4
           , $5
           , $6
           , $7
           , $8
) on conflict (email_validation_public_id) do update
  set attempts       = excluded.attempts
      , is_validated = excluded.is_validated
      , expires_at   = excluded.expires_at;