aboutsummaryrefslogtreecommitdiff
path: root/crates/secd/store/pg/sql/write_email_validation.sql
blob: d99a04ce774eec1f9cf06fc6475f5bed4c467660 (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 secd.email_validation
       (
           email_validation_public_id
           , identity_email_id
           , attempts
           , code
           , is_validated
           , created_at
           , expires_at
       )
values (
           $1
           , (
               select identity_email_id
               from secd.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;