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.auto_approved_routes text
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.ephemeral boolean default false
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.key_expiry_disabled boolean default false
column nodes.last_control_address 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 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 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 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 credentials(id)
constraint nodes fk_nodes_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
constraint nodes nodes_pkey PRIMARY KEY (id)
constraint policies policies_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_nodes_auth_key_id ON public.nodes USING btree (auth_key_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 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_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_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 policies_pkey ON public.policies USING btree (id)
index CREATE UNIQUE INDEX users_pkey ON public.users USING btree (id)
