aboutsummaryrefslogtreecommitdiff
path: root/crates/secd/store/sqlite/sql/write_address_validation.sql
blob: 67ce916d510b33cd2af1d03d576b9be510c609fd (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
insert into address_validation (
       address_validation_public_id
       , identity_id
       , address_id
       , "method"
       , token_hash
       , code_hash
       , attempts
       , created_at
       , expires_at
       , revoked_at
       , validated_at
) values(
  $1
  , (
        select identity_id from identity where identity_public_id = $2
    )
  , (
        select address_id from address where address_public_id = $3
    )
  , $4, $5, $6, $7, $8, $9, $10, $11
) on conflict (address_validation_public_id) do update
  set identity_id = excluded.identity_id
      , attempts = excluded.attempts
      , revoked_at = excluded.revoked_at
      , validated_at = excluded.validated_at;