column api_keys.created_at timestamp with time zone
column api_keys.expiration timestamp with time zone
column api_keys.hash bytea
column api_keys.id bigint not null default nextval('api_keys_id_seq'::regclass)
column api_keys.last_seen timestamp with time zone
column api_keys.prefix text
column api_keys.user_id bigint
column credentials.client_id text
column credentials.created_at timestamp with time zone
column credentials.created_by_token boolean default false
column credentials.description text
column credentials.ephemeral boolean default false
column credentials.expiration timestamp with time zone
column credentials.hash bytea
column credentials.id bigint not null default nextval('credentials_id_seq'::regclass)
column credentials.identifier text
column credentials.kind text not null
column credentials.last_seen timestamp with time zone
column credentials.reusable boolean
column credentials.revoked timestamp with time zone
column credentials.scopes text
column credentials.tags text
column credentials.used boolean default false
column credentials.user_id bigint
column database_versions.id bigint not null default nextval('database_versions_id_seq'::regclass)
column database_versions.updated_at timestamp with time zone
column database_versions.version text not null
column migrations.id character varying not null
column nodes.approved_routes text
column nodes.auth_key_id bigint
column nodes.created_at timestamp with time zone
column nodes.deleted_at timestamp with time zone
column nodes.disco_key text
column nodes.endpoints text
column nodes.expiry timestamp with time zone
column nodes.given_name character varying
column nodes.host_info text
column nodes.hostname text
column nodes.id bigint not null default nextval('nodes_id_seq'::regclass)
column nodes.ipv4 text
column nodes.ipv6 text
column nodes.last_seen timestamp with time zone
column nodes.machine_key text
column nodes.node_key text
column nodes.register_method text
column nodes.tags text
column nodes.updated_at timestamp with time zone
column nodes.user_id bigint
column oauth_access_tokens.client_id text
column oauth_access_tokens.created_at timestamp with time zone
column oauth_access_tokens.expiration timestamp with time zone
column oauth_access_tokens.hash bytea
column oauth_access_tokens.id bigint not null default nextval('oauth_access_tokens_id_seq'::regclass)
column oauth_access_tokens.prefix text
column oauth_access_tokens.scopes text
column oauth_access_tokens.tags text
column oauth_clients.client_id text
column oauth_clients.created_at timestamp with time zone
column oauth_clients.description text
column oauth_clients.id bigint not null default nextval('oauth_clients_id_seq'::regclass)
column oauth_clients.revoked timestamp with time zone
column oauth_clients.scopes text
column oauth_clients.secret_hash bytea
column oauth_clients.tags text
column oauth_clients.user_id bigint
column policies.created_at timestamp with time zone
column policies.data text
column policies.deleted_at timestamp with time zone
column policies.id bigint not null default nextval('policies_id_seq'::regclass)
column policies.updated_at timestamp with time zone
column pre_auth_keys.created_at timestamp with time zone
column pre_auth_keys.description text
column pre_auth_keys.ephemeral boolean default false
column pre_auth_keys.expiration timestamp with time zone
column pre_auth_keys.hash bytea
column pre_auth_keys.id bigint not null default nextval('pre_auth_keys_id_seq'::regclass)
column pre_auth_keys.key text
column pre_auth_keys.prefix text
column pre_auth_keys.reusable boolean
column pre_auth_keys.revoked timestamp with time zone
column pre_auth_keys.tags text
column pre_auth_keys.used boolean default false
column pre_auth_keys.user_id bigint
column users.created_at timestamp with time zone
column users.deleted_at timestamp with time zone
column users.display_name text
column users.email text
column users.id bigint not null default nextval('users_id_seq'::regclass)
column users.name text
column users.profile_pic_url text
column users.provider text
column users.provider_identifier text
column users.updated_at timestamp with time zone
constraint api_keys api_keys_pkey PRIMARY KEY (id)
constraint credentials chk_credentials_hash CHECK (((hash IS NOT NULL) OR (revoked IS NOT NULL)))
constraint credentials chk_credentials_hash_format CHECK (((hash IS NULL) OR (SUBSTRING(hash FROM 1 FOR 1) = '\x24'::bytea)))
constraint credentials credentials_kind_check CHECK ((kind = ANY (ARRAY['api'::text, 'authkey'::text, 'oauth_client'::text, 'oauth_token'::text])))
constraint credentials credentials_pkey PRIMARY KEY (id)
constraint credentials fk_credentials_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL
constraint database_versions database_versions_pkey PRIMARY KEY (id)
constraint migrations migrations_pkey PRIMARY KEY (id)
constraint nodes fk_nodes_auth_key FOREIGN KEY (auth_key_id) REFERENCES pre_auth_keys(id)
constraint nodes fk_nodes_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
constraint nodes nodes_pkey PRIMARY KEY (id)
constraint oauth_access_tokens oauth_access_tokens_pkey PRIMARY KEY (id)
constraint oauth_clients oauth_clients_pkey PRIMARY KEY (id)
constraint policies policies_pkey PRIMARY KEY (id)
constraint pre_auth_keys fk_pre_auth_keys_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL
constraint pre_auth_keys pre_auth_keys_pkey PRIMARY KEY (id)
constraint users users_pkey PRIMARY KEY (id)
index CREATE INDEX idx_credentials_user_id ON public.credentials USING btree (user_id)
index CREATE INDEX idx_policies_deleted_at ON public.policies USING btree (deleted_at)
index CREATE INDEX idx_users_deleted_at ON public.users USING btree (deleted_at)
index CREATE UNIQUE INDEX api_keys_pkey ON public.api_keys USING btree (id)
index CREATE UNIQUE INDEX credentials_pkey ON public.credentials USING btree (id)
index CREATE UNIQUE INDEX database_versions_pkey ON public.database_versions USING btree (id)
index CREATE UNIQUE INDEX idx_api_keys_prefix ON public.api_keys USING btree (prefix)
index CREATE UNIQUE INDEX idx_credentials_identifier ON public.credentials USING btree (kind, identifier)
index CREATE UNIQUE INDEX idx_name_no_provider_identifier ON public.users USING btree (name) WHERE (provider_identifier IS NULL)
index CREATE UNIQUE INDEX idx_name_provider_identifier ON public.users USING btree (name, provider_identifier)
index CREATE UNIQUE INDEX idx_oauth_access_tokens_prefix ON public.oauth_access_tokens USING btree (prefix)
index CREATE UNIQUE INDEX idx_oauth_clients_client_id ON public.oauth_clients USING btree (client_id)
index CREATE UNIQUE INDEX idx_pre_auth_keys_prefix ON public.pre_auth_keys USING btree (prefix) WHERE ((prefix IS NOT NULL) AND (prefix <> ''::text))
index CREATE UNIQUE INDEX idx_provider_identifier ON public.users USING btree (provider_identifier) WHERE (provider_identifier IS NOT NULL)
index CREATE UNIQUE INDEX migrations_pkey ON public.migrations USING btree (id)
index CREATE UNIQUE INDEX nodes_pkey ON public.nodes USING btree (id)
index CREATE UNIQUE INDEX oauth_access_tokens_pkey ON public.oauth_access_tokens USING btree (id)
index CREATE UNIQUE INDEX oauth_clients_pkey ON public.oauth_clients USING btree (id)
index CREATE UNIQUE INDEX policies_pkey ON public.policies USING btree (id)
index CREATE UNIQUE INDEX pre_auth_keys_pkey ON public.pre_auth_keys USING btree (id)
index CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)
