From ab6d5cefbea1e8ddf41f385dd85918f651958287 Mon Sep 17 00:00:00 2001
From: benj <benj@rse8.com>
Date: Mon, 19 Jun 2023 17:18:21 -0700
Subject: hack to allow impersonator to impersonate target

---
 .../sqlite/migrations/20221125051738_bootstrap.sql  | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 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 b2ce45d..0a182e1 100644
--- a/crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql
+++ b/crates/secd/store/sqlite/migrations/20221125051738_bootstrap.sql
@@ -34,9 +34,7 @@ create table if not exists credential (
        , deleted_at integer
 );
 
-create unique index if not exists credential_passphrase_type_key_ix
-on credential (partial_key)
-where type = 'Passphrase';
+create unique index if not exists credential_partial_key_type_key_ix on credential (partial_key);
 
 create table if not exists address (
        address_id integer primary key
@@ -63,16 +61,6 @@ create table if not exists address_validation (
        , unique(address_validation_public_id)
 );
 
-create table if not exists session (
-       session_id integer primary key
-       , identity_id integer not null references identity(identity_id)
-       , token_hash blob not null
-       , created_at integer not null
-       , expired_at integer not null
-       , revoked_at integer
-       , unique(token_hash)
-);
-
 create table if not exists message (
        message_id integer primary key
        , address_id integer not null references address(address_id)
@@ -83,3 +71,10 @@ create table if not exists message (
        , created_at integer not null
        , sent_at integer
 );
+
+create table if not exists impersonator (
+       impersonator_id integer not null references identity(identity_id)
+       , target_id integer not null references identity(identity_id)
+       , credential_id integer not null references credential(credential_id)
+       , created_at integer not null
+);
-- 
cgit v1.2.3

