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

---
 .../pg/migrations/20221222002434_bootstrap.sql     | 33 ++++------------------
 1 file changed, 5 insertions(+), 28 deletions(-)

(limited to 'crates/secd/store/pg/migrations/20221222002434_bootstrap.sql')

diff --git a/crates/secd/store/pg/migrations/20221222002434_bootstrap.sql b/crates/secd/store/pg/migrations/20221222002434_bootstrap.sql
index 0fd423e..8f0a9c0 100644
--- a/crates/secd/store/pg/migrations/20221222002434_bootstrap.sql
+++ b/crates/secd/store/pg/migrations/20221222002434_bootstrap.sql
@@ -66,16 +66,6 @@ create table if not exists secd.address_validation (
        , unique(address_validation_public_id)
 );
 
-create table if not exists secd.session (
-       session_id bigserial primary key
-       , identity_id bigint not null references secd.identity(identity_id)
-       , token_hash bytea not null
-       , created_at timestamptz not null
-       , expired_at timestamptz not null
-       , revoked_at timestamptz
-       , unique(token_hash)
-);
-
 create table if not exists secd.message (
        message_id bigserial primary key
        , address_id bigint not null references secd.address(address_id)
@@ -87,22 +77,9 @@ create table if not exists secd.message (
        , sent_at timestamptz
 );
 
-create table if not exists secd.namespace_config (
-       namespace text not null
-       , serialized_config text not null
-       , created_at xid8 not null
-       , deleted_at xid8
-       -- TODO: indexes and stuff
-);
-
-create table if not exists secd.relation_tuple (
-       namespace text not null
-       , object_id text not null
-       , relation text not null
-       , userset_namespace text not null
-       , userset_object_id text not null
-       , userset_relation text not null
-       , created_at xid8 not null
-       , deleted_at xid8 not null
-       -- TODO: indexes and stuff
+create table if not exists secd.impersonator (
+       impersonator_id bigint not null references secd.identity(identity_id)
+       , target_id bigint not null references secd.identity(identity_id)
+       , credential_id bigint not null references secd.credential(credential_id)
+       , created_at timestamptz not null
 );
-- 
cgit v1.2.3

