All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cassandra.migration.0001_init.cql Maven / Gradle / Ivy

CREATE TABLE IF NOT EXISTS attributes_to_user_sessions (
    attribute_name text,
    attribute_value text,
    user_session_id text,
    PRIMARY KEY (attribute_name, attribute_value, user_session_id)
) WITH CLUSTERING ORDER BY (attribute_value ASC, user_session_id ASC);

CREATE TABLE IF NOT EXISTS authentication_sessions (
    parent_session_id text,
    tab_id text,
    action text,
    client_id text,
    protocol text,
    redirect_uri text,
    timestamp bigint,
    user_id text,
    auth_notes map,
    client_notes map,
    client_scopes set,
    execution_status map,
    required_actions set,
    user_notes map,
    PRIMARY KEY (parent_session_id, tab_id)
) WITH CLUSTERING ORDER BY (tab_id ASC);

CREATE TABLE IF NOT EXISTS client_initial_accesses (
    realm_id text,
    id text,
    count int,
    expiration bigint,
    remaining_count int,
    timestamp bigint,
    PRIMARY KEY (realm_id, id)
) WITH CLUSTERING ORDER BY (id ASC);

CREATE TABLE IF NOT EXISTS client_scopes (
    realm_id text PRIMARY KEY,
    client_scopes frozen>
);

CREATE TABLE IF NOT EXISTS clients (
    realm_id text,
    id text,
    attributes map>>,
    PRIMARY KEY (realm_id, id)
) WITH CLUSTERING ORDER BY (id ASC);

CREATE TABLE IF NOT EXISTS federated_identities (
    user_id text,
    identity_provider text,
    broker_user_id text,
    broker_user_name text,
    created_timestamp timestamp,
    identity_token text,
    realm_id text,
    PRIMARY KEY (user_id, identity_provider)
) WITH CLUSTERING ORDER BY (identity_provider ASC);

CREATE TABLE IF NOT EXISTS federated_identity_to_user_mapping (
    broker_user_id text,
    identity_provider text,
    user_id text,
    PRIMARY KEY ((broker_user_id, identity_provider))
);

CREATE TABLE IF NOT EXISTS login_failures (
    user_id text,
    id text,
    failed_login_not_before bigint,
    last_failure bigint,
    last_ip_failure text,
    num_failures int,
    realm_id text,
    PRIMARY KEY (user_id, id)
) WITH CLUSTERING ORDER BY (id ASC);

CREATE TABLE IF NOT EXISTS name_to_client_scope (
    realm_id text,
    name text,
    id text,
    PRIMARY KEY (realm_id, name)
) WITH CLUSTERING ORDER BY (name ASC);

CREATE TABLE IF NOT EXISTS name_to_realm (
    name text PRIMARY KEY,
    id text
);

CREATE TABLE IF NOT EXISTS realms (
    id text PRIMARY KEY,
    name text,
    attributes map>>
);

CREATE TABLE IF NOT EXISTS realms_to_users (
    realm_id text,
    service_account boolean,
    user_id text,
    PRIMARY KEY (realm_id, service_account, user_id)
) WITH CLUSTERING ORDER BY (service_account ASC, user_id ASC);

CREATE TABLE IF NOT EXISTS roles (
    realm_id text PRIMARY KEY,
    realm_roles frozen>,
    client_roles map>>
);

CREATE TABLE IF NOT EXISTS root_authentication_sessions (
    id text PRIMARY KEY,
    expiration bigint,
    realm_id text,
    timestamp bigint
);

CREATE TABLE IF NOT EXISTS single_use_objects (
    key text PRIMARY KEY,
    notes map
);

CREATE TABLE IF NOT EXISTS user_search_index (
    realm_id text,
    name text,
    value text,
    user_id text,
    PRIMARY KEY ((realm_id, name, value), user_id)
) WITH CLUSTERING ORDER BY (user_id ASC);

CREATE TABLE IF NOT EXISTS user_sessions (
    id text PRIMARY KEY,
    auth_method text,
    broker_session_id text,
    broker_user_id text,
    expiration bigint,
    ip_address text,
    last_session_refresh bigint,
    login_username text,
    offline boolean,
    persistence_state text,
    realm_id text,
    remember_me boolean,
    state text,
    timestamp bigint,
    user_id text,
    client_sessions map,
    notes map
);

CREATE TABLE IF NOT EXISTS user_sessions_to_attributes (
    user_session_id text,
    attribute_name text,
    attribute_values list,
    PRIMARY KEY (user_session_id, attribute_name)
) WITH CLUSTERING ORDER BY (attribute_name ASC);

CREATE TABLE IF NOT EXISTS users (
    realm_id text,
    id text,
    created_timestamp timestamp,
    email text,
    email_verified boolean,
    enabled boolean,
    federation_link text,
    first_name text,
    last_name text,
    service_account boolean,
    service_account_client_link text,
    username text,
    username_case_insensitive text,
    attributes map>>,
    client_roles map>>,
    credentials set,
    realm_roles set,
    required_actions set,
    PRIMARY KEY ((realm_id, id))
);

CREATE TABLE IF NOT EXISTS user_consents (
    realm_id text,
    user_id text,
    client_id text,
    created_timestamp timestamp,
    last_updated_timestamp timestamp,
    granted_client_scopes_id set,
    PRIMARY KEY (realm_id, user_id, client_id)
) WITH CLUSTERING ORDER BY (user_id ASC, client_id ASC);

CREATE TABLE IF NOT EXISTS groups (
    realm_id text PRIMARY KEY,
    version bigint,
    realm_groups frozen>
);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy