
    create table IDENT_EXTSESSIONS (
       ID number(19,0) generated as identity,
        TOKEN_ISSUER varchar2(256 char) not null,
        SESSION_ID varchar2(64 char) not null,
        EXTSTATE varchar2(4000 char) not null,
        primary key (ID)
    );

    create table IDENT_SESSIONS (
       SESSION_ID varchar2(64 char) not null,
        CREATED_AT timestamp,
        IDENTITY_DATA long,
        IDENTITY_HASH varchar2(512 char),
        LAST_USED_AT timestamp,
        primary key (SESSION_ID)
    );

    create table IDENT_TOKENS (
       TOKEN_KEY varchar2(1024 char) not null,
        CREATED_AT timestamp,
        TOKEN_VALUE long not null,
        EXPIRES_AT timestamp,
        TOKEN_ISSUER varchar2(256 char) not null,
        SESSION_ID varchar2(64 char) not null,
        TOKEN_TYPE number(10,0) not null,
        primary key (TOKEN_KEY)
    );
create index ident_extsessions_state_idx on IDENT_EXTSESSIONS (EXTSTATE);
create index ident_extsessions_session_idx on IDENT_EXTSESSIONS (SESSION_ID);
create index ident_extsessions_issuer_idx on IDENT_EXTSESSIONS (TOKEN_ISSUER);
create index ident_sessions_createdat_idx on IDENT_SESSIONS (CREATED_AT);
create index ident_sessions_lastuseat_idx on IDENT_SESSIONS (LAST_USED_AT);
create index ident_tokens_sessionid_idx on IDENT_TOKENS (SESSION_ID);
create index ident_tokens_issuer_idx on IDENT_TOKENS (TOKEN_ISSUER);
create index ident_tokens_type_idx on IDENT_TOKENS (TOKEN_TYPE);
create index ident_tokens_createdat_idx on IDENT_TOKENS (CREATED_AT);
create index ident_tokens_expiresat_idx on IDENT_TOKENS (EXPIRES_AT);
create index ident_tokens_latest_idx on IDENT_TOKENS (SESSION_ID, TOKEN_ISSUER, TOKEN_TYPE, EXPIRES_AT);
