From eb92f823c31a5e702af7005231f0d6915aad3342 Mon Sep 17 00:00:00 2001
From: benj <benj@rse8.com>
Date: Mon, 24 Apr 2023 13:24:45 -0700
Subject: email templates, sendgrid, creds, and some experimental things

Started playing with namespace configs and integrating with zanzibar impls. Still lot's of experimenting and dead code going on.
---
 crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql')

diff --git a/crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql b/crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql
index 299f282..b2ce45d 100644
--- a/crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql
+++ b/crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql
@@ -15,7 +15,7 @@ create table if not exists realm_data (
 create table if not exists identity (
        identity_id integer primary key
        , identity_public_id uuid not null
-       , data text -- some things are dervied, others are not
+       , data text -- we do not prescribe JSON or any other serialization format
        , created_at integer not null
        , updated_at integer not null
        , deleted_at integer
@@ -26,14 +26,18 @@ create table if not exists credential (
        credential_id integer primary key
        , credential_public_id uuid not null
        , identity_id integer not null references identity(identity_id)
+       , partial_key text
        , type text not null-- e.g. password, oidc, totop, lookup_secret, webauthn, ...
        , data text not null
-       , version integer not null
        , created_at integer not null
        , revoked_at integer
        , deleted_at integer
 );
 
+create unique index if not exists credential_passphrase_type_key_ix
+on credential (partial_key)
+where type = 'Passphrase';
+
 create table if not exists address (
        address_id integer primary key
        , address_public_id uuid not null
-- 
cgit v1.2.3

