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