hwhub/DB_README.md

386 KiB

Database & Backend Notes

Status: TBD (to be completed later)

This document is currently a placeholder and will be filled with the real as-is database state, scripts, migrations, RPCs, and RLS details.

This document is the central place for database-related setup, schema notes, and backend conventions for car64.

Stack

  • Supabase Postgres
  • Supabase Auth
  • Supabase Storage
  • Supabase RPC functions

Environments

Document your environment endpoints and key handling policy here.

Schema Overview

Document important tables and relations here, for example: [ { "table_schema": "auth", "table_name": "audit_log_entries", "ordinal_position": 1, "column_name": "instance_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "audit_log_entries", "ordinal_position": 2, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "audit_log_entries", "ordinal_position": 3, "column_name": "payload", "data_type": "json", "udt_name": "json", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "audit_log_entries", "ordinal_position": 4, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "audit_log_entries", "ordinal_position": 5, "column_name": "ip_address", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": "''::character varying" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 2, "column_name": "provider_type", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 3, "column_name": "identifier", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 4, "column_name": "name", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 5, "column_name": "client_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 6, "column_name": "client_secret", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 7, "column_name": "acceptable_client_ids", "data_type": "ARRAY", "udt_name": "_text", "is_nullable": "NO", "column_default": "'{}'::text[]" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 8, "column_name": "scopes", "data_type": "ARRAY", "udt_name": "_text", "is_nullable": "NO", "column_default": "'{}'::text[]" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 9, "column_name": "pkce_enabled", "data_type": "boolean", "udt_name": "bool", "is_nullable": "NO", "column_default": "true" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 10, "column_name": "attribute_mapping", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "NO", "column_default": "'{}'::jsonb" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 11, "column_name": "authorization_params", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "NO", "column_default": "'{}'::jsonb" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 12, "column_name": "enabled", "data_type": "boolean", "udt_name": "bool", "is_nullable": "NO", "column_default": "true" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 13, "column_name": "email_optional", "data_type": "boolean", "udt_name": "bool", "is_nullable": "NO", "column_default": "false" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 14, "column_name": "issuer", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 15, "column_name": "discovery_url", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 16, "column_name": "skip_nonce_check", "data_type": "boolean", "udt_name": "bool", "is_nullable": "NO", "column_default": "false" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 17, "column_name": "cached_discovery", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 18, "column_name": "discovery_cached_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 19, "column_name": "authorization_url", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 20, "column_name": "token_url", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 21, "column_name": "userinfo_url", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 22, "column_name": "jwks_uri", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 23, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "ordinal_position": 24, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 2, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 3, "column_name": "auth_code", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 4, "column_name": "code_challenge_method", "data_type": "USER-DEFINED", "udt_name": "code_challenge_method", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 5, "column_name": "code_challenge", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 6, "column_name": "provider_type", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 7, "column_name": "provider_access_token", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 8, "column_name": "provider_refresh_token", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 9, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 10, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 11, "column_name": "authentication_method", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 12, "column_name": "auth_code_issued_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 13, "column_name": "invite_token", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 14, "column_name": "referrer", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 15, "column_name": "oauth_client_state_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 16, "column_name": "linking_target_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "flow_state", "ordinal_position": 17, "column_name": "email_optional", "data_type": "boolean", "udt_name": "bool", "is_nullable": "NO", "column_default": "false" }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 1, "column_name": "provider_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 2, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 3, "column_name": "identity_data", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 4, "column_name": "provider", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 5, "column_name": "last_sign_in_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 6, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 7, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 8, "column_name": "email", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "identities", "ordinal_position": 9, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "auth", "table_name": "instances", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "instances", "ordinal_position": 2, "column_name": "uuid", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "instances", "ordinal_position": 3, "column_name": "raw_base_config", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "instances", "ordinal_position": 4, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "instances", "ordinal_position": 5, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "ordinal_position": 1, "column_name": "session_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "ordinal_position": 2, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "ordinal_position": 3, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "ordinal_position": 4, "column_name": "authentication_method", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "ordinal_position": 5, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_challenges", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_challenges", "ordinal_position": 2, "column_name": "factor_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_challenges", "ordinal_position": 3, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_challenges", "ordinal_position": 4, "column_name": "verified_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_challenges", "ordinal_position": 5, "column_name": "ip_address", "data_type": "inet", "udt_name": "inet", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_challenges", "ordinal_position": 6, "column_name": "otp_code", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_challenges", "ordinal_position": 7, "column_name": "web_authn_session_data", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 2, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 3, "column_name": "friendly_name", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 4, "column_name": "factor_type", "data_type": "USER-DEFINED", "udt_name": "factor_type", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 5, "column_name": "status", "data_type": "USER-DEFINED", "udt_name": "factor_status", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 6, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 7, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 8, "column_name": "secret", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 9, "column_name": "phone", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 10, "column_name": "last_challenged_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 11, "column_name": "web_authn_credential", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 12, "column_name": "web_authn_aaguid", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "mfa_factors", "ordinal_position": 13, "column_name": "last_webauthn_challenge_data", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 2, "column_name": "authorization_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 3, "column_name": "client_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 4, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 5, "column_name": "redirect_uri", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 6, "column_name": "scope", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 7, "column_name": "state", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 8, "column_name": "resource", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 9, "column_name": "code_challenge", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 10, "column_name": "code_challenge_method", "data_type": "USER-DEFINED", "udt_name": "code_challenge_method", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 11, "column_name": "response_type", "data_type": "USER-DEFINED", "udt_name": "oauth_response_type", "is_nullable": "NO", "column_default": "'code'::auth.oauth_response_type" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 12, "column_name": "status", "data_type": "USER-DEFINED", "udt_name": "oauth_authorization_status", "is_nullable": "NO", "column_default": "'pending'::auth.oauth_authorization_status" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 13, "column_name": "authorization_code", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 14, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 15, "column_name": "expires_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "(now() + '00:03:00'::interval)" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 16, "column_name": "approved_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_authorizations", "ordinal_position": 17, "column_name": "nonce", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_client_states", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_client_states", "ordinal_position": 2, "column_name": "provider_type", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_client_states", "ordinal_position": 3, "column_name": "code_verifier", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_client_states", "ordinal_position": 4, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 3, "column_name": "client_secret_hash", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 4, "column_name": "registration_type", "data_type": "USER-DEFINED", "udt_name": "oauth_registration_type", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 5, "column_name": "redirect_uris", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 6, "column_name": "grant_types", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 7, "column_name": "client_name", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 8, "column_name": "client_uri", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 9, "column_name": "logo_uri", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 10, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 11, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 12, "column_name": "deleted_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 13, "column_name": "client_type", "data_type": "USER-DEFINED", "udt_name": "oauth_client_type", "is_nullable": "NO", "column_default": "'confidential'::auth.oauth_client_type" }, { "table_schema": "auth", "table_name": "oauth_clients", "ordinal_position": 14, "column_name": "token_endpoint_auth_method", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_consents", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_consents", "ordinal_position": 2, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_consents", "ordinal_position": 3, "column_name": "client_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_consents", "ordinal_position": 4, "column_name": "scopes", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "oauth_consents", "ordinal_position": 5, "column_name": "granted_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "oauth_consents", "ordinal_position": 6, "column_name": "revoked_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "one_time_tokens", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "one_time_tokens", "ordinal_position": 2, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "one_time_tokens", "ordinal_position": 3, "column_name": "token_type", "data_type": "USER-DEFINED", "udt_name": "one_time_token_type", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "one_time_tokens", "ordinal_position": 4, "column_name": "token_hash", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "one_time_tokens", "ordinal_position": 5, "column_name": "relates_to", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "one_time_tokens", "ordinal_position": 6, "column_name": "created_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "one_time_tokens", "ordinal_position": 7, "column_name": "updated_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 1, "column_name": "instance_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 2, "column_name": "id", "data_type": "bigint", "udt_name": "int8", "is_nullable": "NO", "column_default": "nextval('auth.refresh_tokens_id_seq'::regclass)" }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 3, "column_name": "token", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 4, "column_name": "user_id", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 5, "column_name": "revoked", "data_type": "boolean", "udt_name": "bool", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 6, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 7, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 8, "column_name": "parent", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "refresh_tokens", "ordinal_position": 9, "column_name": "session_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 2, "column_name": "sso_provider_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 3, "column_name": "entity_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 4, "column_name": "metadata_xml", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 5, "column_name": "metadata_url", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 6, "column_name": "attribute_mapping", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 7, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 8, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_providers", "ordinal_position": 9, "column_name": "name_id_format", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 2, "column_name": "sso_provider_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 3, "column_name": "request_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 4, "column_name": "for_email", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 5, "column_name": "redirect_to", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 7, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 8, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "saml_relay_states", "ordinal_position": 9, "column_name": "flow_state_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "schema_migrations", "ordinal_position": 1, "column_name": "version", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 2, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 3, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 4, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 5, "column_name": "factor_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 6, "column_name": "aal", "data_type": "USER-DEFINED", "udt_name": "aal_level", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 7, "column_name": "not_after", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 8, "column_name": "refreshed_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 9, "column_name": "user_agent", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 10, "column_name": "ip", "data_type": "inet", "udt_name": "inet", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 11, "column_name": "tag", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 12, "column_name": "oauth_client_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 13, "column_name": "refresh_token_hmac_key", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 14, "column_name": "refresh_token_counter", "data_type": "bigint", "udt_name": "int8", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sessions", "ordinal_position": 15, "column_name": "scopes", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sso_domains", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "sso_domains", "ordinal_position": 2, "column_name": "sso_provider_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "sso_domains", "ordinal_position": 3, "column_name": "domain", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "sso_domains", "ordinal_position": 4, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sso_domains", "ordinal_position": 5, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sso_providers", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "sso_providers", "ordinal_position": 2, "column_name": "resource_id", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sso_providers", "ordinal_position": 3, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sso_providers", "ordinal_position": 4, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "sso_providers", "ordinal_position": 5, "column_name": "disabled", "data_type": "boolean", "udt_name": "bool", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 1, "column_name": "instance_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 2, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 3, "column_name": "aud", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 4, "column_name": "role", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 5, "column_name": "email", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 6, "column_name": "encrypted_password", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 7, "column_name": "email_confirmed_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 8, "column_name": "invited_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 9, "column_name": "confirmation_token", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 10, "column_name": "confirmation_sent_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 11, "column_name": "recovery_token", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 12, "column_name": "recovery_sent_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 13, "column_name": "email_change_token_new", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 14, "column_name": "email_change", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 15, "column_name": "email_change_sent_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 16, "column_name": "last_sign_in_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 17, "column_name": "raw_app_meta_data", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 18, "column_name": "raw_user_meta_data", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 19, "column_name": "is_super_admin", "data_type": "boolean", "udt_name": "bool", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 20, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 21, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 22, "column_name": "phone", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": "NULL::character varying" }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 23, "column_name": "phone_confirmed_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 24, "column_name": "phone_change", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": "''::character varying" }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 25, "column_name": "phone_change_token", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": "''::character varying" }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 26, "column_name": "phone_change_sent_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 27, "column_name": "confirmed_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 28, "column_name": "email_change_token_current", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": "''::character varying" }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 29, "column_name": "email_change_confirm_status", "data_type": "smallint", "udt_name": "int2", "is_nullable": "YES", "column_default": "0" }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 30, "column_name": "banned_until", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 31, "column_name": "reauthentication_token", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": "''::character varying" }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 32, "column_name": "reauthentication_sent_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 33, "column_name": "is_sso_user", "data_type": "boolean", "udt_name": "bool", "is_nullable": "NO", "column_default": "false" }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 34, "column_name": "deleted_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "auth", "table_name": "users", "ordinal_position": 35, "column_name": "is_anonymous", "data_type": "boolean", "udt_name": "bool", "is_nullable": "NO", "column_default": "false" }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 2, "column_name": "hw_id", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 3, "column_name": "hotwheels_id", "data_type": "bigint", "udt_name": "int8", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 4, "column_name": "reporter_user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 5, "column_name": "reason", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 6, "column_name": "note", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 7, "column_name": "status", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": "'open'::text" }, { "table_schema": "public", "table_name": "car_reports", "ordinal_position": 8, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "public", "table_name": "car_votes", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "public", "table_name": "car_votes", "ordinal_position": 2, "column_name": "hw_id", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "car_votes", "ordinal_position": 3, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "car_votes", "ordinal_position": 4, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "public", "table_name": "collection_members", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "public", "table_name": "collection_members", "ordinal_position": 2, "column_name": "collection_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "collection_members", "ordinal_position": 3, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "collection_members", "ordinal_position": 4, "column_name": "role", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": "'viewer'::text" }, { "table_schema": "public", "table_name": "collection_members", "ordinal_position": 5, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "public", "table_name": "collections", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "public", "table_name": "collections", "ordinal_position": 2, "column_name": "name", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "collections", "ordinal_position": 3, "column_name": "description", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "collections", "ordinal_position": 4, "column_name": "owner_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "collections", "ordinal_position": 5, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 1, "column_name": "hw_id", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 2, "column_name": "name", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 3, "column_name": "series", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 4, "column_name": "year", "data_type": "integer", "udt_name": "int4", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 5, "column_name": "color", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 6, "column_name": "image_url", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 7, "column_name": "is_verified", "data_type": "boolean", "udt_name": "bool", "is_nullable": "YES", "column_default": "false" }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 8, "column_name": "confirmation_count", "data_type": "integer", "udt_name": "int4", "is_nullable": "YES", "column_default": "1" }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 9, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "public", "table_name": "global_cars", "ordinal_position": 10, "column_name": "report_count", "data_type": "integer", "udt_name": "int4", "is_nullable": "YES", "column_default": "0" }, { "table_schema": "public", "table_name": "hotwheels", "ordinal_position": 1, "column_name": "id", "data_type": "bigint", "udt_name": "int8", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "hotwheels", "ordinal_position": 2, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "public", "table_name": "hotwheels", "ordinal_position": 3, "column_name": "hw_id", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "hotwheels", "ordinal_position": 4, "column_name": "user_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "hotwheels", "ordinal_position": 9, "column_name": "notes", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "public", "table_name": "hotwheels", "ordinal_position": 11, "column_name": "collection_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "public", "table_name": "hotwheels", "ordinal_position": 12, "column_name": "user_image_url", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "YES", "column_default": null }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 3, "column_name": "topic", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 4, "column_name": "extension", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 5, "column_name": "payload", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 6, "column_name": "event", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 7, "column_name": "private", "data_type": "boolean", "udt_name": "bool", "is_nullable": "YES", "column_default": "false" }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 8, "column_name": "updated_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 9, "column_name": "inserted_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "realtime", "table_name": "messages", "ordinal_position": 10, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "realtime", "table_name": "schema_migrations", "ordinal_position": 1, "column_name": "version", "data_type": "bigint", "udt_name": "int8", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "schema_migrations", "ordinal_position": 2, "column_name": "inserted_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "YES", "column_default": null }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 1, "column_name": "id", "data_type": "bigint", "udt_name": "int8", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 2, "column_name": "subscription_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 4, "column_name": "entity", "data_type": "regclass", "udt_name": "regclass", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 5, "column_name": "filters", "data_type": "ARRAY", "udt_name": "_user_defined_filter", "is_nullable": "NO", "column_default": "'{}'::realtime.user_defined_filter[]" }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 7, "column_name": "claims", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 8, "column_name": "claims_role", "data_type": "regrole", "udt_name": "regrole", "is_nullable": "NO", "column_default": null }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 9, "column_name": "created_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "NO", "column_default": "timezone('utc'::text, now())" }, { "table_schema": "realtime", "table_name": "subscription", "ordinal_position": 10, "column_name": "action_filter", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": "'*'::text" }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 1, "column_name": "id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 2, "column_name": "name", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 3, "column_name": "owner", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 4, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 5, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 6, "column_name": "public", "data_type": "boolean", "udt_name": "bool", "is_nullable": "YES", "column_default": "false" }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 7, "column_name": "avif_autodetection", "data_type": "boolean", "udt_name": "bool", "is_nullable": "YES", "column_default": "false" }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 8, "column_name": "file_size_limit", "data_type": "bigint", "udt_name": "int8", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 9, "column_name": "allowed_mime_types", "data_type": "ARRAY", "udt_name": "_text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 10, "column_name": "owner_id", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "buckets", "ordinal_position": 11, "column_name": "type", "data_type": "USER-DEFINED", "udt_name": "buckettype", "is_nullable": "NO", "column_default": "'STANDARD'::storage.buckettype" }, { "table_schema": "storage", "table_name": "buckets_analytics", "ordinal_position": 1, "column_name": "name", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "buckets_analytics", "ordinal_position": 2, "column_name": "type", "data_type": "USER-DEFINED", "udt_name": "buckettype", "is_nullable": "NO", "column_default": "'ANALYTICS'::storage.buckettype" }, { "table_schema": "storage", "table_name": "buckets_analytics", "ordinal_position": 3, "column_name": "format", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": "'ICEBERG'::text" }, { "table_schema": "storage", "table_name": "buckets_analytics", "ordinal_position": 4, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "storage", "table_name": "buckets_analytics", "ordinal_position": 5, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "storage", "table_name": "buckets_analytics", "ordinal_position": 6, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "storage", "table_name": "buckets_analytics", "ordinal_position": 7, "column_name": "deleted_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "buckets_vectors", "ordinal_position": 1, "column_name": "id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "buckets_vectors", "ordinal_position": 2, "column_name": "type", "data_type": "USER-DEFINED", "udt_name": "buckettype", "is_nullable": "NO", "column_default": "'VECTOR'::storage.buckettype" }, { "table_schema": "storage", "table_name": "buckets_vectors", "ordinal_position": 3, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "storage", "table_name": "buckets_vectors", "ordinal_position": 4, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "storage", "table_name": "migrations", "ordinal_position": 1, "column_name": "id", "data_type": "integer", "udt_name": "int4", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "migrations", "ordinal_position": 2, "column_name": "name", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "migrations", "ordinal_position": 3, "column_name": "hash", "data_type": "character varying", "udt_name": "varchar", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "migrations", "ordinal_position": 4, "column_name": "executed_at", "data_type": "timestamp without time zone", "udt_name": "timestamp", "is_nullable": "YES", "column_default": "CURRENT_TIMESTAMP" }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 2, "column_name": "bucket_id", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 3, "column_name": "name", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 4, "column_name": "owner", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 5, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 6, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 7, "column_name": "last_accessed_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "YES", "column_default": "now()" }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 8, "column_name": "metadata", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 9, "column_name": "path_tokens", "data_type": "ARRAY", "udt_name": "_text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 10, "column_name": "version", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 11, "column_name": "owner_id", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "objects", "ordinal_position": 12, "column_name": "user_metadata", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 1, "column_name": "id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 2, "column_name": "in_progress_size", "data_type": "bigint", "udt_name": "int8", "is_nullable": "NO", "column_default": "0" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 3, "column_name": "upload_signature", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 4, "column_name": "bucket_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 5, "column_name": "key", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 6, "column_name": "version", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 7, "column_name": "owner_id", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 8, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "ordinal_position": 9, "column_name": "user_metadata", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 2, "column_name": "upload_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 3, "column_name": "size", "data_type": "bigint", "udt_name": "int8", "is_nullable": "NO", "column_default": "0" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 4, "column_name": "part_number", "data_type": "integer", "udt_name": "int4", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 5, "column_name": "bucket_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 6, "column_name": "key", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 7, "column_name": "etag", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 8, "column_name": "owner_id", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 9, "column_name": "version", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "ordinal_position": 10, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 1, "column_name": "id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 2, "column_name": "name", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 3, "column_name": "bucket_id", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 4, "column_name": "data_type", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 5, "column_name": "dimension", "data_type": "integer", "udt_name": "int4", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 6, "column_name": "distance_metric", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 7, "column_name": "metadata_configuration", "data_type": "jsonb", "udt_name": "jsonb", "is_nullable": "YES", "column_default": null }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 8, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "storage", "table_name": "vector_indexes", "ordinal_position": 9, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "now()" }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 1, "column_name": "id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "NO", "column_default": "gen_random_uuid()" }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 2, "column_name": "name", "data_type": "text", "udt_name": "text", "is_nullable": "YES", "column_default": null }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 3, "column_name": "description", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": "''::text" }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 4, "column_name": "secret", "data_type": "text", "udt_name": "text", "is_nullable": "NO", "column_default": null }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 5, "column_name": "key_id", "data_type": "uuid", "udt_name": "uuid", "is_nullable": "YES", "column_default": null }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 6, "column_name": "nonce", "data_type": "bytea", "udt_name": "bytea", "is_nullable": "YES", "column_default": "vault._crypto_aead_det_noncegen()" }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 7, "column_name": "created_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "CURRENT_TIMESTAMP" }, { "table_schema": "vault", "table_name": "secrets", "ordinal_position": 8, "column_name": "updated_at", "data_type": "timestamp with time zone", "udt_name": "timestamptz", "is_nullable": "NO", "column_default": "CURRENT_TIMESTAMP" } ]

[ { "schema_name": "auth", "table_name": "audit_log_entries", "constraint_name": "audit_log_entries_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_authorization_url_https", "constraint_type": "CHECK", "definition": "CHECK (authorization_url IS NULL OR authorization_url ~~ 'https://%'::text)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_authorization_url_length", "constraint_type": "CHECK", "definition": "CHECK (authorization_url IS NULL OR char_length(authorization_url) <= 2048)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_client_id_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(client_id) >= 1 AND char_length(client_id) <= 512)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_discovery_url_length", "constraint_type": "CHECK", "definition": "CHECK (discovery_url IS NULL OR char_length(discovery_url) <= 2048)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_identifier_format", "constraint_type": "CHECK", "definition": "CHECK (identifier ~ '^[a-z0-9][a-z0-9:-]{0,48}[a-z0-9]$'::text)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_identifier_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (identifier)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_issuer_length", "constraint_type": "CHECK", "definition": "CHECK (issuer IS NULL OR char_length(issuer) >= 1 AND char_length(issuer) <= 2048)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_jwks_uri_https", "constraint_type": "CHECK", "definition": "CHECK (jwks_uri IS NULL OR jwks_uri ~~ 'https://%'::text)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_jwks_uri_length", "constraint_type": "CHECK", "definition": "CHECK (jwks_uri IS NULL OR char_length(jwks_uri) <= 2048)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_name_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(name) >= 1 AND char_length(name) <= 100)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_oauth2_requires_endpoints", "constraint_type": "CHECK", "definition": "CHECK (provider_type <> 'oauth2'::text OR authorization_url IS NOT NULL AND token_url IS NOT NULL AND userinfo_url IS NOT NULL)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_oidc_discovery_url_https", "constraint_type": "CHECK", "definition": "CHECK (provider_type <> 'oidc'::text OR discovery_url IS NULL OR discovery_url ~~ 'https://%'::text)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_oidc_issuer_https", "constraint_type": "CHECK", "definition": "CHECK (provider_type <> 'oidc'::text OR issuer IS NULL OR issuer ~~ 'https://%'::text)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_oidc_requires_issuer", "constraint_type": "CHECK", "definition": "CHECK (provider_type <> 'oidc'::text OR issuer IS NOT NULL)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_provider_type_check", "constraint_type": "CHECK", "definition": "CHECK (provider_type = ANY (ARRAY['oauth2'::text, 'oidc'::text]))" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_token_url_https", "constraint_type": "CHECK", "definition": "CHECK (token_url IS NULL OR token_url ~~ 'https://%'::text)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_token_url_length", "constraint_type": "CHECK", "definition": "CHECK (token_url IS NULL OR char_length(token_url) <= 2048)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_userinfo_url_https", "constraint_type": "CHECK", "definition": "CHECK (userinfo_url IS NULL OR userinfo_url ~~ 'https://%'::text)" }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "constraint_name": "custom_oauth_providers_userinfo_url_length", "constraint_type": "CHECK", "definition": "CHECK (userinfo_url IS NULL OR char_length(userinfo_url) <= 2048)" }, { "schema_name": "auth", "table_name": "flow_state", "constraint_name": "flow_state_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "identities", "constraint_name": "identities_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "identities", "constraint_name": "identities_provider_id_provider_unique", "constraint_type": "UNIQUE", "definition": "UNIQUE (provider_id, provider)" }, { "schema_name": "auth", "table_name": "identities", "constraint_name": "identities_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "instances", "constraint_name": "instances_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "mfa_amr_claims", "constraint_name": "amr_id_pk", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "mfa_amr_claims", "constraint_name": "mfa_amr_claims_session_id_authentication_method_pkey", "constraint_type": "UNIQUE", "definition": "UNIQUE (session_id, authentication_method)" }, { "schema_name": "auth", "table_name": "mfa_amr_claims", "constraint_name": "mfa_amr_claims_session_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "mfa_challenges", "constraint_name": "mfa_challenges_auth_factor_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (factor_id) REFERENCES auth.mfa_factors(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "mfa_challenges", "constraint_name": "mfa_challenges_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "mfa_factors", "constraint_name": "mfa_factors_last_challenged_at_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (last_challenged_at)" }, { "schema_name": "auth", "table_name": "mfa_factors", "constraint_name": "mfa_factors_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "mfa_factors", "constraint_name": "mfa_factors_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_authorization_code_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (authorization_code)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_authorization_code_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(authorization_code) <= 255)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_authorization_id_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (authorization_id)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_client_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (client_id) REFERENCES auth.oauth_clients(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_code_challenge_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(code_challenge) <= 128)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_expires_at_future", "constraint_type": "CHECK", "definition": "CHECK (expires_at > created_at)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_nonce_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(nonce) <= 255)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_redirect_uri_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(redirect_uri) <= 2048)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_resource_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(resource) <= 2048)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_scope_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(scope) <= 4096)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_state_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(state) <= 4096)" }, { "schema_name": "auth", "table_name": "oauth_authorizations", "constraint_name": "oauth_authorizations_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "oauth_client_states", "constraint_name": "oauth_client_states_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "oauth_clients", "constraint_name": "oauth_clients_client_name_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(client_name) <= 1024)" }, { "schema_name": "auth", "table_name": "oauth_clients", "constraint_name": "oauth_clients_client_uri_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(client_uri) <= 2048)" }, { "schema_name": "auth", "table_name": "oauth_clients", "constraint_name": "oauth_clients_logo_uri_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(logo_uri) <= 2048)" }, { "schema_name": "auth", "table_name": "oauth_clients", "constraint_name": "oauth_clients_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "oauth_clients", "constraint_name": "oauth_clients_token_endpoint_auth_method_check", "constraint_type": "CHECK", "definition": "CHECK (token_endpoint_auth_method = ANY (ARRAY['client_secret_basic'::text, 'client_secret_post'::text, 'none'::text]))" }, { "schema_name": "auth", "table_name": "oauth_consents", "constraint_name": "oauth_consents_client_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (client_id) REFERENCES auth.oauth_clients(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "oauth_consents", "constraint_name": "oauth_consents_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "oauth_consents", "constraint_name": "oauth_consents_revoked_after_granted", "constraint_type": "CHECK", "definition": "CHECK (revoked_at IS NULL OR revoked_at >= granted_at)" }, { "schema_name": "auth", "table_name": "oauth_consents", "constraint_name": "oauth_consents_scopes_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(scopes) <= 2048)" }, { "schema_name": "auth", "table_name": "oauth_consents", "constraint_name": "oauth_consents_scopes_not_empty", "constraint_type": "CHECK", "definition": "CHECK (char_length(TRIM(BOTH FROM scopes)) > 0)" }, { "schema_name": "auth", "table_name": "oauth_consents", "constraint_name": "oauth_consents_user_client_unique", "constraint_type": "UNIQUE", "definition": "UNIQUE (user_id, client_id)" }, { "schema_name": "auth", "table_name": "oauth_consents", "constraint_name": "oauth_consents_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "one_time_tokens", "constraint_name": "one_time_tokens_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "one_time_tokens", "constraint_name": "one_time_tokens_token_hash_check", "constraint_type": "CHECK", "definition": "CHECK (char_length(token_hash) > 0)" }, { "schema_name": "auth", "table_name": "one_time_tokens", "constraint_name": "one_time_tokens_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "refresh_tokens", "constraint_name": "refresh_tokens_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "refresh_tokens", "constraint_name": "refresh_tokens_session_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "refresh_tokens", "constraint_name": "refresh_tokens_token_unique", "constraint_type": "UNIQUE", "definition": "UNIQUE (token)" }, { "schema_name": "auth", "table_name": "saml_providers", "constraint_name": "entity_id not empty", "constraint_type": "CHECK", "definition": "CHECK (char_length(entity_id) > 0)" }, { "schema_name": "auth", "table_name": "saml_providers", "constraint_name": "metadata_url not empty", "constraint_type": "CHECK", "definition": "CHECK (metadata_url = NULL::text OR char_length(metadata_url) > 0)" }, { "schema_name": "auth", "table_name": "saml_providers", "constraint_name": "metadata_xml not empty", "constraint_type": "CHECK", "definition": "CHECK (char_length(metadata_xml) > 0)" }, { "schema_name": "auth", "table_name": "saml_providers", "constraint_name": "saml_providers_entity_id_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (entity_id)" }, { "schema_name": "auth", "table_name": "saml_providers", "constraint_name": "saml_providers_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "saml_providers", "constraint_name": "saml_providers_sso_provider_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "saml_relay_states", "constraint_name": "request_id not empty", "constraint_type": "CHECK", "definition": "CHECK (char_length(request_id) > 0)" }, { "schema_name": "auth", "table_name": "saml_relay_states", "constraint_name": "saml_relay_states_flow_state_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (flow_state_id) REFERENCES auth.flow_state(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "saml_relay_states", "constraint_name": "saml_relay_states_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "saml_relay_states", "constraint_name": "saml_relay_states_sso_provider_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "schema_migrations", "constraint_name": "schema_migrations_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (version)" }, { "schema_name": "auth", "table_name": "sessions", "constraint_name": "sessions_oauth_client_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (oauth_client_id) REFERENCES auth.oauth_clients(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "sessions", "constraint_name": "sessions_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "sessions", "constraint_name": "sessions_scopes_length", "constraint_type": "CHECK", "definition": "CHECK (char_length(scopes) <= 4096)" }, { "schema_name": "auth", "table_name": "sessions", "constraint_name": "sessions_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "sso_domains", "constraint_name": "domain not empty", "constraint_type": "CHECK", "definition": "CHECK (char_length(domain) > 0)" }, { "schema_name": "auth", "table_name": "sso_domains", "constraint_name": "sso_domains_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "sso_domains", "constraint_name": "sso_domains_sso_provider_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE" }, { "schema_name": "auth", "table_name": "sso_providers", "constraint_name": "resource_id not empty", "constraint_type": "CHECK", "definition": "CHECK (resource_id = NULL::text OR char_length(resource_id) > 0)" }, { "schema_name": "auth", "table_name": "sso_providers", "constraint_name": "sso_providers_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "auth", "table_name": "users", "constraint_name": "users_email_change_confirm_status_check", "constraint_type": "CHECK", "definition": "CHECK (email_change_confirm_status >= 0 AND email_change_confirm_status <= 2)" }, { "schema_name": "auth", "table_name": "users", "constraint_name": "users_phone_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (phone)" }, { "schema_name": "auth", "table_name": "users", "constraint_name": "users_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "public", "table_name": "car_reports", "constraint_name": "car_reports_hotwheels_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (hotwheels_id) REFERENCES hotwheels(id) ON DELETE SET NULL" }, { "schema_name": "public", "table_name": "car_reports", "constraint_name": "car_reports_hw_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (hw_id) REFERENCES global_cars(hw_id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "car_reports", "constraint_name": "car_reports_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "public", "table_name": "car_reports", "constraint_name": "car_reports_reporter_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (reporter_user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "car_reports", "constraint_name": "car_reports_status_check", "constraint_type": "CHECK", "definition": "CHECK (status = ANY (ARRAY['open'::text, 'reviewed'::text, 'resolved'::text, 'dismissed'::text]))" }, { "schema_name": "public", "table_name": "car_votes", "constraint_name": "car_votes_hw_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (hw_id) REFERENCES global_cars(hw_id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "car_votes", "constraint_name": "car_votes_hw_id_user_id_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (hw_id, user_id)" }, { "schema_name": "public", "table_name": "car_votes", "constraint_name": "car_votes_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "public", "table_name": "car_votes", "constraint_name": "car_votes_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "car_votes", "constraint_name": "unique_user_vote", "constraint_type": "UNIQUE", "definition": "UNIQUE (hw_id, user_id)" }, { "schema_name": "public", "table_name": "collection_members", "constraint_name": "collection_members_collection_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (collection_id) REFERENCES collections(id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "collection_members", "constraint_name": "collection_members_collection_id_user_id_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (collection_id, user_id)" }, { "schema_name": "public", "table_name": "collection_members", "constraint_name": "collection_members_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "public", "table_name": "collection_members", "constraint_name": "collection_members_role_check", "constraint_type": "CHECK", "definition": "CHECK (role = ANY (ARRAY['owner'::text, 'member'::text, 'viewer'::text]))" }, { "schema_name": "public", "table_name": "collection_members", "constraint_name": "collection_members_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "collections", "constraint_name": "collections_owner_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (owner_id) REFERENCES auth.users(id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "collections", "constraint_name": "collections_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "public", "table_name": "global_cars", "constraint_name": "global_cars_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (hw_id)" }, { "schema_name": "public", "table_name": "hotwheels", "constraint_name": "cars_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "public", "table_name": "hotwheels", "constraint_name": "fk_hotwheels_global", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (hw_id) REFERENCES global_cars(hw_id) ON DELETE RESTRICT" }, { "schema_name": "public", "table_name": "hotwheels", "constraint_name": "hotwheels_collection_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (collection_id) REFERENCES collections(id) ON DELETE CASCADE" }, { "schema_name": "public", "table_name": "hotwheels", "constraint_name": "hotwheels_hw_id_collection_unique", "constraint_type": "UNIQUE", "definition": "UNIQUE (hw_id, collection_id)" }, { "schema_name": "public", "table_name": "hotwheels", "constraint_name": "hotwheels_user_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (user_id) REFERENCES auth.users(id) ON UPDATE CASCADE ON DELETE SET NULL" }, { "schema_name": "realtime", "table_name": "messages", "constraint_name": "messages_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id, inserted_at)" }, { "schema_name": "realtime", "table_name": "schema_migrations", "constraint_name": "schema_migrations_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (version)" }, { "schema_name": "realtime", "table_name": "subscription", "constraint_name": "pk_subscription", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "realtime", "table_name": "subscription", "constraint_name": "subscription_action_filter_check", "constraint_type": "CHECK", "definition": "CHECK (action_filter = ANY (ARRAY['*'::text, 'INSERT'::text, 'UPDATE'::text, 'DELETE'::text]))" }, { "schema_name": "storage", "table_name": "buckets", "constraint_name": "buckets_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "storage", "table_name": "buckets_analytics", "constraint_name": "buckets_analytics_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "storage", "table_name": "buckets_vectors", "constraint_name": "buckets_vectors_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "storage", "table_name": "migrations", "constraint_name": "migrations_name_key", "constraint_type": "UNIQUE", "definition": "UNIQUE (name)" }, { "schema_name": "storage", "table_name": "migrations", "constraint_name": "migrations_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "storage", "table_name": "objects", "constraint_name": "objects_bucketId_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id)" }, { "schema_name": "storage", "table_name": "objects", "constraint_name": "objects_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "storage", "table_name": "s3_multipart_uploads", "constraint_name": "s3_multipart_uploads_bucket_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id)" }, { "schema_name": "storage", "table_name": "s3_multipart_uploads", "constraint_name": "s3_multipart_uploads_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "storage", "table_name": "s3_multipart_uploads_parts", "constraint_name": "s3_multipart_uploads_parts_bucket_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id)" }, { "schema_name": "storage", "table_name": "s3_multipart_uploads_parts", "constraint_name": "s3_multipart_uploads_parts_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "storage", "table_name": "s3_multipart_uploads_parts", "constraint_name": "s3_multipart_uploads_parts_upload_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (upload_id) REFERENCES storage.s3_multipart_uploads(id) ON DELETE CASCADE" }, { "schema_name": "storage", "table_name": "vector_indexes", "constraint_name": "vector_indexes_bucket_id_fkey", "constraint_type": "FOREIGN KEY", "definition": "FOREIGN KEY (bucket_id) REFERENCES storage.buckets_vectors(id)" }, { "schema_name": "storage", "table_name": "vector_indexes", "constraint_name": "vector_indexes_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" }, { "schema_name": "vault", "table_name": "secrets", "constraint_name": "secrets_pkey", "constraint_type": "PRIMARY KEY", "definition": "PRIMARY KEY (id)" } ]

[ { "schemaname": "auth", "tablename": "audit_log_entries", "indexname": "audit_log_entries_pkey", "indexdef": "CREATE UNIQUE INDEX audit_log_entries_pkey ON auth.audit_log_entries USING btree (id)" }, { "schemaname": "auth", "tablename": "audit_log_entries", "indexname": "audit_logs_instance_id_idx", "indexdef": "CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id)" }, { "schemaname": "auth", "tablename": "custom_oauth_providers", "indexname": "custom_oauth_providers_created_at_idx", "indexdef": "CREATE INDEX custom_oauth_providers_created_at_idx ON auth.custom_oauth_providers USING btree (created_at)" }, { "schemaname": "auth", "tablename": "custom_oauth_providers", "indexname": "custom_oauth_providers_enabled_idx", "indexdef": "CREATE INDEX custom_oauth_providers_enabled_idx ON auth.custom_oauth_providers USING btree (enabled)" }, { "schemaname": "auth", "tablename": "custom_oauth_providers", "indexname": "custom_oauth_providers_identifier_idx", "indexdef": "CREATE INDEX custom_oauth_providers_identifier_idx ON auth.custom_oauth_providers USING btree (identifier)" }, { "schemaname": "auth", "tablename": "custom_oauth_providers", "indexname": "custom_oauth_providers_identifier_key", "indexdef": "CREATE UNIQUE INDEX custom_oauth_providers_identifier_key ON auth.custom_oauth_providers USING btree (identifier)" }, { "schemaname": "auth", "tablename": "custom_oauth_providers", "indexname": "custom_oauth_providers_pkey", "indexdef": "CREATE UNIQUE INDEX custom_oauth_providers_pkey ON auth.custom_oauth_providers USING btree (id)" }, { "schemaname": "auth", "tablename": "custom_oauth_providers", "indexname": "custom_oauth_providers_provider_type_idx", "indexdef": "CREATE INDEX custom_oauth_providers_provider_type_idx ON auth.custom_oauth_providers USING btree (provider_type)" }, { "schemaname": "auth", "tablename": "flow_state", "indexname": "flow_state_created_at_idx", "indexdef": "CREATE INDEX flow_state_created_at_idx ON auth.flow_state USING btree (created_at DESC)" }, { "schemaname": "auth", "tablename": "flow_state", "indexname": "flow_state_pkey", "indexdef": "CREATE UNIQUE INDEX flow_state_pkey ON auth.flow_state USING btree (id)" }, { "schemaname": "auth", "tablename": "flow_state", "indexname": "idx_auth_code", "indexdef": "CREATE INDEX idx_auth_code ON auth.flow_state USING btree (auth_code)" }, { "schemaname": "auth", "tablename": "flow_state", "indexname": "idx_user_id_auth_method", "indexdef": "CREATE INDEX idx_user_id_auth_method ON auth.flow_state USING btree (user_id, authentication_method)" }, { "schemaname": "auth", "tablename": "identities", "indexname": "identities_email_idx", "indexdef": "CREATE INDEX identities_email_idx ON auth.identities USING btree (email text_pattern_ops)" }, { "schemaname": "auth", "tablename": "identities", "indexname": "identities_pkey", "indexdef": "CREATE UNIQUE INDEX identities_pkey ON auth.identities USING btree (id)" }, { "schemaname": "auth", "tablename": "identities", "indexname": "identities_provider_id_provider_unique", "indexdef": "CREATE UNIQUE INDEX identities_provider_id_provider_unique ON auth.identities USING btree (provider_id, provider)" }, { "schemaname": "auth", "tablename": "identities", "indexname": "identities_user_id_idx", "indexdef": "CREATE INDEX identities_user_id_idx ON auth.identities USING btree (user_id)" }, { "schemaname": "auth", "tablename": "instances", "indexname": "instances_pkey", "indexdef": "CREATE UNIQUE INDEX instances_pkey ON auth.instances USING btree (id)" }, { "schemaname": "auth", "tablename": "mfa_amr_claims", "indexname": "amr_id_pk", "indexdef": "CREATE UNIQUE INDEX amr_id_pk ON auth.mfa_amr_claims USING btree (id)" }, { "schemaname": "auth", "tablename": "mfa_amr_claims", "indexname": "mfa_amr_claims_session_id_authentication_method_pkey", "indexdef": "CREATE UNIQUE INDEX mfa_amr_claims_session_id_authentication_method_pkey ON auth.mfa_amr_claims USING btree (session_id, authentication_method)" }, { "schemaname": "auth", "tablename": "mfa_challenges", "indexname": "mfa_challenge_created_at_idx", "indexdef": "CREATE INDEX mfa_challenge_created_at_idx ON auth.mfa_challenges USING btree (created_at DESC)" }, { "schemaname": "auth", "tablename": "mfa_challenges", "indexname": "mfa_challenges_pkey", "indexdef": "CREATE UNIQUE INDEX mfa_challenges_pkey ON auth.mfa_challenges USING btree (id)" }, { "schemaname": "auth", "tablename": "mfa_factors", "indexname": "factor_id_created_at_idx", "indexdef": "CREATE INDEX factor_id_created_at_idx ON auth.mfa_factors USING btree (user_id, created_at)" }, { "schemaname": "auth", "tablename": "mfa_factors", "indexname": "mfa_factors_last_challenged_at_key", "indexdef": "CREATE UNIQUE INDEX mfa_factors_last_challenged_at_key ON auth.mfa_factors USING btree (last_challenged_at)" }, { "schemaname": "auth", "tablename": "mfa_factors", "indexname": "mfa_factors_pkey", "indexdef": "CREATE UNIQUE INDEX mfa_factors_pkey ON auth.mfa_factors USING btree (id)" }, { "schemaname": "auth", "tablename": "mfa_factors", "indexname": "mfa_factors_user_friendly_name_unique", "indexdef": "CREATE UNIQUE INDEX mfa_factors_user_friendly_name_unique ON auth.mfa_factors USING btree (friendly_name, user_id) WHERE (TRIM(BOTH FROM friendly_name) <> ''::text)" }, { "schemaname": "auth", "tablename": "mfa_factors", "indexname": "mfa_factors_user_id_idx", "indexdef": "CREATE INDEX mfa_factors_user_id_idx ON auth.mfa_factors USING btree (user_id)" }, { "schemaname": "auth", "tablename": "mfa_factors", "indexname": "unique_phone_factor_per_user", "indexdef": "CREATE UNIQUE INDEX unique_phone_factor_per_user ON auth.mfa_factors USING btree (user_id, phone)" }, { "schemaname": "auth", "tablename": "oauth_authorizations", "indexname": "oauth_auth_pending_exp_idx", "indexdef": "CREATE INDEX oauth_auth_pending_exp_idx ON auth.oauth_authorizations USING btree (expires_at) WHERE (status = 'pending'::auth.oauth_authorization_status)" }, { "schemaname": "auth", "tablename": "oauth_authorizations", "indexname": "oauth_authorizations_authorization_code_key", "indexdef": "CREATE UNIQUE INDEX oauth_authorizations_authorization_code_key ON auth.oauth_authorizations USING btree (authorization_code)" }, { "schemaname": "auth", "tablename": "oauth_authorizations", "indexname": "oauth_authorizations_authorization_id_key", "indexdef": "CREATE UNIQUE INDEX oauth_authorizations_authorization_id_key ON auth.oauth_authorizations USING btree (authorization_id)" }, { "schemaname": "auth", "tablename": "oauth_authorizations", "indexname": "oauth_authorizations_pkey", "indexdef": "CREATE UNIQUE INDEX oauth_authorizations_pkey ON auth.oauth_authorizations USING btree (id)" }, { "schemaname": "auth", "tablename": "oauth_client_states", "indexname": "idx_oauth_client_states_created_at", "indexdef": "CREATE INDEX idx_oauth_client_states_created_at ON auth.oauth_client_states USING btree (created_at)" }, { "schemaname": "auth", "tablename": "oauth_client_states", "indexname": "oauth_client_states_pkey", "indexdef": "CREATE UNIQUE INDEX oauth_client_states_pkey ON auth.oauth_client_states USING btree (id)" }, { "schemaname": "auth", "tablename": "oauth_clients", "indexname": "oauth_clients_deleted_at_idx", "indexdef": "CREATE INDEX oauth_clients_deleted_at_idx ON auth.oauth_clients USING btree (deleted_at)" }, { "schemaname": "auth", "tablename": "oauth_clients", "indexname": "oauth_clients_pkey", "indexdef": "CREATE UNIQUE INDEX oauth_clients_pkey ON auth.oauth_clients USING btree (id)" }, { "schemaname": "auth", "tablename": "oauth_consents", "indexname": "oauth_consents_active_client_idx", "indexdef": "CREATE INDEX oauth_consents_active_client_idx ON auth.oauth_consents USING btree (client_id) WHERE (revoked_at IS NULL)" }, { "schemaname": "auth", "tablename": "oauth_consents", "indexname": "oauth_consents_active_user_client_idx", "indexdef": "CREATE INDEX oauth_consents_active_user_client_idx ON auth.oauth_consents USING btree (user_id, client_id) WHERE (revoked_at IS NULL)" }, { "schemaname": "auth", "tablename": "oauth_consents", "indexname": "oauth_consents_pkey", "indexdef": "CREATE UNIQUE INDEX oauth_consents_pkey ON auth.oauth_consents USING btree (id)" }, { "schemaname": "auth", "tablename": "oauth_consents", "indexname": "oauth_consents_user_client_unique", "indexdef": "CREATE UNIQUE INDEX oauth_consents_user_client_unique ON auth.oauth_consents USING btree (user_id, client_id)" }, { "schemaname": "auth", "tablename": "oauth_consents", "indexname": "oauth_consents_user_order_idx", "indexdef": "CREATE INDEX oauth_consents_user_order_idx ON auth.oauth_consents USING btree (user_id, granted_at DESC)" }, { "schemaname": "auth", "tablename": "one_time_tokens", "indexname": "one_time_tokens_pkey", "indexdef": "CREATE UNIQUE INDEX one_time_tokens_pkey ON auth.one_time_tokens USING btree (id)" }, { "schemaname": "auth", "tablename": "one_time_tokens", "indexname": "one_time_tokens_relates_to_hash_idx", "indexdef": "CREATE INDEX one_time_tokens_relates_to_hash_idx ON auth.one_time_tokens USING hash (relates_to)" }, { "schemaname": "auth", "tablename": "one_time_tokens", "indexname": "one_time_tokens_token_hash_hash_idx", "indexdef": "CREATE INDEX one_time_tokens_token_hash_hash_idx ON auth.one_time_tokens USING hash (token_hash)" }, { "schemaname": "auth", "tablename": "one_time_tokens", "indexname": "one_time_tokens_user_id_token_type_key", "indexdef": "CREATE UNIQUE INDEX one_time_tokens_user_id_token_type_key ON auth.one_time_tokens USING btree (user_id, token_type)" }, { "schemaname": "auth", "tablename": "refresh_tokens", "indexname": "refresh_tokens_instance_id_idx", "indexdef": "CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id)" }, { "schemaname": "auth", "tablename": "refresh_tokens", "indexname": "refresh_tokens_instance_id_user_id_idx", "indexdef": "CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id)" }, { "schemaname": "auth", "tablename": "refresh_tokens", "indexname": "refresh_tokens_parent_idx", "indexdef": "CREATE INDEX refresh_tokens_parent_idx ON auth.refresh_tokens USING btree (parent)" }, { "schemaname": "auth", "tablename": "refresh_tokens", "indexname": "refresh_tokens_pkey", "indexdef": "CREATE UNIQUE INDEX refresh_tokens_pkey ON auth.refresh_tokens USING btree (id)" }, { "schemaname": "auth", "tablename": "refresh_tokens", "indexname": "refresh_tokens_session_id_revoked_idx", "indexdef": "CREATE INDEX refresh_tokens_session_id_revoked_idx ON auth.refresh_tokens USING btree (session_id, revoked)" }, { "schemaname": "auth", "tablename": "refresh_tokens", "indexname": "refresh_tokens_token_unique", "indexdef": "CREATE UNIQUE INDEX refresh_tokens_token_unique ON auth.refresh_tokens USING btree (token)" }, { "schemaname": "auth", "tablename": "refresh_tokens", "indexname": "refresh_tokens_updated_at_idx", "indexdef": "CREATE INDEX refresh_tokens_updated_at_idx ON auth.refresh_tokens USING btree (updated_at DESC)" }, { "schemaname": "auth", "tablename": "saml_providers", "indexname": "saml_providers_entity_id_key", "indexdef": "CREATE UNIQUE INDEX saml_providers_entity_id_key ON auth.saml_providers USING btree (entity_id)" }, { "schemaname": "auth", "tablename": "saml_providers", "indexname": "saml_providers_pkey", "indexdef": "CREATE UNIQUE INDEX saml_providers_pkey ON auth.saml_providers USING btree (id)" }, { "schemaname": "auth", "tablename": "saml_providers", "indexname": "saml_providers_sso_provider_id_idx", "indexdef": "CREATE INDEX saml_providers_sso_provider_id_idx ON auth.saml_providers USING btree (sso_provider_id)" }, { "schemaname": "auth", "tablename": "saml_relay_states", "indexname": "saml_relay_states_created_at_idx", "indexdef": "CREATE INDEX saml_relay_states_created_at_idx ON auth.saml_relay_states USING btree (created_at DESC)" }, { "schemaname": "auth", "tablename": "saml_relay_states", "indexname": "saml_relay_states_for_email_idx", "indexdef": "CREATE INDEX saml_relay_states_for_email_idx ON auth.saml_relay_states USING btree (for_email)" }, { "schemaname": "auth", "tablename": "saml_relay_states", "indexname": "saml_relay_states_pkey", "indexdef": "CREATE UNIQUE INDEX saml_relay_states_pkey ON auth.saml_relay_states USING btree (id)" }, { "schemaname": "auth", "tablename": "saml_relay_states", "indexname": "saml_relay_states_sso_provider_id_idx", "indexdef": "CREATE INDEX saml_relay_states_sso_provider_id_idx ON auth.saml_relay_states USING btree (sso_provider_id)" }, { "schemaname": "auth", "tablename": "schema_migrations", "indexname": "schema_migrations_pkey", "indexdef": "CREATE UNIQUE INDEX schema_migrations_pkey ON auth.schema_migrations USING btree (version)" }, { "schemaname": "auth", "tablename": "sessions", "indexname": "sessions_not_after_idx", "indexdef": "CREATE INDEX sessions_not_after_idx ON auth.sessions USING btree (not_after DESC)" }, { "schemaname": "auth", "tablename": "sessions", "indexname": "sessions_oauth_client_id_idx", "indexdef": "CREATE INDEX sessions_oauth_client_id_idx ON auth.sessions USING btree (oauth_client_id)" }, { "schemaname": "auth", "tablename": "sessions", "indexname": "sessions_pkey", "indexdef": "CREATE UNIQUE INDEX sessions_pkey ON auth.sessions USING btree (id)" }, { "schemaname": "auth", "tablename": "sessions", "indexname": "sessions_user_id_idx", "indexdef": "CREATE INDEX sessions_user_id_idx ON auth.sessions USING btree (user_id)" }, { "schemaname": "auth", "tablename": "sessions", "indexname": "user_id_created_at_idx", "indexdef": "CREATE INDEX user_id_created_at_idx ON auth.sessions USING btree (user_id, created_at)" }, { "schemaname": "auth", "tablename": "sso_domains", "indexname": "sso_domains_domain_idx", "indexdef": "CREATE UNIQUE INDEX sso_domains_domain_idx ON auth.sso_domains USING btree (lower(domain))" }, { "schemaname": "auth", "tablename": "sso_domains", "indexname": "sso_domains_pkey", "indexdef": "CREATE UNIQUE INDEX sso_domains_pkey ON auth.sso_domains USING btree (id)" }, { "schemaname": "auth", "tablename": "sso_domains", "indexname": "sso_domains_sso_provider_id_idx", "indexdef": "CREATE INDEX sso_domains_sso_provider_id_idx ON auth.sso_domains USING btree (sso_provider_id)" }, { "schemaname": "auth", "tablename": "sso_providers", "indexname": "sso_providers_pkey", "indexdef": "CREATE UNIQUE INDEX sso_providers_pkey ON auth.sso_providers USING btree (id)" }, { "schemaname": "auth", "tablename": "sso_providers", "indexname": "sso_providers_resource_id_idx", "indexdef": "CREATE UNIQUE INDEX sso_providers_resource_id_idx ON auth.sso_providers USING btree (lower(resource_id))" }, { "schemaname": "auth", "tablename": "sso_providers", "indexname": "sso_providers_resource_id_pattern_idx", "indexdef": "CREATE INDEX sso_providers_resource_id_pattern_idx ON auth.sso_providers USING btree (resource_id text_pattern_ops)" }, { "schemaname": "auth", "tablename": "users", "indexname": "confirmation_token_idx", "indexdef": "CREATE UNIQUE INDEX confirmation_token_idx ON auth.users USING btree (confirmation_token) WHERE ((confirmation_token)::text !~ '^[0-9 ]$'::text)" }, { "schemaname": "auth", "tablename": "users", "indexname": "email_change_token_current_idx", "indexdef": "CREATE UNIQUE INDEX email_change_token_current_idx ON auth.users USING btree (email_change_token_current) WHERE ((email_change_token_current)::text !~ '^[0-9 ]$'::text)" }, { "schemaname": "auth", "tablename": "users", "indexname": "email_change_token_new_idx", "indexdef": "CREATE UNIQUE INDEX email_change_token_new_idx ON auth.users USING btree (email_change_token_new) WHERE ((email_change_token_new)::text !~ '^[0-9 ]$'::text)" }, { "schemaname": "auth", "tablename": "users", "indexname": "reauthentication_token_idx", "indexdef": "CREATE UNIQUE INDEX reauthentication_token_idx ON auth.users USING btree (reauthentication_token) WHERE ((reauthentication_token)::text !~ '^[0-9 ]$'::text)" }, { "schemaname": "auth", "tablename": "users", "indexname": "recovery_token_idx", "indexdef": "CREATE UNIQUE INDEX recovery_token_idx ON auth.users USING btree (recovery_token) WHERE ((recovery_token)::text !~ '^[0-9 ]*$'::text)" }, { "schemaname": "auth", "tablename": "users", "indexname": "users_email_partial_key", "indexdef": "CREATE UNIQUE INDEX users_email_partial_key ON auth.users USING btree (email) WHERE (is_sso_user = false)" }, { "schemaname": "auth", "tablename": "users", "indexname": "users_instance_id_email_idx", "indexdef": "CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, lower((email)::text))" }, { "schemaname": "auth", "tablename": "users", "indexname": "users_instance_id_idx", "indexdef": "CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id)" }, { "schemaname": "auth", "tablename": "users", "indexname": "users_is_anonymous_idx", "indexdef": "CREATE INDEX users_is_anonymous_idx ON auth.users USING btree (is_anonymous)" }, { "schemaname": "auth", "tablename": "users", "indexname": "users_phone_key", "indexdef": "CREATE UNIQUE INDEX users_phone_key ON auth.users USING btree (phone)" }, { "schemaname": "auth", "tablename": "users", "indexname": "users_pkey", "indexdef": "CREATE UNIQUE INDEX users_pkey ON auth.users USING btree (id)" }, { "schemaname": "public", "tablename": "car_reports", "indexname": "car_reports_pkey", "indexdef": "CREATE UNIQUE INDEX car_reports_pkey ON public.car_reports USING btree (id)" }, { "schemaname": "public", "tablename": "car_votes", "indexname": "car_votes_hw_id_user_id_key", "indexdef": "CREATE UNIQUE INDEX car_votes_hw_id_user_id_key ON public.car_votes USING btree (hw_id, user_id)" }, { "schemaname": "public", "tablename": "car_votes", "indexname": "car_votes_pkey", "indexdef": "CREATE UNIQUE INDEX car_votes_pkey ON public.car_votes USING btree (id)" }, { "schemaname": "public", "tablename": "car_votes", "indexname": "unique_user_vote", "indexdef": "CREATE UNIQUE INDEX unique_user_vote ON public.car_votes USING btree (hw_id, user_id)" }, { "schemaname": "public", "tablename": "collection_members", "indexname": "collection_members_collection_id_user_id_key", "indexdef": "CREATE UNIQUE INDEX collection_members_collection_id_user_id_key ON public.collection_members USING btree (collection_id, user_id)" }, { "schemaname": "public", "tablename": "collection_members", "indexname": "collection_members_pkey", "indexdef": "CREATE UNIQUE INDEX collection_members_pkey ON public.collection_members USING btree (id)" }, { "schemaname": "public", "tablename": "collections", "indexname": "collections_pkey", "indexdef": "CREATE UNIQUE INDEX collections_pkey ON public.collections USING btree (id)" }, { "schemaname": "public", "tablename": "global_cars", "indexname": "global_cars_pkey", "indexdef": "CREATE UNIQUE INDEX global_cars_pkey ON public.global_cars USING btree (hw_id)" }, { "schemaname": "public", "tablename": "hotwheels", "indexname": "cars_pkey", "indexdef": "CREATE UNIQUE INDEX cars_pkey ON public.hotwheels USING btree (id)" }, { "schemaname": "public", "tablename": "hotwheels", "indexname": "hotwheels_hw_id_collection_unique", "indexdef": "CREATE UNIQUE INDEX hotwheels_hw_id_collection_unique ON public.hotwheels USING btree (hw_id, collection_id)" }, { "schemaname": "realtime", "tablename": "messages", "indexname": "messages_inserted_at_topic_index", "indexdef": "CREATE INDEX messages_inserted_at_topic_index ON ONLY realtime.messages USING btree (inserted_at DESC, topic) WHERE ((extension = 'broadcast'::text) AND (private IS TRUE))" }, { "schemaname": "realtime", "tablename": "messages", "indexname": "messages_pkey", "indexdef": "CREATE UNIQUE INDEX messages_pkey ON ONLY realtime.messages USING btree (id, inserted_at)" }, { "schemaname": "realtime", "tablename": "schema_migrations", "indexname": "schema_migrations_pkey", "indexdef": "CREATE UNIQUE INDEX schema_migrations_pkey ON realtime.schema_migrations USING btree (version)" }, { "schemaname": "realtime", "tablename": "subscription", "indexname": "ix_realtime_subscription_entity", "indexdef": "CREATE INDEX ix_realtime_subscription_entity ON realtime.subscription USING btree (entity)" }, { "schemaname": "realtime", "tablename": "subscription", "indexname": "pk_subscription", "indexdef": "CREATE UNIQUE INDEX pk_subscription ON realtime.subscription USING btree (id)" }, { "schemaname": "realtime", "tablename": "subscription", "indexname": "subscription_subscription_id_entity_filters_action_filter_key", "indexdef": "CREATE UNIQUE INDEX subscription_subscription_id_entity_filters_action_filter_key ON realtime.subscription USING btree (subscription_id, entity, filters, action_filter)" }, { "schemaname": "storage", "tablename": "buckets", "indexname": "bname", "indexdef": "CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name)" }, { "schemaname": "storage", "tablename": "buckets", "indexname": "buckets_pkey", "indexdef": "CREATE UNIQUE INDEX buckets_pkey ON storage.buckets USING btree (id)" }, { "schemaname": "storage", "tablename": "buckets_analytics", "indexname": "buckets_analytics_pkey", "indexdef": "CREATE UNIQUE INDEX buckets_analytics_pkey ON storage.buckets_analytics USING btree (id)" }, { "schemaname": "storage", "tablename": "buckets_analytics", "indexname": "buckets_analytics_unique_name_idx", "indexdef": "CREATE UNIQUE INDEX buckets_analytics_unique_name_idx ON storage.buckets_analytics USING btree (name) WHERE (deleted_at IS NULL)" }, { "schemaname": "storage", "tablename": "buckets_vectors", "indexname": "buckets_vectors_pkey", "indexdef": "CREATE UNIQUE INDEX buckets_vectors_pkey ON storage.buckets_vectors USING btree (id)" }, { "schemaname": "storage", "tablename": "migrations", "indexname": "migrations_name_key", "indexdef": "CREATE UNIQUE INDEX migrations_name_key ON storage.migrations USING btree (name)" }, { "schemaname": "storage", "tablename": "migrations", "indexname": "migrations_pkey", "indexdef": "CREATE UNIQUE INDEX migrations_pkey ON storage.migrations USING btree (id)" }, { "schemaname": "storage", "tablename": "objects", "indexname": "bucketid_objname", "indexdef": "CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name)" }, { "schemaname": "storage", "tablename": "objects", "indexname": "idx_objects_bucket_id_name", "indexdef": "CREATE INDEX idx_objects_bucket_id_name ON storage.objects USING btree (bucket_id, name COLLATE "C")" }, { "schemaname": "storage", "tablename": "objects", "indexname": "idx_objects_bucket_id_name_lower", "indexdef": "CREATE INDEX idx_objects_bucket_id_name_lower ON storage.objects USING btree (bucket_id, lower(name) COLLATE "C")" }, { "schemaname": "storage", "tablename": "objects", "indexname": "name_prefix_search", "indexdef": "CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops)" }, { "schemaname": "storage", "tablename": "objects", "indexname": "objects_pkey", "indexdef": "CREATE UNIQUE INDEX objects_pkey ON storage.objects USING btree (id)" }, { "schemaname": "storage", "tablename": "s3_multipart_uploads", "indexname": "idx_multipart_uploads_list", "indexdef": "CREATE INDEX idx_multipart_uploads_list ON storage.s3_multipart_uploads USING btree (bucket_id, key, created_at)" }, { "schemaname": "storage", "tablename": "s3_multipart_uploads", "indexname": "s3_multipart_uploads_pkey", "indexdef": "CREATE UNIQUE INDEX s3_multipart_uploads_pkey ON storage.s3_multipart_uploads USING btree (id)" }, { "schemaname": "storage", "tablename": "s3_multipart_uploads_parts", "indexname": "s3_multipart_uploads_parts_pkey", "indexdef": "CREATE UNIQUE INDEX s3_multipart_uploads_parts_pkey ON storage.s3_multipart_uploads_parts USING btree (id)" }, { "schemaname": "storage", "tablename": "vector_indexes", "indexname": "vector_indexes_name_bucket_id_idx", "indexdef": "CREATE UNIQUE INDEX vector_indexes_name_bucket_id_idx ON storage.vector_indexes USING btree (name, bucket_id)" }, { "schemaname": "storage", "tablename": "vector_indexes", "indexname": "vector_indexes_pkey", "indexdef": "CREATE UNIQUE INDEX vector_indexes_pkey ON storage.vector_indexes USING btree (id)" }, { "schemaname": "vault", "tablename": "secrets", "indexname": "secrets_name_idx", "indexdef": "CREATE UNIQUE INDEX secrets_name_idx ON vault.secrets USING btree (name) WHERE (name IS NOT NULL)" }, { "schemaname": "vault", "tablename": "secrets", "indexname": "secrets_pkey", "indexdef": "CREATE UNIQUE INDEX secrets_pkey ON vault.secrets USING btree (id)" } ]

[ { "schema_name": "extensions", "view_name": "hypopg_hidden_indexes", "view_type": "VIEW", "definition": " SELECT h.indexid AS indexrelid,\n i.relname AS index_name,\n n.nspname AS schema_name,\n t.relname AS table_name,\n m.amname AS am_name,\n false AS is_hypo\n FROM hypopg_hidden_indexes() h(indexid)\n JOIN pg_index x ON x.indexrelid = h.indexid\n JOIN pg_class i ON i.oid = h.indexid\n JOIN pg_namespace n ON n.oid = i.relnamespace\n JOIN pg_class t ON t.oid = x.indrelid\n JOIN pg_am m ON m.oid = i.relam\nUNION ALL\n SELECT hl.indexrelid,\n hl.index_name,\n hl.schema_name,\n hl.table_name,\n hl.am_name,\n true AS is_hypo\n FROM hypopg_hidden_indexes() hi(indexid)\n JOIN hypopg_list_indexes hl ON hl.indexrelid = hi.indexid\n ORDER BY 2;" }, { "schema_name": "extensions", "view_name": "hypopg_list_indexes", "view_type": "VIEW", "definition": " SELECT h.indexrelid,\n h.indexname AS index_name,\n n.nspname AS schema_name,\n COALESCE(c.relname, ''::name) AS table_name,\n am.amname AS am_name\n FROM hypopg() h(indexname, indexrelid, indrelid, innatts, indisunique, indkey, indcollation, indclass, indoption, indexprs, indpred, amid)\n LEFT JOIN pg_class c ON c.oid = h.indrelid\n LEFT JOIN pg_namespace n ON n.oid = c.relnamespace\n LEFT JOIN pg_am am ON am.oid = h.amid;" }, { "schema_name": "extensions", "view_name": "pg_stat_statements", "view_type": "VIEW", "definition": " SELECT userid,\n dbid,\n toplevel,\n queryid,\n query,\n plans,\n total_plan_time,\n min_plan_time,\n max_plan_time,\n mean_plan_time,\n stddev_plan_time,\n calls,\n total_exec_time,\n min_exec_time,\n max_exec_time,\n mean_exec_time,\n stddev_exec_time,\n rows,\n shared_blks_hit,\n shared_blks_read,\n shared_blks_dirtied,\n shared_blks_written,\n local_blks_hit,\n local_blks_read,\n local_blks_dirtied,\n local_blks_written,\n temp_blks_read,\n temp_blks_written,\n shared_blk_read_time,\n shared_blk_write_time,\n local_blk_read_time,\n local_blk_write_time,\n temp_blk_read_time,\n temp_blk_write_time,\n wal_records,\n wal_fpi,\n wal_bytes,\n jit_functions,\n jit_generation_time,\n jit_inlining_count,\n jit_inlining_time,\n jit_optimization_count,\n jit_optimization_time,\n jit_emission_count,\n jit_emission_time,\n jit_deform_count,\n jit_deform_time,\n stats_since,\n minmax_stats_since\n FROM pg_stat_statements(true) pg_stat_statements(userid, dbid, toplevel, queryid, query, plans, total_plan_time, min_plan_time, max_plan_time, mean_plan_time, stddev_plan_time, calls, total_exec_time, min_exec_time, max_exec_time, mean_exec_time, stddev_exec_time, rows, shared_blks_hit, shared_blks_read, shared_blks_dirtied, shared_blks_written, local_blks_hit, local_blks_read, local_blks_dirtied, local_blks_written, temp_blks_read, temp_blks_written, shared_blk_read_time, shared_blk_write_time, local_blk_read_time, local_blk_write_time, temp_blk_read_time, temp_blk_write_time, wal_records, wal_fpi, wal_bytes, jit_functions, jit_generation_time, jit_inlining_count, jit_inlining_time, jit_optimization_count, jit_optimization_time, jit_emission_count, jit_emission_time, jit_deform_count, jit_deform_time, stats_since, minmax_stats_since);" }, { "schema_name": "extensions", "view_name": "pg_stat_statements_info", "view_type": "VIEW", "definition": " SELECT dealloc,\n stats_reset\n FROM pg_stat_statements_info() pg_stat_statements_info(dealloc, stats_reset);" }, { "schema_name": "vault", "view_name": "decrypted_secrets", "view_type": "VIEW", "definition": " SELECT id,\n name,\n description,\n secret,\n convert_from(vault._crypto_aead_det_decrypt(message => decode(secret, 'base64'::text), additional => convert_to(id::text, 'utf8'::name), key_id => 0::bigint, context => '\x7067736f6469756d'::bytea, nonce => nonce), 'utf8'::name) AS decrypted_secret,\n key_id,\n nonce,\n created_at,\n updated_at\n FROM vault.secrets s;" } ]

[ { "schema_name": "auth", "routine_name": "email", "routine_type": "FUNCTION", "language": "sql", "args": "", "definition": "CREATE OR REPLACE FUNCTION auth.email()\n RETURNS text\n LANGUAGE sql\n STABLE\nAS $function$\n select \n coalesce(\n nullif(current_setting('request.jwt.claim.email', true), ''),\n (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'email')\n )::text\n$function$\n" }, { "schema_name": "auth", "routine_name": "jwt", "routine_type": "FUNCTION", "language": "sql", "args": "", "definition": "CREATE OR REPLACE FUNCTION auth.jwt()\n RETURNS jsonb\n LANGUAGE sql\n STABLE\nAS $function$\n select \n coalesce(\n nullif(current_setting('request.jwt.claim', true), ''),\n nullif(current_setting('request.jwt.claims', true), '')\n )::jsonb\n$function$\n" }, { "schema_name": "auth", "routine_name": "role", "routine_type": "FUNCTION", "language": "sql", "args": "", "definition": "CREATE OR REPLACE FUNCTION auth.role()\n RETURNS text\n LANGUAGE sql\n STABLE\nAS $function$\n select \n coalesce(\n nullif(current_setting('request.jwt.claim.role', true), ''),\n (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'role')\n )::text\n$function$\n" }, { "schema_name": "auth", "routine_name": "uid", "routine_type": "FUNCTION", "language": "sql", "args": "", "definition": "CREATE OR REPLACE FUNCTION auth.uid()\n RETURNS uuid\n LANGUAGE sql\n STABLE\nAS $function$\n select \n coalesce(\n nullif(current_setting('request.jwt.claim.sub', true), ''),\n (nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'sub')\n )::uuid\n$function$\n" }, { "schema_name": "extensions", "routine_name": "armor", "routine_type": "FUNCTION", "language": "c", "args": "bytea", "definition": "CREATE OR REPLACE FUNCTION extensions.armor(bytea)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_armor$function$\n" }, { "schema_name": "extensions", "routine_name": "armor", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text[], text[]", "definition": "CREATE OR REPLACE FUNCTION extensions.armor(bytea, text[], text[])\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_armor$function$\n" }, { "schema_name": "extensions", "routine_name": "crypt", "routine_type": "FUNCTION", "language": "c", "args": "text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.crypt(text, text)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_crypt$function$\n" }, { "schema_name": "extensions", "routine_name": "dearmor", "routine_type": "FUNCTION", "language": "c", "args": "text", "definition": "CREATE OR REPLACE FUNCTION extensions.dearmor(text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_dearmor$function$\n" }, { "schema_name": "extensions", "routine_name": "decrypt", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.decrypt(bytea, bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_decrypt$function$\n" }, { "schema_name": "extensions", "routine_name": "decrypt_iv", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_decrypt_iv$function$\n" }, { "schema_name": "extensions", "routine_name": "digest", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.digest(bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_digest$function$\n" }, { "schema_name": "extensions", "routine_name": "digest", "routine_type": "FUNCTION", "language": "c", "args": "text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.digest(text, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_digest$function$\n" }, { "schema_name": "extensions", "routine_name": "encrypt", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.encrypt(bytea, bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_encrypt$function$\n" }, { "schema_name": "extensions", "routine_name": "encrypt_iv", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_encrypt_iv$function$\n" }, { "schema_name": "extensions", "routine_name": "gen_random_bytes", "routine_type": "FUNCTION", "language": "c", "args": "integer", "definition": "CREATE OR REPLACE FUNCTION extensions.gen_random_bytes(integer)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_random_bytes$function$\n" }, { "schema_name": "extensions", "routine_name": "gen_random_uuid", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.gen_random_uuid()\n RETURNS uuid\n LANGUAGE c\n PARALLEL SAFE\nAS '$libdir/pgcrypto', $function$pg_random_uuid$function$\n" }, { "schema_name": "extensions", "routine_name": "gen_salt", "routine_type": "FUNCTION", "language": "c", "args": "text", "definition": "CREATE OR REPLACE FUNCTION extensions.gen_salt(text)\n RETURNS text\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_gen_salt$function$\n" }, { "schema_name": "extensions", "routine_name": "gen_salt", "routine_type": "FUNCTION", "language": "c", "args": "text, integer", "definition": "CREATE OR REPLACE FUNCTION extensions.gen_salt(text, integer)\n RETURNS text\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_gen_salt_rounds$function$\n" }, { "schema_name": "extensions", "routine_name": "grant_pg_cron_access", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.grant_pg_cron_access()\n RETURNS event_trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n IF EXISTS (\n SELECT\n FROM pg_event_trigger_ddl_commands() AS ev\n JOIN pg_extension AS ext\n ON ev.objid = ext.oid\n WHERE ext.extname = 'pg_cron'\n )\n THEN\n grant usage on schema cron to postgres with grant option;\n\n alter default privileges in schema cron grant all on tables to postgres with grant option;\n alter default privileges in schema cron grant all on functions to postgres with grant option;\n alter default privileges in schema cron grant all on sequences to postgres with grant option;\n\n alter default privileges for user supabase_admin in schema cron grant all\n on sequences to postgres with grant option;\n alter default privileges for user supabase_admin in schema cron grant all\n on tables to postgres with grant option;\n alter default privileges for user supabase_admin in schema cron grant all\n on functions to postgres with grant option;\n\n grant all privileges on all tables in schema cron to postgres with grant option;\n revoke all on table cron.job from postgres;\n grant select on table cron.job to postgres with grant option;\n END IF;\nEND;\n$function$\n" }, { "schema_name": "extensions", "routine_name": "grant_pg_graphql_access", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.grant_pg_graphql_access()\n RETURNS event_trigger\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n func_is_graphql_resolve bool;\nBEGIN\n func_is_graphql_resolve = (\n SELECT n.proname = 'resolve'\n FROM pg_event_trigger_ddl_commands() AS ev\n LEFT JOIN pg_catalog.pg_proc AS n\n ON ev.objid = n.oid\n );\n\n IF func_is_graphql_resolve\n THEN\n -- Update public wrapper to pass all arguments through to the pg_graphql resolve func\n DROP FUNCTION IF EXISTS graphql_public.graphql;\n create or replace function graphql_public.graphql(\n "operationName" text default null,\n query text default null,\n variables jsonb default null,\n extensions jsonb default null\n )\n returns jsonb\n language sql\n as $$\n select graphql.resolve(\n query := query,\n variables := coalesce(variables, '{}'),\n "operationName" := "operationName",\n extensions := extensions\n );\n ;\n\n -- This hook executes when graphql.resolve is created. That is not necessarily the last\n -- function in the extension so we need to grant permissions on existing entities AND\n -- update default permissions to any others that are created after graphql.resolve\n grant usage on schema graphql to postgres, anon, authenticated, service_role;\n grant select on all tables in schema graphql to postgres, anon, authenticated, service_role;\n grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role;\n grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role;\n alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role;\n alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role;\n alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role;\n\n -- Allow postgres role to allow granting usage on graphql and graphql_public schemas to custom roles\n grant usage on schema graphql_public to postgres with grant option;\n grant usage on schema graphql to postgres with grant option;\n END IF;\n\nEND;\n$function$\n" }, { "schema_name": "extensions", "routine_name": "grant_pg_net_access", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access()\n RETURNS event_trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n IF EXISTS (\n SELECT 1\n FROM pg_event_trigger_ddl_commands() AS ev\n JOIN pg_extension AS ext\n ON ev.objid = ext.oid\n WHERE ext.extname = 'pg_net'\n )\n THEN\n IF NOT EXISTS (\n SELECT 1\n FROM pg_roles\n WHERE rolname = 'supabase_functions_admin'\n )\n THEN\n CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION;\n END IF;\n\n GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n\n IF EXISTS (\n SELECT FROM pg_extension\n WHERE extname = 'pg_net'\n -- all versions in use on existing projects as of 2025-02-20\n -- version 0.12.0 onwards don't need these applied\n AND extversion IN ('0.2', '0.6', '0.7', '0.7.1', '0.8', '0.10.0', '0.11.0')\n ) THEN\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;\n\n ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;\n\n REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;\n\n GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;\n END IF;\n END IF;\nEND;\n$function$\n" }, { "schema_name": "extensions", "routine_name": "hmac", "routine_type": "FUNCTION", "language": "c", "args": "text, text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.hmac(text, text, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_hmac$function$\n" }, { "schema_name": "extensions", "routine_name": "hmac", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.hmac(bytea, bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pg_hmac$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg", "routine_type": "FUNCTION", "language": "c", "args": "OUT indexname text, OUT indexrelid oid, OUT indrelid oid, OUT innatts integer, OUT indisunique boolean, OUT indkey int2vector, OUT indcollation oidvector, OUT indclass oidvector, OUT indoption oidvector, OUT indexprs pg_node_tree, OUT indpred pg_node_tree, OUT amid oid", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg(OUT indexname text, OUT indexrelid oid, OUT indrelid oid, OUT innatts integer, OUT indisunique boolean, OUT indkey int2vector, OUT indcollation oidvector, OUT indclass oidvector, OUT indoption oidvector, OUT indexprs pg_node_tree, OUT indpred pg_node_tree, OUT amid oid)\n RETURNS SETOF record\n LANGUAGE c\n COST 100\nAS '$libdir/hypopg', $function$hypopg$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_create_index", "routine_type": "FUNCTION", "language": "c", "args": "sql_order text, OUT indexrelid oid, OUT indexname text", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_create_index(sql_order text, OUT indexrelid oid, OUT indexname text)\n RETURNS SETOF record\n LANGUAGE c\n STRICT COST 100\nAS '$libdir/hypopg', $function$hypopg_create_index$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_drop_index", "routine_type": "FUNCTION", "language": "c", "args": "indexid oid", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_drop_index(indexid oid)\n RETURNS boolean\n LANGUAGE c\n STRICT COST 100\nAS '$libdir/hypopg', $function$hypopg_drop_index$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_get_indexdef", "routine_type": "FUNCTION", "language": "c", "args": "indexid oid", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_get_indexdef(indexid oid)\n RETURNS text\n LANGUAGE c\n STRICT COST 100\nAS '$libdir/hypopg', $function$hypopg_get_indexdef$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_hidden_indexes", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_hidden_indexes()\n RETURNS TABLE(indexid oid)\n LANGUAGE c\n STRICT\nAS '$libdir/hypopg', $function$hypopg_hidden_indexes$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_hide_index", "routine_type": "FUNCTION", "language": "c", "args": "indexid oid", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_hide_index(indexid oid)\n RETURNS boolean\n LANGUAGE c\n STRICT COST 100\nAS '$libdir/hypopg', $function$hypopg_hide_index$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_relation_size", "routine_type": "FUNCTION", "language": "c", "args": "indexid oid", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_relation_size(indexid oid)\n RETURNS bigint\n LANGUAGE c\n STRICT COST 100\nAS '$libdir/hypopg', $function$hypopg_relation_size$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_reset", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_reset()\n RETURNS void\n LANGUAGE c\n COST 100\nAS '$libdir/hypopg', $function$hypopg_reset$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_reset_index", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_reset_index()\n RETURNS void\n LANGUAGE c\n COST 100\nAS '$libdir/hypopg', $function$hypopg_reset_index$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_unhide_all_indexes", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_unhide_all_indexes()\n RETURNS void\n LANGUAGE c\n COST 100\nAS '$libdir/hypopg', $function$hypopg_unhide_all_indexes$function$\n" }, { "schema_name": "extensions", "routine_name": "hypopg_unhide_index", "routine_type": "FUNCTION", "language": "c", "args": "indexid oid", "definition": "CREATE OR REPLACE FUNCTION extensions.hypopg_unhide_index(indexid oid)\n RETURNS boolean\n LANGUAGE c\n STRICT COST 100\nAS '$libdir/hypopg', $function$hypopg_unhide_index$function$\n" }, { "schema_name": "extensions", "routine_name": "index_advisor", "routine_type": "FUNCTION", "language": "plpgsql", "args": "query text", "definition": "CREATE OR REPLACE FUNCTION extensions.index_advisor(query text)\n RETURNS TABLE(startup_cost_before jsonb, startup_cost_after jsonb, total_cost_before jsonb, total_cost_after jsonb, index_statements text[], errors text[])\n LANGUAGE plpgsql\nAS $function$\ndeclare\n n_args int;\n prepared_statement_name text = 'index_advisor_working_statement';\n hypopg_schema_name text = (select extnamespace::regnamespace::text from pg_extension where extname = 'hypopg');\n explain_plan_statement text;\n error_message text;\n rec record;\n plan_initial jsonb;\n plan_final jsonb;\n statements text[] = '{}';\nbegin\n\n -- Remove comment lines (its common that they contain semicolons)\n query := trim(\n regexp_replace(\n regexp_replace(\n regexp_replace(query,'\/\.+\\/', '', 'g'),\n '--[^\r\n]', ' ', 'g'),\n '\s+', ' ', 'g')\n );\n\n -- Remove trailing semicolon\n query := regexp_replace(query, ';\s$', '');\n\n begin\n -- Disallow multiple statements\n if query ilike '%;%' then\n raise exception 'Query must not contain a semicolon';\n end if;\n\n -- Hack to support PostgREST because the prepared statement for args incorrectly defaults to text\n query := replace(query, 'WITH pgrst_payload AS (SELECT $1 AS json_data)', 'WITH pgrst_payload AS (SELECT $1::json AS json_data)');\n\n -- Create a prepared statement for the given query\n deallocate all;\n execute format('prepare %I as %s', prepared_statement_name, query);\n\n -- Detect how many arguments are present in the prepared statement\n n_args = (\n select\n coalesce(array_length(parameter_types, 1), 0)\n from\n pg_prepared_statements\n where\n name = prepared_statement_name\n limit\n 1\n );\n\n -- Create a SQL statement that can be executed to collect the explain plan\n explain_plan_statement = format(\n 'set local plan_cache_mode = force_generic_plan; explain (format json) execute %I%s',\n --'explain (format json) execute %I%s',\n prepared_statement_name,\n case\n when n_args = 0 then ''\n else format(\n '(%s)', array_to_string(array_fill('null'::text, array[n_args]), ',')\n )\n end\n );\n\n -- Store the query plan before any new indexes\n execute explain_plan_statement into plan_initial;\n\n -- Create possible indexes\n for rec in (\n with extension_regclass as (\n select\n distinct objid as oid\n from\n pg_catalog.pg_depend\n where\n deptype = 'e'\n )\n select\n pc.relnamespace::regnamespace::text as schema_name,\n pc.relname as table_name,\n pa.attname as column_name,\n format(\n 'select %I.hypopg_create_index($i$create index on %I.%I(%I)i)',\n hypopg_schema_name,\n pc.relnamespace::regnamespace::text,\n pc.relname,\n pa.attname\n ) hypopg_statement\n from\n pg_catalog.pg_class pc\n join pg_catalog.pg_attribute pa\n on pc.oid = pa.attrelid\n left join extension_regclass er\n on pc.oid = er.oid\n left join pg_catalog.pg_index pi\n on pc.oid = pi.indrelid\n and (select array_agg(x) from unnest(pi.indkey) v(x)) = array[pa.attnum]\n and pi.indexprs is null -- ignore expression indexes\n and pi.indpred is null -- ignore partial indexes\n where\n pc.relnamespace::regnamespace::text not in ( -- ignore schema list\n 'pg_catalog', 'pg_toast', 'information_schema'\n )\n and er.oid is null -- ignore entities owned by extensions\n and pc.relkind in ('r', 'm') -- regular tables, and materialized views\n and pc.relpersistence = 'p' -- permanent tables (not unlogged or temporary)\n and pa.attnum > 0\n and not pa.attisdropped\n and pi.indrelid is null\n and pa.atttypid in (20,16,1082,1184,1114,701,23,21,700,1083,2950,1700,25,18,1042,1043)\n )\n loop\n -- Create the hypothetical index\n execute rec.hypopg_statement;\n end loop;\n\n /\n for rec in select * from hypopg()\n loop\n raise notice '%', rec;\n end loop;\n /\n\n -- Create a prepared statement for the given query\n -- The original prepared statement MUST be dropped because its plan is cached\n execute format('deallocate %I', prepared_statement_name);\n execute format('prepare %I as %s', prepared_statement_name, query);\n\n -- Store the query plan after new indexes\n execute explain_plan_statement into plan_final;\n\n --raise notice '%', plan_final;\n\n -- Idenfity referenced indexes in new plan\n execute format(\n 'select\n coalesce(array_agg(hypopg_get_indexdef(indexrelid) order by indrelid, indkey::text), $i${}i::text[])\n from\n %I.hypopg()\n where\n %s ilike ($i$%%i || indexname || $i$%%i)\n ',\n hypopg_schema_name,\n quote_literal(plan_final)::text\n ) into statements;\n\n -- Reset all hypothetical indexes\n perform hypopg_reset();\n\n -- Reset prepared statements\n deallocate all;\n\n return query values (\n (plan_initial -> 0 -> 'Plan' -> 'Startup Cost'),\n (plan_final -> 0 -> 'Plan' -> 'Startup Cost'),\n (plan_initial -> 0 -> 'Plan' -> 'Total Cost'),\n (plan_final -> 0 -> 'Plan' -> 'Total Cost'),\n statements::text[],\n array[]::text[]\n );\n return;\n\n exception when others then\n get stacked diagnostics error_message = MESSAGE_TEXT;\n\n return query values (\n null::jsonb,\n null::jsonb,\n null::jsonb,\n null::jsonb,\n array[]::text[],\n array[error_message]::text[]\n );\n return;\n end;\n\nend;\n$function$\n" }, { "schema_name": "extensions", "routine_name": "pg_stat_statements", "routine_type": "FUNCTION", "language": "c", "args": "showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT shared_blk_read_time double precision, OUT shared_blk_write_time double precision, OUT local_blk_read_time double precision, OUT local_blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision, OUT jit_deform_count bigint, OUT jit_deform_time double precision, OUT stats_since timestamp with time zone, OUT minmax_stats_since timestamp with time zone", "definition": "CREATE OR REPLACE FUNCTION extensions.pg_stat_statements(showtext boolean, OUT userid oid, OUT dbid oid, OUT toplevel boolean, OUT queryid bigint, OUT query text, OUT plans bigint, OUT total_plan_time double precision, OUT min_plan_time double precision, OUT max_plan_time double precision, OUT mean_plan_time double precision, OUT stddev_plan_time double precision, OUT calls bigint, OUT total_exec_time double precision, OUT min_exec_time double precision, OUT max_exec_time double precision, OUT mean_exec_time double precision, OUT stddev_exec_time double precision, OUT rows bigint, OUT shared_blks_hit bigint, OUT shared_blks_read bigint, OUT shared_blks_dirtied bigint, OUT shared_blks_written bigint, OUT local_blks_hit bigint, OUT local_blks_read bigint, OUT local_blks_dirtied bigint, OUT local_blks_written bigint, OUT temp_blks_read bigint, OUT temp_blks_written bigint, OUT shared_blk_read_time double precision, OUT shared_blk_write_time double precision, OUT local_blk_read_time double precision, OUT local_blk_write_time double precision, OUT temp_blk_read_time double precision, OUT temp_blk_write_time double precision, OUT wal_records bigint, OUT wal_fpi bigint, OUT wal_bytes numeric, OUT jit_functions bigint, OUT jit_generation_time double precision, OUT jit_inlining_count bigint, OUT jit_inlining_time double precision, OUT jit_optimization_count bigint, OUT jit_optimization_time double precision, OUT jit_emission_count bigint, OUT jit_emission_time double precision, OUT jit_deform_count bigint, OUT jit_deform_time double precision, OUT stats_since timestamp with time zone, OUT minmax_stats_since timestamp with time zone)\n RETURNS SETOF record\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pg_stat_statements', $function$pg_stat_statements_1_11$function$\n" }, { "schema_name": "extensions", "routine_name": "pg_stat_statements_info", "routine_type": "FUNCTION", "language": "c", "args": "OUT dealloc bigint, OUT stats_reset timestamp with time zone", "definition": "CREATE OR REPLACE FUNCTION extensions.pg_stat_statements_info(OUT dealloc bigint, OUT stats_reset timestamp with time zone)\n RETURNS record\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pg_stat_statements', $function$pg_stat_statements_info$function$\n" }, { "schema_name": "extensions", "routine_name": "pg_stat_statements_reset", "routine_type": "FUNCTION", "language": "c", "args": "userid oid, dbid oid, queryid bigint, minmax_only boolean", "definition": "CREATE OR REPLACE FUNCTION extensions.pg_stat_statements_reset(userid oid DEFAULT 0, dbid oid DEFAULT 0, queryid bigint DEFAULT 0, minmax_only boolean DEFAULT false)\n RETURNS timestamp with time zone\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pg_stat_statements', $function$pg_stat_statements_reset_1_11$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_armor_headers", "routine_type": "FUNCTION", "language": "c", "args": "text, OUT key text, OUT value text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text)\n RETURNS SETOF record\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_armor_headers$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_key_id", "routine_type": "FUNCTION", "language": "c", "args": "bytea", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_key_id(bytea)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_key_id_w$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_decrypt", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_decrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_decrypt", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_decrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_decrypt", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_decrypt(bytea, bytea)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_decrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_decrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_decrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_decrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_encrypt", "routine_type": "FUNCTION", "language": "c", "args": "text, bytea", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_encrypt(text, bytea)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_encrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_encrypt", "routine_type": "FUNCTION", "language": "c", "args": "text, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_encrypt(text, bytea, text)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_encrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_encrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, bytea", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_pub_encrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_decrypt", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_decrypt(bytea, text, text)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_decrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_decrypt", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_decrypt(bytea, text)\n RETURNS text\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_decrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_decrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_decrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_encrypt", "routine_type": "FUNCTION", "language": "c", "args": "text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_encrypt(text, text)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_encrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_encrypt", "routine_type": "FUNCTION", "language": "c", "args": "text, text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_encrypt(text, text, text)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_encrypt_text$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_encrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "routine_type": "FUNCTION", "language": "c", "args": "bytea, text", "definition": "CREATE OR REPLACE FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text)\n RETURNS bytea\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/pgcrypto', $function$pgp_sym_encrypt_bytea$function$\n" }, { "schema_name": "extensions", "routine_name": "pgrst_ddl_watch", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.pgrst_ddl_watch()\n RETURNS event_trigger\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n cmd record;\nBEGIN\n FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands()\n LOOP\n IF cmd.command_tag IN (\n 'CREATE SCHEMA', 'ALTER SCHEMA'\n , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE'\n , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE'\n , 'CREATE VIEW', 'ALTER VIEW'\n , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW'\n , 'CREATE FUNCTION', 'ALTER FUNCTION'\n , 'CREATE TRIGGER'\n , 'CREATE TYPE', 'ALTER TYPE'\n , 'CREATE RULE'\n , 'COMMENT'\n )\n -- don't notify in case of CREATE TEMP table or other objects created on pg_temp\n AND cmd.schema_name is distinct from 'pg_temp'\n THEN\n NOTIFY pgrst, 'reload schema';\n END IF;\n END LOOP;\nEND; $function$\n" }, { "schema_name": "extensions", "routine_name": "pgrst_drop_watch", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.pgrst_drop_watch()\n RETURNS event_trigger\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n obj record;\nBEGIN\n FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects()\n LOOP\n IF obj.object_type IN (\n 'schema'\n , 'table'\n , 'foreign table'\n , 'view'\n , 'materialized view'\n , 'function'\n , 'trigger'\n , 'type'\n , 'rule'\n )\n AND obj.is_temporary IS false -- no pg_temp objects\n THEN\n NOTIFY pgrst, 'reload schema';\n END IF;\n END LOOP;\nEND; $function$\n" }, { "schema_name": "extensions", "routine_name": "set_graphql_placeholder", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.set_graphql_placeholder()\n RETURNS event_trigger\n LANGUAGE plpgsql\nAS $function$\n DECLARE\n graphql_is_dropped bool;\n BEGIN\n graphql_is_dropped = (\n SELECT ev.schema_name = 'graphql_public'\n FROM pg_event_trigger_dropped_objects() AS ev\n WHERE ev.schema_name = 'graphql_public'\n );\n\n IF graphql_is_dropped\n THEN\n create or replace function graphql_public.graphql(\n "operationName" text default null,\n query text default null,\n variables jsonb default null,\n extensions jsonb default null\n )\n returns jsonb\n language plpgsql\n as $$\n DECLARE\n server_version float;\n BEGIN\n server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float);\n\n IF server_version >= 14 THEN\n RETURN jsonb_build_object(\n 'errors', jsonb_build_array(\n jsonb_build_object(\n 'message', 'pg_graphql extension is not enabled.'\n )\n )\n );\n ELSE\n RETURN jsonb_build_object(\n 'errors', jsonb_build_array(\n jsonb_build_object(\n 'message', 'pg_graphql is only available on projects running Postgres 14 onwards.'\n )\n )\n );\n END IF;\n END;\n ;\n END IF;\n\n END;\n$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_generate_v1", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_generate_v1()\n RETURNS uuid\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_generate_v1$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_generate_v1mc", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_generate_v1mc()\n RETURNS uuid\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_generate_v1mc$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_generate_v3", "routine_type": "FUNCTION", "language": "c", "args": "namespace uuid, name text", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_generate_v3(namespace uuid, name text)\n RETURNS uuid\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_generate_v3$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_generate_v4", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_generate_v4()\n RETURNS uuid\n LANGUAGE c\n PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_generate_v4$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_generate_v5", "routine_type": "FUNCTION", "language": "c", "args": "namespace uuid, name text", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_generate_v5(namespace uuid, name text)\n RETURNS uuid\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_generate_v5$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_nil", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_nil()\n RETURNS uuid\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_nil$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_ns_dns", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_ns_dns()\n RETURNS uuid\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_ns_dns$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_ns_oid", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_ns_oid()\n RETURNS uuid\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_ns_oid$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_ns_url", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_ns_url()\n RETURNS uuid\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_ns_url$function$\n" }, { "schema_name": "extensions", "routine_name": "uuid_ns_x500", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION extensions.uuid_ns_x500()\n RETURNS uuid\n LANGUAGE c\n IMMUTABLE PARALLEL SAFE STRICT\nAS '$libdir/uuid-ossp', $function$uuid_ns_x500$function$\n" }, { "schema_name": "graphql", "routine_name": "internal_resolve", "routine_type": "FUNCTION", "language": "c", "args": "query text, variables jsonb, "operationName" text, extensions jsonb", "definition": "CREATE OR REPLACE FUNCTION graphql.internal_resolve(query text, variables jsonb DEFAULT '{}'::jsonb, "operationName" text DEFAULT NULL::text, extensions jsonb DEFAULT NULL::jsonb)\n RETURNS jsonb\n LANGUAGE c\nAS '$libdir/pg_graphql', $function$resolve_wrapper$function$\n" }, { "schema_name": "graphql", "routine_name": "comment_directive", "routine_type": "FUNCTION", "language": "sql", "args": "comment text", "definition": "CREATE OR REPLACE FUNCTION graphql.comment_directive(comment text)\n RETURNS jsonb\n LANGUAGE sql\n IMMUTABLE\nAS $function$\n /\n comment on column public.account.name is '@graphql.name: myField'\n /\n select\n coalesce(\n (\n regexp_match(\n comment_,\n '@graphql\((.+)\)'\n )\n )[1]::jsonb,\n jsonb_build_object()\n )\n$function$\n" }, { "schema_name": "graphql", "routine_name": "exception", "routine_type": "FUNCTION", "language": "plpgsql", "args": "message text", "definition": "CREATE OR REPLACE FUNCTION graphql.exception(message text)\n RETURNS text\n LANGUAGE plpgsql\nAS $function$\nbegin\n raise exception using errcode='22000', message=message;\nend;\n$function$\n" }, { "schema_name": "graphql", "routine_name": "get_schema_version", "routine_type": "FUNCTION", "language": "sql", "args": "", "definition": "CREATE OR REPLACE FUNCTION graphql.get_schema_version()\n RETURNS integer\n LANGUAGE sql\n SECURITY DEFINER\nAS $function$\n select last_value from graphql.seq_schema_version;\n$function$\n" }, { "schema_name": "graphql", "routine_name": "increment_schema_version", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION graphql.increment_schema_version()\n RETURNS event_trigger\n LANGUAGE plpgsql\n SECURITY DEFINER\nAS $function$\nbegin\n perform pg_catalog.nextval('graphql.seq_schema_version');\nend;\n$function$\n" }, { "schema_name": "graphql", "routine_name": "resolve", "routine_type": "FUNCTION", "language": "plpgsql", "args": "query text, variables jsonb, "operationName" text, extensions jsonb", "definition": "CREATE OR REPLACE FUNCTION graphql.resolve(query text, variables jsonb DEFAULT '{}'::jsonb, "operationName" text DEFAULT NULL::text, extensions jsonb DEFAULT NULL::jsonb)\n RETURNS jsonb\n LANGUAGE plpgsql\nAS $function$\ndeclare\n res jsonb;\n message_text text;\nbegin\n begin\n select graphql.internal_resolve("query" := "query",\n "variables" := "variables",\n "operationName" := "operationName",\n "extensions" := "extensions") into res;\n return res;\n exception\n when others then\n get stacked diagnostics message_text = message_text;\n return\n jsonb_build_object('data', null,\n 'errors', jsonb_build_array(jsonb_build_object('message', message_text)));\n end;\nend;\n$function$\n" }, { "schema_name": "graphql_public", "routine_name": "graphql", "routine_type": "FUNCTION", "language": "sql", "args": ""operationName" text, query text, variables jsonb, extensions jsonb", "definition": "CREATE OR REPLACE FUNCTION graphql_public.graphql("operationName" text DEFAULT NULL::text, query text DEFAULT NULL::text, variables jsonb DEFAULT NULL::jsonb, extensions jsonb DEFAULT NULL::jsonb)\n RETURNS jsonb\n LANGUAGE sql\nAS $function$\n select graphql.resolve(\n query := query,\n variables := coalesce(variables, '{}'),\n "operationName" := "operationName",\n extensions := extensions\n );\n $function$\n" }, { "schema_name": "pgbouncer", "routine_name": "get_auth", "routine_type": "FUNCTION", "language": "plpgsql", "args": "p_usename text", "definition": "CREATE OR REPLACE FUNCTION pgbouncer.get_auth(p_usename text)\n RETURNS TABLE(username text, password text)\n LANGUAGE plpgsql\n SECURITY DEFINER\n SET search_path TO ''\nAS $function$\n BEGIN\n RAISE DEBUG 'PgBouncer auth request: %', p_usename;\n\n RETURN QUERY\n SELECT\n rolname::text,\n CASE WHEN rolvaliduntil < now()\n THEN null\n ELSE rolpassword::text\n END\n FROM pg_authid\n WHERE rolname=$1 and rolcanlogin;\n END;\n $function$\n" }, { "schema_name": "public", "routine_name": "get_collection_counts", "routine_type": "FUNCTION", "language": "sql", "args": "p_collection_ids uuid[]", "definition": "CREATE OR REPLACE FUNCTION public.get_collection_counts(p_collection_ids uuid[])\n RETURNS TABLE(collection_id uuid, total_count bigint, recent_count bigint)\n LANGUAGE sql\n SECURITY DEFINER\n SET search_path TO ''\nAS $function$\r\n WITH requested AS (\r\n SELECT unnest(p_collection_ids) AS collection_id\r\n )\r\n SELECT\r\n r.collection_id,\r\n count(h.id)::bigint AS total_count,\r\n count(h.id) FILTER (\r\n WHERE h.created_at >= (now() - interval '7 days')\r\n )::bigint AS recent_count\r\n FROM requested r\r\n LEFT JOIN public.hotwheels h\r\n ON h.collection_id = r.collection_id\r\n WHERE r.collection_id IN (\r\n SELECT cm.collection_id\r\n FROM public.collection_members cm\r\n WHERE cm.user_id = auth.uid()\r\n )\r\n GROUP BY r.collection_id;\r\n$function$\n" }, { "schema_name": "public", "routine_name": "get_collection_members", "routine_type": "FUNCTION", "language": "sql", "args": "p_collection_id uuid", "definition": "CREATE OR REPLACE FUNCTION public.get_collection_members(p_collection_id uuid)\n RETURNS TABLE(id uuid, user_id uuid, email text, role text, created_at timestamp with time zone)\n LANGUAGE sql\n SECURITY DEFINER\n SET search_path TO ''\nAS $function$\r\n SELECT\r\n cm.id,\r\n cm.user_id,\r\n u.email,\r\n cm.role,\r\n cm.created_at\r\n FROM public.collection_members cm\r\n JOIN auth.users u ON u.id = cm.user_id\r\n WHERE cm.collection_id = p_collection_id\r\n AND cm.collection_id IN (\r\n SELECT cm2.collection_id FROM public.collection_members cm2\r\n WHERE cm2.user_id = auth.uid()\r\n )\r\n ORDER BY\r\n CASE cm.role WHEN 'owner' THEN 0 ELSE 1 END,\r\n cm.created_at;\r\n$function$\n" }, { "schema_name": "public", "routine_name": "get_user_id_by_email", "routine_type": "FUNCTION", "language": "sql", "args": "lookup_email text", "definition": "CREATE OR REPLACE FUNCTION public.get_user_id_by_email(lookup_email text)\n RETURNS uuid\n LANGUAGE sql\n SECURITY DEFINER\n SET search_path TO ''\nAS $function$\r\n SELECT id FROM auth.users\r\n WHERE email = lower(lookup_email)\r\n LIMIT 1;\r\n$function$\n" }, { "schema_name": "public", "routine_name": "handle_new_car_vote", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION public.handle_new_car_vote()\n RETURNS trigger\n LANGUAGE plpgsql\n SECURITY DEFINER\nAS $function$\r\nBEGIN\r\n -- Wir aktualisieren das globale Auto, für das gerade gevotet wurde\r\n UPDATE public.global_cars\r\n SET \r\n -- Zähler um 1 erhöhen\r\n confirmation_count = confirmation_count + 1,\r\n -- Prüfen: Wenn der neue Zähler bei 5 oder höher ist, wird is_verified auf true gesetzt\r\n is_verified = CASE \r\n WHEN (confirmation_count + 1) >= 5 THEN true\r\n ELSE is_verified \r\n END\r\n WHERE hw_id = NEW.hw_id;\r\n \r\n -- Den neuen Vote normal in die Tabelle durchlassen\r\n RETURN NEW;\r\nEND;\r\n$function$\n" }, { "schema_name": "public", "routine_name": "remove_collection_member", "routine_type": "FUNCTION", "language": "plpgsql", "args": "p_collection_id uuid, p_member_user_id uuid", "definition": "CREATE OR REPLACE FUNCTION public.remove_collection_member(p_collection_id uuid, p_member_user_id uuid)\n RETURNS void\n LANGUAGE plpgsql\n SECURITY DEFINER\n SET search_path TO 'public'\nAS $function$\r\ndeclare\r\n v_owner_id uuid;\r\nbegin\r\n select c.owner_id\r\n into v_owner_id\r\n from public.collections c\r\n where c.id = p_collection_id;\r\n\r\n if v_owner_id is null then\r\n raise exception 'Collection not found.';\r\n end if;\r\n\r\n if v_owner_id <> auth.uid() then\r\n raise exception 'Only the collection owner can remove members.';\r\n end if;\r\n\r\n if p_member_user_id = v_owner_id then\r\n raise exception 'Collection owner cannot be removed.';\r\n end if;\r\n\r\n delete from public.collection_members cm\r\n where cm.collection_id = p_collection_id\r\n and cm.user_id = p_member_user_id\r\n and cm.role <> 'owner';\r\nend;\r\n$function$\n" }, { "schema_name": "public", "routine_name": "rls_auto_enable", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION public.rls_auto_enable()\n RETURNS event_trigger\n LANGUAGE plpgsql\n SECURITY DEFINER\n SET search_path TO 'pg_catalog'\nAS $function$\nDECLARE\n cmd record;\nBEGIN\n FOR cmd IN\n SELECT \n FROM pg_event_trigger_ddl_commands()\n WHERE command_tag IN ('CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO')\n AND object_type IN ('table','partitioned table')\n LOOP\n IF cmd.schema_name IS NOT NULL AND cmd.schema_name IN ('public') AND cmd.schema_name NOT IN ('pg_catalog','information_schema') AND cmd.schema_name NOT LIKE 'pg_toast%' AND cmd.schema_name NOT LIKE 'pg_temp%' THEN\n BEGIN\n EXECUTE format('alter table if exists %s enable row level security', cmd.object_identity);\n RAISE LOG 'rls_auto_enable: enabled RLS on %', cmd.object_identity;\n EXCEPTION\n WHEN OTHERS THEN\n RAISE LOG 'rls_auto_enable: failed to enable RLS on %', cmd.object_identity;\n END;\n ELSE\n RAISE LOG 'rls_auto_enable: skip % (either system schema or not in enforced list: %.)', cmd.object_identity, cmd.schema_name;\n END IF;\n END LOOP;\nEND;\n$function$\n" }, { "schema_name": "public", "routine_name": "update_car_verification", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION public.update_car_verification()\n RETURNS trigger\n LANGUAGE plpgsql\n SECURITY DEFINER\nAS $function$\r\nDECLARE\r\n vote_count INT;\r\nBEGIN\r\n SELECT COUNT() INTO vote_count FROM public.car_votes WHERE hw_id = NEW.hw_id;\r\n\r\n IF vote_count >= 10 THEN\r\n UPDATE public.global_cars SET confirmation_count = vote_count, is_verified = TRUE WHERE hw_id = NEW.hw_id;\r\n ELSE\r\n UPDATE public.global_cars SET confirmation_count = vote_count WHERE hw_id = NEW.hw_id;\r\n END IF;\r\n\r\n RETURN NEW;\r\nEND;\r\n$function$\n" }, { "schema_name": "realtime", "routine_name": "apply_rls", "routine_type": "FUNCTION", "language": "plpgsql", "args": "wal jsonb, max_record_bytes integer", "definition": "CREATE OR REPLACE FUNCTION realtime.apply_rls(wal jsonb, max_record_bytes integer DEFAULT (1024 * 1024))\n RETURNS SETOF realtime.wal_rls\n LANGUAGE plpgsql\nAS $function$\ndeclare\n-- Regclass of the table e.g. public.notes\nentity regclass = (quote_ident(wal ->> 'schema') || '.' || quote_ident(wal ->> 'table'))::regclass;\n\n-- I, U, D, T: insert, update ...\naction realtime.action = (\n case wal ->> 'action'\n when 'I' then 'INSERT'\n when 'U' then 'UPDATE'\n when 'D' then 'DELETE'\n else 'ERROR'\n end\n);\n\n-- Is row level security enabled for the table\nis_rls_enabled bool = relrowsecurity from pg_class where oid = entity_;\n\nsubscriptions realtime.subscription[] = array_agg(subs)\n from\n realtime.subscription subs\n where\n subs.entity = entity_\n -- Filter by action early - only get subscriptions interested in this action\n -- action_filter column can be: '' (all), 'INSERT', 'UPDATE', or 'DELETE'\n and (subs.action_filter = '' or subs.action_filter = action::text);\n\n-- Subscription vars\nroles regrole[] = array_agg(distinct us.claims_role::text)\n from\n unnest(subscriptions) us;\n\nworking_role regrole;\nclaimed_role regrole;\nclaims jsonb;\n\nsubscription_id uuid;\nsubscription_has_access bool;\nvisible_to_subscription_ids uuid[] = '{}';\n\n-- structured info for wal's columns\ncolumns realtime.wal_column[];\n-- previous identity values for update/delete\nold_columns realtime.wal_column[];\n\nerror_record_exceeds_max_size boolean = octet_length(wal::text) > max_record_bytes;\n\n-- Primary jsonb output for record\noutput jsonb;\n\nbegin\nperform set_config('role', null, true);\n\ncolumns =\n array_agg(\n (\n x->>'name',\n x->>'type',\n x->>'typeoid',\n realtime.cast(\n (x->'value') #>> '{}',\n coalesce(\n (x->>'typeoid')::regtype, -- null when wal2json version <= 2.4\n (x->>'type')::regtype\n )\n ),\n (pks ->> 'name') is not null,\n true\n )::realtime.wal_column\n )\n from\n jsonb_array_elements(wal -> 'columns') x\n left join jsonb_array_elements(wal -> 'pk') pks\n on (x ->> 'name') = (pks ->> 'name');\n\nold_columns =\n array_agg(\n (\n x->>'name',\n x->>'type',\n x->>'typeoid',\n realtime.cast(\n (x->'value') #>> '{}',\n coalesce(\n (x->>'typeoid')::regtype, -- null when wal2json version <= 2.4\n (x->>'type')::regtype\n )\n ),\n (pks ->> 'name') is not null,\n true\n )::realtime.wal_column\n )\n from\n jsonb_array_elements(wal -> 'identity') x\n left join jsonb_array_elements(wal -> 'pk') pks\n on (x ->> 'name') = (pks ->> 'name');\n\nfor working_role in select * from unnest(roles) loop\n\n -- Update is_selectable for columns and old_columns\n columns =\n array_agg(\n (\n c.name,\n c.type_name,\n c.type_oid,\n c.value,\n c.is_pkey,\n pg_catalog.has_column_privilege(working_role, entity_, c.name, 'SELECT')\n )::realtime.wal_column\n )\n from\n unnest(columns) c;\n\n old_columns =\n array_agg(\n (\n c.name,\n c.type_name,\n c.type_oid,\n c.value,\n c.is_pkey,\n pg_catalog.has_column_privilege(working_role, entity_, c.name, 'SELECT')\n )::realtime.wal_column\n )\n from\n unnest(old_columns) c;\n\n if action <> 'DELETE' and count(1) = 0 from unnest(columns) c where c.is_pkey then\n return next (\n jsonb_build_object(\n 'schema', wal ->> 'schema',\n 'table', wal ->> 'table',\n 'type', action\n ),\n is_rls_enabled,\n -- subscriptions is already filtered by entity\n (select array_agg(s.subscription_id) from unnest(subscriptions) as s where claims_role = working_role),\n array['Error 400: Bad Request, no primary key']\n )::realtime.wal_rls;\n\n -- The claims role does not have SELECT permission to the primary key of entity\n elsif action <> 'DELETE' and sum(c.is_selectable::int) <> count(1) from unnest(columns) c where c.is_pkey then\n return next (\n jsonb_build_object(\n 'schema', wal ->> 'schema',\n 'table', wal ->> 'table',\n 'type', action\n ),\n is_rls_enabled,\n (select array_agg(s.subscription_id) from unnest(subscriptions) as s where claims_role = working_role),\n array['Error 401: Unauthorized']\n )::realtime.wal_rls;\n\n else\n output = jsonb_build_object(\n 'schema', wal ->> 'schema',\n 'table', wal ->> 'table',\n 'type', action,\n 'commit_timestamp', to_char(\n ((wal ->> 'timestamp')::timestamptz at time zone 'utc'),\n 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"'\n ),\n 'columns', (\n select\n jsonb_agg(\n jsonb_build_object(\n 'name', pa.attname,\n 'type', pt.typname\n )\n order by pa.attnum asc\n )\n from\n pg_attribute pa\n join pg_type pt\n on pa.atttypid = pt.oid\n where\n attrelid = entity_\n and attnum > 0\n and pg_catalog.has_column_privilege(working_role, entity_, pa.attname, 'SELECT')\n )\n )\n -- Add "record" key for insert and update\n || case\n when action in ('INSERT', 'UPDATE') then\n jsonb_build_object(\n 'record',\n (\n select\n jsonb_object_agg(\n -- if unchanged toast, get column name and value from old record\n coalesce((c).name, (oc).name),\n case\n when (c).name is null then (oc).value\n else (c).value\n end\n )\n from\n unnest(columns) c\n full outer join unnest(old_columns) oc\n on (c).name = (oc).name\n where\n coalesce((c).is_selectable, (oc).is_selectable)\n and ( not error_record_exceeds_max_size or (octet_length((c).value::text) <= 64))\n )\n )\n else '{}'::jsonb\n end\n -- Add "old_record" key for update and delete\n || case\n when action = 'UPDATE' then\n jsonb_build_object(\n 'old_record',\n (\n select jsonb_object_agg((c).name, (c).value)\n from unnest(old_columns) c\n where\n (c).is_selectable\n and ( not error_record_exceeds_max_size or (octet_length((c).value::text) <= 64))\n )\n )\n when action = 'DELETE' then\n jsonb_build_object(\n 'old_record',\n (\n select jsonb_object_agg((c).name, (c).value)\n from unnest(old_columns) c\n where\n (c).is_selectable\n and ( not error_record_exceeds_max_size or (octet_length((c).value::text) <= 64))\n and ( not is_rls_enabled or (c).is_pkey ) -- if RLS enabled, we can't secure deletes so filter to pkey\n )\n )\n else '{}'::jsonb\n end;\n\n -- Create the prepared statement\n if is_rls_enabled and action <> 'DELETE' then\n if (select 1 from pg_prepared_statements where name = 'walrus_rls_stmt' limit 1) > 0 then\n deallocate walrus_rls_stmt;\n end if;\n execute realtime.build_prepared_statement_sql('walrus_rls_stmt', entity_, columns);\n end if;\n\n visible_to_subscription_ids = '{}';\n\n for subscription_id, claims in (\n select\n subs.subscription_id,\n subs.claims\n from\n unnest(subscriptions) subs\n where\n subs.entity = entity_\n and subs.claims_role = working_role\n and (\n realtime.is_visible_through_filters(columns, subs.filters)\n or (\n action = 'DELETE'\n and realtime.is_visible_through_filters(old_columns, subs.filters)\n )\n )\n ) loop\n\n if not is_rls_enabled or action = 'DELETE' then\n visible_to_subscription_ids = visible_to_subscription_ids || subscription_id;\n else\n -- Check if RLS allows the role to see the record\n perform\n -- Trim leading and trailing quotes from working_role because set_config\n -- doesn't recognize the role as valid if they are included\n set_config('role', trim(both '"' from working_role::text), true),\n set_config('request.jwt.claims', claims::text, true);\n\n execute 'execute walrus_rls_stmt' into subscription_has_access;\n\n if subscription_has_access then\n visible_to_subscription_ids = visible_to_subscription_ids || subscription_id;\n end if;\n end if;\n end loop;\n\n perform set_config('role', null, true);\n\n return next (\n output,\n is_rls_enabled,\n visible_to_subscription_ids,\n case\n when error_record_exceeds_max_size then array['Error 413: Payload Too Large']\n else '{}'\n end\n )::realtime.wal_rls;\n\n end if;\nend loop;\n\nperform set_config('role', null, true);\nend;\n$function$\n" }, { "schema_name": "realtime", "routine_name": "broadcast_changes", "routine_type": "FUNCTION", "language": "plpgsql", "args": "topic_name text, event_name text, operation text, table_name text, table_schema text, new record, old record, level text", "definition": "CREATE OR REPLACE FUNCTION realtime.broadcast_changes(topic_name text, event_name text, operation text, table_name text, table_schema text, new record, old record, level text DEFAULT 'ROW'::text)\n RETURNS void\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n -- Declare a variable to hold the JSONB representation of the row\n row_data jsonb := '{}'::jsonb;\nBEGIN\n IF level = 'STATEMENT' THEN\n RAISE EXCEPTION 'function can only be triggered for each row, not for each statement';\n END IF;\n -- Check the operation type and handle accordingly\n IF operation = 'INSERT' OR operation = 'UPDATE' OR operation = 'DELETE' THEN\n row_data := jsonb_build_object('old_record', OLD, 'record', NEW, 'operation', operation, 'table', table_name, 'schema', table_schema);\n PERFORM realtime.send (row_data, event_name, topic_name);\n ELSE\n RAISE EXCEPTION 'Unexpected operation type: %', operation;\n END IF;\nEXCEPTION\n WHEN OTHERS THEN\n RAISE EXCEPTION 'Failed to process the row: %', SQLERRM;\nEND;\n\n$function$\n" }, { "schema_name": "realtime", "routine_name": "build_prepared_statement_sql", "routine_type": "FUNCTION", "language": "sql", "args": "prepared_statement_name text, entity regclass, columns realtime.wal_column[]", "definition": "CREATE OR REPLACE FUNCTION realtime.build_prepared_statement_sql(prepared_statement_name text, entity regclass, columns realtime.wal_column[])\n RETURNS text\n LANGUAGE sql\nAS $function$\n /\n Builds a sql string that, if executed, creates a prepared statement to\n tests retrive a row from entity by its primary key columns.\n Example\n select realtime.build_prepared_statement_sql('public.notes', '{"id"}'::text[], '{"bigint"}'::text[])\n /\n select\n 'prepare ' || prepared_statement_name || ' as\n select\n exists(\n select\n 1\n from\n ' || entity || '\n where\n ' || string_agg(quote_ident(pkc.name) || '=' || quote_nullable(pkc.value #>> '{}') , ' and ') || '\n )'\n from\n unnest(columns) pkc\n where\n pkc.is_pkey\n group by\n entity\n $function$\n" }, { "schema_name": "realtime", "routine_name": "cast", "routine_type": "FUNCTION", "language": "plpgsql", "args": "val text, type_ regtype", "definition": "CREATE OR REPLACE FUNCTION realtime."cast"(val text, type_ regtype)\n RETURNS jsonb\n LANGUAGE plpgsql\n IMMUTABLE\nAS $function$\ndeclare\n res jsonb;\nbegin\n if type_::text = 'bytea' then\n return to_jsonb(val);\n end if;\n execute format('select to_jsonb(%L::'|| type_::text || ')', val) into res;\n return res;\nend\n$function$\n" }, { "schema_name": "realtime", "routine_name": "check_equality_op", "routine_type": "FUNCTION", "language": "plpgsql", "args": "op realtime.equality_op, type_ regtype, val_1 text, val_2 text", "definition": "CREATE OR REPLACE FUNCTION realtime.check_equality_op(op realtime.equality_op, type_ regtype, val_1 text, val_2 text)\n RETURNS boolean\n LANGUAGE plpgsql\n IMMUTABLE\nAS $function$\n /\n Casts val_1 and val_2 as type type_ and check the op condition for truthiness\n /\n declare\n op_symbol text = (\n case\n when op = 'eq' then '='\n when op = 'neq' then '!='\n when op = 'lt' then '<'\n when op = 'lte' then '<='\n when op = 'gt' then '>'\n when op = 'gte' then '>='\n when op = 'in' then '= any'\n else 'UNKNOWN OP'\n end\n );\n res boolean;\n begin\n execute format(\n 'select %L::'|| type_::text || ' ' || op_symbol\n || ' ( %L::'\n || (\n case\n when op = 'in' then type_::text || '[]'\n else type_::text end\n )\n || ')', val_1, val_2) into res;\n return res;\n end;\n $function$\n" }, { "schema_name": "realtime", "routine_name": "is_visible_through_filters", "routine_type": "FUNCTION", "language": "sql", "args": "columns realtime.wal_column[], filters realtime.user_defined_filter[]", "definition": "CREATE OR REPLACE FUNCTION realtime.is_visible_through_filters(columns realtime.wal_column[], filters realtime.user_defined_filter[])\n RETURNS boolean\n LANGUAGE sql\n IMMUTABLE\nAS $function$\n /\n Should the record be visible (true) or filtered out (false) after filters are applied\n /\n select\n -- Default to allowed when no filters present\n $2 is null -- no filters. this should not happen because subscriptions has a default\n or array_length($2, 1) is null -- array length of an empty array is null\n or bool_and(\n coalesce(\n realtime.check_equality_op(\n op:=f.op,\n type_:=coalesce(\n col.type_oid::regtype, -- null when wal2json version <= 2.4\n col.type_name::regtype\n ),\n -- cast jsonb to text\n val_1:=col.value #>> '{}',\n val_2:=f.value\n ),\n false -- if null, filter does not match\n )\n )\n from\n unnest(filters) f\n join unnest(columns) col\n on f.column_name = col.name;\n $function$\n" }, { "schema_name": "realtime", "routine_name": "list_changes", "routine_type": "FUNCTION", "language": "sql", "args": "publication name, slot_name name, max_changes integer, max_record_bytes integer", "definition": "CREATE OR REPLACE FUNCTION realtime.list_changes(publication name, slot_name name, max_changes integer, max_record_bytes integer)\n RETURNS SETOF realtime.wal_rls\n LANGUAGE sql\n SET log_min_messages TO 'fatal'\nAS $function$\n with pub as (\n select\n concat_ws(\n ',',\n case when bool_or(pubinsert) then 'insert' else null end,\n case when bool_or(pubupdate) then 'update' else null end,\n case when bool_or(pubdelete) then 'delete' else null end\n ) as w2j_actions,\n coalesce(\n string_agg(\n realtime.quote_wal2json(format('%I.%I', schemaname, tablename)::regclass),\n ','\n ) filter (where ppt.tablename is not null and ppt.tablename not like '% %'),\n ''\n ) w2j_add_tables\n from\n pg_publication pp\n left join pg_publication_tables ppt\n on pp.pubname = ppt.pubname\n where\n pp.pubname = publication\n group by\n pp.pubname\n limit 1\n ),\n w2j as (\n select\n x., pub.w2j_add_tables\n from\n pub,\n pg_logical_slot_get_changes(\n slot_name, null, max_changes,\n 'include-pk', 'true',\n 'include-transaction', 'false',\n 'include-timestamp', 'true',\n 'include-type-oids', 'true',\n 'format-version', '2',\n 'actions', pub.w2j_actions,\n 'add-tables', pub.w2j_add_tables\n ) x\n )\n select\n xyz.wal,\n xyz.is_rls_enabled,\n xyz.subscription_ids,\n xyz.errors\n from\n w2j,\n realtime.apply_rls(\n wal := w2j.data::jsonb,\n max_record_bytes := max_record_bytes\n ) xyz(wal, is_rls_enabled, subscription_ids, errors)\n where\n w2j.w2j_add_tables <> ''\n and xyz.subscription_ids[1] is not null\n $function$\n" }, { "schema_name": "realtime", "routine_name": "quote_wal2json", "routine_type": "FUNCTION", "language": "sql", "args": "entity regclass", "definition": "CREATE OR REPLACE FUNCTION realtime.quote_wal2json(entity regclass)\n RETURNS text\n LANGUAGE sql\n IMMUTABLE STRICT\nAS $function$\n select\n (\n select string_agg('' || ch,'')\n from unnest(string_to_array(nsp.nspname::text, null)) with ordinality x(ch, idx)\n where\n not (x.idx = 1 and x.ch = '"')\n and not (\n x.idx = array_length(string_to_array(nsp.nspname::text, null), 1)\n and x.ch = '"'\n )\n )\n || '.'\n || (\n select string_agg('' || ch,'')\n from unnest(string_to_array(pc.relname::text, null)) with ordinality x(ch, idx)\n where\n not (x.idx = 1 and x.ch = '"')\n and not (\n x.idx = array_length(string_to_array(nsp.nspname::text, null), 1)\n and x.ch = '"'\n )\n )\n from\n pg_class pc\n join pg_namespace nsp\n on pc.relnamespace = nsp.oid\n where\n pc.oid = entity\n $function$\n" }, { "schema_name": "realtime", "routine_name": "send", "routine_type": "FUNCTION", "language": "plpgsql", "args": "payload jsonb, event text, topic text, private boolean", "definition": "CREATE OR REPLACE FUNCTION realtime.send(payload jsonb, event text, topic text, private boolean DEFAULT true)\n RETURNS void\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n generated_id uuid;\n final_payload jsonb;\nBEGIN\n BEGIN\n -- Generate a new UUID for the id\n generated_id := gen_random_uuid();\n\n -- Check if payload has an 'id' key, if not, add the generated UUID\n IF payload ? 'id' THEN\n final_payload := payload;\n ELSE\n final_payload := jsonb_set(payload, '{id}', to_jsonb(generated_id));\n END IF;\n\n -- Set the topic configuration\n EXECUTE format('SET LOCAL realtime.topic TO %L', topic);\n\n -- Attempt to insert the message\n INSERT INTO realtime.messages (id, payload, event, topic, private, extension)\n VALUES (generated_id, final_payload, event, topic, private, 'broadcast');\n EXCEPTION\n WHEN OTHERS THEN\n -- Capture and notify the error\n RAISE WARNING 'ErrorSendingBroadcastMessage: %', SQLERRM;\n END;\nEND;\n$function$\n" }, { "schema_name": "realtime", "routine_name": "subscription_check_filters", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION realtime.subscription_check_filters()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n /\n Validates that the user defined filters for a subscription:\n - refer to valid columns that the claimed role may access\n - values are coercable to the correct column type\n */\n declare\n col_names text[] = coalesce(\n array_agg(c.column_name order by c.ordinal_position),\n '{}'::text[]\n )\n from\n information_schema.columns c\n where\n format('%I.%I', c.table_schema, c.table_name)::regclass = new.entity\n and pg_catalog.has_column_privilege(\n (new.claims ->> 'role'),\n format('%I.%I', c.table_schema, c.table_name)::regclass,\n c.column_name,\n 'SELECT'\n );\n filter realtime.user_defined_filter;\n col_type regtype;\n\n in_val jsonb;\n begin\n for filter in select * from unnest(new.filters) loop\n -- Filtered column is valid\n if not filter.column_name = any(col_names) then\n raise exception 'invalid column for filter %', filter.column_name;\n end if;\n\n -- Type is sanitized and safe for string interpolation\n col_type = (\n select atttypid::regtype\n from pg_catalog.pg_attribute\n where attrelid = new.entity\n and attname = filter.column_name\n );\n if col_type is null then\n raise exception 'failed to lookup type for column %', filter.column_name;\n end if;\n\n -- Set maximum number of entries for in filter\n if filter.op = 'in'::realtime.equality_op then\n in_val = realtime.cast(filter.value, (col_type::text || '[]')::regtype);\n if coalesce(jsonb_array_length(in_val), 0) > 100 then\n raise exception 'too many values for in filter. Maximum 100';\n end if;\n else\n -- raises an exception if value is not coercable to type\n perform realtime.cast(filter.value, col_type);\n end if;\n\n end loop;\n\n -- Apply consistent order to filters so the unique constraint on\n -- (subscription_id, entity, filters) can't be tricked by a different filter order\n new.filters = coalesce(\n array_agg(f order by f.column_name, f.op, f.value),\n '{}'\n ) from unnest(new.filters) f;\n\n return new;\n end;\n $function$\n" }, { "schema_name": "realtime", "routine_name": "to_regrole", "routine_type": "FUNCTION", "language": "sql", "args": "role_name text", "definition": "CREATE OR REPLACE FUNCTION realtime.to_regrole(role_name text)\n RETURNS regrole\n LANGUAGE sql\n IMMUTABLE\nAS function select role_name::regrole $function$\n" }, { "schema_name": "realtime", "routine_name": "topic", "routine_type": "FUNCTION", "language": "sql", "args": "", "definition": "CREATE OR REPLACE FUNCTION realtime.topic()\n RETURNS text\n LANGUAGE sql\n STABLE\nAS $function$\nselect nullif(current_setting('realtime.topic', true), '')::text;\n$function$\n" }, { "schema_name": "storage", "routine_name": "can_insert_object", "routine_type": "FUNCTION", "language": "plpgsql", "args": "bucketid text, name text, owner uuid, metadata jsonb", "definition": "CREATE OR REPLACE FUNCTION storage.can_insert_object(bucketid text, name text, owner uuid, metadata jsonb)\n RETURNS void\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n INSERT INTO "storage"."objects" ("bucket_id", "name", "owner", "metadata") VALUES (bucketid, name, owner, metadata);\n -- hack to rollback the successful insert\n RAISE sqlstate 'PT200' using\n message = 'ROLLBACK',\n detail = 'rollback successful insert';\nEND\n$function$\n" }, { "schema_name": "storage", "routine_name": "enforce_bucket_name_length", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION storage.enforce_bucket_name_length()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nbegin\n if length(new.name) > 100 then\n raise exception 'bucket name "%" is too long (% characters). Max is 100.', new.name, length(new.name);\n end if;\n return new;\nend;\n$function$\n" }, { "schema_name": "storage", "routine_name": "extension", "routine_type": "FUNCTION", "language": "plpgsql", "args": "name text", "definition": "CREATE OR REPLACE FUNCTION storage.extension(name text)\n RETURNS text\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n_parts text[];\n_filename text;\nBEGIN\n\tselect string_to_array(name, '/') into _parts;\n\tselect _parts[array_length(_parts,1)] into _filename;\n\t-- @todo return the last part instead of 2\n\treturn reverse(split_part(reverse(_filename), '.', 1));\nEND\n$function$\n" }, { "schema_name": "storage", "routine_name": "filename", "routine_type": "FUNCTION", "language": "plpgsql", "args": "name text", "definition": "CREATE OR REPLACE FUNCTION storage.filename(name text)\n RETURNS text\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n_parts text[];\nBEGIN\n\tselect string_to_array(name, '/') into _parts;\n\treturn _parts[array_length(_parts,1)];\nEND\n$function$\n" }, { "schema_name": "storage", "routine_name": "foldername", "routine_type": "FUNCTION", "language": "plpgsql", "args": "name text", "definition": "CREATE OR REPLACE FUNCTION storage.foldername(name text)\n RETURNS text[]\n LANGUAGE plpgsql\nAS $function$\nDECLARE\n_parts text[];\nBEGIN\n\tselect string_to_array(name, '/') into _parts;\n\treturn _parts[1:array_length(_parts,1)-1];\nEND\n$function$\n" }, { "schema_name": "storage", "routine_name": "get_common_prefix", "routine_type": "FUNCTION", "language": "sql", "args": "p_key text, p_prefix text, p_delimiter text", "definition": "CREATE OR REPLACE FUNCTION storage.get_common_prefix(p_key text, p_prefix text, p_delimiter text)\n RETURNS text\n LANGUAGE sql\n IMMUTABLE\nAS $function$\nSELECT CASE\n WHEN position(p_delimiter IN substring(p_key FROM length(p_prefix) + 1)) > 0\n THEN left(p_key, length(p_prefix) + position(p_delimiter IN substring(p_key FROM length(p_prefix) + 1)))\n ELSE NULL\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "get_size_by_bucket", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION storage.get_size_by_bucket()\n RETURNS TABLE(size bigint, bucket_id text)\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n return query\n select sum((metadata->>'size')::int) as size, obj.bucket_id\n from "storage".objects as obj\n group by obj.bucket_id;\nEND\n$function$\n" }, { "schema_name": "storage", "routine_name": "list_multipart_uploads_with_delimiter", "routine_type": "FUNCTION", "language": "plpgsql", "args": "bucket_id text, prefix_param text, delimiter_param text, max_keys integer, next_key_token text, next_upload_token text", "definition": "CREATE OR REPLACE FUNCTION storage.list_multipart_uploads_with_delimiter(bucket_id text, prefix_param text, delimiter_param text, max_keys integer DEFAULT 100, next_key_token text DEFAULT ''::text, next_upload_token text DEFAULT ''::text)\n RETURNS TABLE(key text, id text, created_at timestamp with time zone)\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n RETURN QUERY EXECUTE\n 'SELECT DISTINCT ON(key COLLATE "C") * from (\n SELECT\n CASE\n WHEN position($2 IN substring(key from length($1) + 1)) > 0 THEN\n substring(key from 1 for length($1) + position($2 IN substring(key from length($1) + 1)))\n ELSE\n key\n END AS key, id, created_at\n FROM\n storage.s3_multipart_uploads\n WHERE\n bucket_id = $5 AND\n key ILIKE $1 || ''%'' AND\n CASE\n WHEN $4 != '''' AND $6 = '''' THEN\n CASE\n WHEN position($2 IN substring(key from length($1) + 1)) > 0 THEN\n substring(key from 1 for length($1) + position($2 IN substring(key from length($1) + 1))) COLLATE "C" > $4\n ELSE\n key COLLATE "C" > $4\n END\n ELSE\n true\n END AND\n CASE\n WHEN $6 != '''' THEN\n id COLLATE "C" > $6\n ELSE\n true\n END\n ORDER BY\n key COLLATE "C" ASC, created_at ASC) as e order by key COLLATE "C" LIMIT $3'\n USING prefix_param, delimiter_param, max_keys, next_key_token, bucket_id, next_upload_token;\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "list_objects_with_delimiter", "routine_type": "FUNCTION", "language": "plpgsql", "args": "_bucket_id text, prefix_param text, delimiter_param text, max_keys integer, start_after text, next_token text, sort_order text", "definition": "CREATE OR REPLACE FUNCTION storage.list_objects_with_delimiter(_bucket_id text, prefix_param text, delimiter_param text, max_keys integer DEFAULT 100, start_after text DEFAULT ''::text, next_token text DEFAULT ''::text, sort_order text DEFAULT 'asc'::text)\n RETURNS TABLE(name text, id uuid, metadata jsonb, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone)\n LANGUAGE plpgsql\n STABLE\nAS $function$\nDECLARE\n v_peek_name TEXT;\n v_current RECORD;\n v_common_prefix TEXT;\n\n -- Configuration\n v_is_asc BOOLEAN;\n v_prefix TEXT;\n v_start TEXT;\n v_upper_bound TEXT;\n v_file_batch_size INT;\n\n -- Seek state\n v_next_seek TEXT;\n v_count INT := 0;\n\n -- Dynamic SQL for batch query only\n v_batch_query TEXT;\n\nBEGIN\n -- ========================================================================\n -- INITIALIZATION\n -- ========================================================================\n v_is_asc := lower(coalesce(sort_order, 'asc')) = 'asc';\n v_prefix := coalesce(prefix_param, '');\n v_start := CASE WHEN coalesce(next_token, '') <> '' THEN next_token ELSE coalesce(start_after, '') END;\n v_file_batch_size := LEAST(GREATEST(max_keys * 2, 100), 1000);\n\n -- Calculate upper bound for prefix filtering (bytewise, using COLLATE "C")\n IF v_prefix = '' THEN\n v_upper_bound := NULL;\n ELSIF right(v_prefix, 1) = delimiter_param THEN\n v_upper_bound := left(v_prefix, -1) || chr(ascii(delimiter_param) + 1);\n ELSE\n v_upper_bound := left(v_prefix, -1) || chr(ascii(right(v_prefix, 1)) + 1);\n END IF;\n\n -- Build batch query (dynamic SQL - called infrequently, amortized over many rows)\n IF v_is_asc THEN\n IF v_upper_bound IS NOT NULL THEN\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND o.name COLLATE "C" >= $2 ' ||\n 'AND o.name COLLATE "C" < $3 ORDER BY o.name COLLATE "C" ASC LIMIT $4';\n ELSE\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND o.name COLLATE "C" >= $2 ' ||\n 'ORDER BY o.name COLLATE "C" ASC LIMIT $4';\n END IF;\n ELSE\n IF v_upper_bound IS NOT NULL THEN\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND o.name COLLATE "C" < $2 ' ||\n 'AND o.name COLLATE "C" >= $3 ORDER BY o.name COLLATE "C" DESC LIMIT $4';\n ELSE\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND o.name COLLATE "C" < $2 ' ||\n 'ORDER BY o.name COLLATE "C" DESC LIMIT $4';\n END IF;\n END IF;\n\n -- ========================================================================\n -- SEEK INITIALIZATION: Determine starting position\n -- ========================================================================\n IF v_start = '' THEN\n IF v_is_asc THEN\n v_next_seek := v_prefix;\n ELSE\n -- DESC without cursor: find the last item in range\n IF v_upper_bound IS NOT NULL THEN\n SELECT o.name INTO v_next_seek FROM storage.objects o\n WHERE o.bucket_id = _bucket_id AND o.name COLLATE "C" >= v_prefix AND o.name COLLATE "C" < v_upper_bound\n ORDER BY o.name COLLATE "C" DESC LIMIT 1;\n ELSIF v_prefix <> '' THEN\n SELECT o.name INTO v_next_seek FROM storage.objects o\n WHERE o.bucket_id = _bucket_id AND o.name COLLATE "C" >= v_prefix\n ORDER BY o.name COLLATE "C" DESC LIMIT 1;\n ELSE\n SELECT o.name INTO v_next_seek FROM storage.objects o\n WHERE o.bucket_id = _bucket_id\n ORDER BY o.name COLLATE "C" DESC LIMIT 1;\n END IF;\n\n IF v_next_seek IS NOT NULL THEN\n v_next_seek := v_next_seek || delimiter_param;\n ELSE\n RETURN;\n END IF;\n END IF;\n ELSE\n -- Cursor provided: determine if it refers to a folder or leaf\n IF EXISTS (\n SELECT 1 FROM storage.objects o\n WHERE o.bucket_id = _bucket_id\n AND o.name COLLATE "C" LIKE v_start || delimiter_param || '%'\n LIMIT 1\n ) THEN\n -- Cursor refers to a folder\n IF v_is_asc THEN\n v_next_seek := v_start || chr(ascii(delimiter_param) + 1);\n ELSE\n v_next_seek := v_start || delimiter_param;\n END IF;\n ELSE\n -- Cursor refers to a leaf object\n IF v_is_asc THEN\n v_next_seek := v_start || delimiter_param;\n ELSE\n v_next_seek := v_start;\n END IF;\n END IF;\n END IF;\n\n -- ========================================================================\n -- MAIN LOOP: Hybrid peek-then-batch algorithm\n -- Uses STATIC SQL for peek (hot path) and DYNAMIC SQL for batch\n -- ========================================================================\n LOOP\n EXIT WHEN v_count >= max_keys;\n\n -- STEP 1: PEEK using STATIC SQL (plan cached, very fast)\n IF v_is_asc THEN\n IF v_upper_bound IS NOT NULL THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = _bucket_id AND o.name COLLATE "C" >= v_next_seek AND o.name COLLATE "C" < v_upper_bound\n ORDER BY o.name COLLATE "C" ASC LIMIT 1;\n ELSE\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = _bucket_id AND o.name COLLATE "C" >= v_next_seek\n ORDER BY o.name COLLATE "C" ASC LIMIT 1;\n END IF;\n ELSE\n IF v_upper_bound IS NOT NULL THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = _bucket_id AND o.name COLLATE "C" < v_next_seek AND o.name COLLATE "C" >= v_prefix\n ORDER BY o.name COLLATE "C" DESC LIMIT 1;\n ELSIF v_prefix <> '' THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = _bucket_id AND o.name COLLATE "C" < v_next_seek AND o.name COLLATE "C" >= v_prefix\n ORDER BY o.name COLLATE "C" DESC LIMIT 1;\n ELSE\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = _bucket_id AND o.name COLLATE "C" < v_next_seek\n ORDER BY o.name COLLATE "C" DESC LIMIT 1;\n END IF;\n END IF;\n\n EXIT WHEN v_peek_name IS NULL;\n\n -- STEP 2: Check if this is a FOLDER or FILE\n v_common_prefix := storage.get_common_prefix(v_peek_name, v_prefix, delimiter_param);\n\n IF v_common_prefix IS NOT NULL THEN\n -- FOLDER: Emit and skip to next folder (no heap access needed)\n name := rtrim(v_common_prefix, delimiter_param);\n id := NULL;\n updated_at := NULL;\n created_at := NULL;\n last_accessed_at := NULL;\n metadata := NULL;\n RETURN NEXT;\n v_count := v_count + 1;\n\n -- Advance seek past the folder range\n IF v_is_asc THEN\n v_next_seek := left(v_common_prefix, -1) || chr(ascii(delimiter_param) + 1);\n ELSE\n v_next_seek := v_common_prefix;\n END IF;\n ELSE\n -- FILE: Batch fetch using DYNAMIC SQL (overhead amortized over many rows)\n -- For ASC: upper_bound is the exclusive upper limit (< condition)\n -- For DESC: prefix is the inclusive lower limit (>= condition)\n FOR v_current IN EXECUTE v_batch_query USING _bucket_id, v_next_seek,\n CASE WHEN v_is_asc THEN COALESCE(v_upper_bound, v_prefix) ELSE v_prefix END, v_file_batch_size\n LOOP\n v_common_prefix := storage.get_common_prefix(v_current.name, v_prefix, delimiter_param);\n\n IF v_common_prefix IS NOT NULL THEN\n -- Hit a folder: exit batch, let peek handle it\n v_next_seek := v_current.name;\n EXIT;\n END IF;\n\n -- Emit file\n name := v_current.name;\n id := v_current.id;\n updated_at := v_current.updated_at;\n created_at := v_current.created_at;\n last_accessed_at := v_current.last_accessed_at;\n metadata := v_current.metadata;\n RETURN NEXT;\n v_count := v_count + 1;\n\n -- Advance seek past this file\n IF v_is_asc THEN\n v_next_seek := v_current.name || delimiter_param;\n ELSE\n v_next_seek := v_current.name;\n END IF;\n\n EXIT WHEN v_count >= max_keys;\n END LOOP;\n END IF;\n END LOOP;\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "operation", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION storage.operation()\n RETURNS text\n LANGUAGE plpgsql\n STABLE\nAS $function$\nBEGIN\n RETURN current_setting('storage.operation', true);\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "protect_delete", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION storage.protect_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n -- Check if storage.allow_delete_query is set to 'true'\n IF COALESCE(current_setting('storage.allow_delete_query', true), 'false') != 'true' THEN\n RAISE EXCEPTION 'Direct deletion from storage tables is not allowed. Use the Storage API instead.'\n USING HINT = 'This prevents accidental data loss from orphaned objects.',\n ERRCODE = '42501';\n END IF;\n RETURN NULL;\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "search", "routine_type": "FUNCTION", "language": "plpgsql", "args": "prefix text, bucketname text, limits integer, levels integer, offsets integer, search text, sortcolumn text, sortorder text", "definition": "CREATE OR REPLACE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0, search text DEFAULT ''::text, sortcolumn text DEFAULT 'name'::text, sortorder text DEFAULT 'asc'::text)\n RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb)\n LANGUAGE plpgsql\n STABLE\nAS $function$\nDECLARE\n v_peek_name TEXT;\n v_current RECORD;\n v_common_prefix TEXT;\n v_delimiter CONSTANT TEXT := '/';\n\n -- Configuration\n v_limit INT;\n v_prefix TEXT;\n v_prefix_lower TEXT;\n v_is_asc BOOLEAN;\n v_order_by TEXT;\n v_sort_order TEXT;\n v_upper_bound TEXT;\n v_file_batch_size INT;\n\n -- Dynamic SQL for batch query only\n v_batch_query TEXT;\n\n -- Seek state\n v_next_seek TEXT;\n v_count INT := 0;\n v_skipped INT := 0;\nBEGIN\n -- ========================================================================\n -- INITIALIZATION\n -- ========================================================================\n v_limit := LEAST(coalesce(limits, 100), 1500);\n v_prefix := coalesce(prefix, '') || coalesce(search, '');\n v_prefix_lower := lower(v_prefix);\n v_is_asc := lower(coalesce(sortorder, 'asc')) = 'asc';\n v_file_batch_size := LEAST(GREATEST(v_limit * 2, 100), 1000);\n\n -- Validate sort column\n CASE lower(coalesce(sortcolumn, 'name'))\n WHEN 'name' THEN v_order_by := 'name';\n WHEN 'updated_at' THEN v_order_by := 'updated_at';\n WHEN 'created_at' THEN v_order_by := 'created_at';\n WHEN 'last_accessed_at' THEN v_order_by := 'last_accessed_at';\n ELSE v_order_by := 'name';\n END CASE;\n\n v_sort_order := CASE WHEN v_is_asc THEN 'asc' ELSE 'desc' END;\n\n -- ========================================================================\n -- NON-NAME SORTING: Use path_tokens approach (unchanged)\n -- ========================================================================\n IF v_order_by != 'name' THEN\n RETURN QUERY EXECUTE format(\n $sql$\n WITH folders AS (\n SELECT path_tokens[$1] AS folder\n FROM storage.objects\n WHERE objects.name ILIKE $2 || '%%'\n AND bucket_id = $3\n AND array_length(objects.path_tokens, 1) <> $1\n GROUP BY folder\n ORDER BY folder %s\n )\n (SELECT folder AS "name",\n NULL::uuid AS id,\n NULL::timestamptz AS updated_at,\n NULL::timestamptz AS created_at,\n NULL::timestamptz AS last_accessed_at,\n NULL::jsonb AS metadata FROM folders)\n UNION ALL\n (SELECT path_tokens[$1] AS "name",\n id, updated_at, created_at, last_accessed_at, metadata\n FROM storage.objects\n WHERE objects.name ILIKE $2 || '%%'\n AND bucket_id = $3\n AND array_length(objects.path_tokens, 1) = $1\n ORDER BY %I %s)\n LIMIT $4 OFFSET $5\n sql, v_sort_order, v_order_by, v_sort_order\n ) USING levels, v_prefix, bucketname, v_limit, offsets;\n RETURN;\n END IF;\n\n -- ========================================================================\n -- NAME SORTING: Hybrid skip-scan with batch optimization\n -- ========================================================================\n\n -- Calculate upper bound for prefix filtering\n IF v_prefix_lower = '' THEN\n v_upper_bound := NULL;\n ELSIF right(v_prefix_lower, 1) = v_delimiter THEN\n v_upper_bound := left(v_prefix_lower, -1) || chr(ascii(v_delimiter) + 1);\n ELSE\n v_upper_bound := left(v_prefix_lower, -1) || chr(ascii(right(v_prefix_lower, 1)) + 1);\n END IF;\n\n -- Build batch query (dynamic SQL - called infrequently, amortized over many rows)\n IF v_is_asc THEN\n IF v_upper_bound IS NOT NULL THEN\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND lower(o.name) COLLATE "C" >= $2 ' ||\n 'AND lower(o.name) COLLATE "C" < $3 ORDER BY lower(o.name) COLLATE "C" ASC LIMIT $4';\n ELSE\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND lower(o.name) COLLATE "C" >= $2 ' ||\n 'ORDER BY lower(o.name) COLLATE "C" ASC LIMIT $4';\n END IF;\n ELSE\n IF v_upper_bound IS NOT NULL THEN\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND lower(o.name) COLLATE "C" < $2 ' ||\n 'AND lower(o.name) COLLATE "C" >= $3 ORDER BY lower(o.name) COLLATE "C" DESC LIMIT $4';\n ELSE\n v_batch_query := 'SELECT o.name, o.id, o.updated_at, o.created_at, o.last_accessed_at, o.metadata ' ||\n 'FROM storage.objects o WHERE o.bucket_id = $1 AND lower(o.name) COLLATE "C" < $2 ' ||\n 'ORDER BY lower(o.name) COLLATE "C" DESC LIMIT $4';\n END IF;\n END IF;\n\n -- Initialize seek position\n IF v_is_asc THEN\n v_next_seek := v_prefix_lower;\n ELSE\n -- DESC: find the last item in range first (static SQL)\n IF v_upper_bound IS NOT NULL THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname AND lower(o.name) COLLATE "C" >= v_prefix_lower AND lower(o.name) COLLATE "C" < v_upper_bound\n ORDER BY lower(o.name) COLLATE "C" DESC LIMIT 1;\n ELSIF v_prefix_lower <> '' THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname AND lower(o.name) COLLATE "C" >= v_prefix_lower\n ORDER BY lower(o.name) COLLATE "C" DESC LIMIT 1;\n ELSE\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname\n ORDER BY lower(o.name) COLLATE "C" DESC LIMIT 1;\n END IF;\n\n IF v_peek_name IS NOT NULL THEN\n v_next_seek := lower(v_peek_name) || v_delimiter;\n ELSE\n RETURN;\n END IF;\n END IF;\n\n -- ========================================================================\n -- MAIN LOOP: Hybrid peek-then-batch algorithm\n -- Uses STATIC SQL for peek (hot path) and DYNAMIC SQL for batch\n -- ========================================================================\n LOOP\n EXIT WHEN v_count >= v_limit;\n\n -- STEP 1: PEEK using STATIC SQL (plan cached, very fast)\n IF v_is_asc THEN\n IF v_upper_bound IS NOT NULL THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname AND lower(o.name) COLLATE "C" >= v_next_seek AND lower(o.name) COLLATE "C" < v_upper_bound\n ORDER BY lower(o.name) COLLATE "C" ASC LIMIT 1;\n ELSE\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname AND lower(o.name) COLLATE "C" >= v_next_seek\n ORDER BY lower(o.name) COLLATE "C" ASC LIMIT 1;\n END IF;\n ELSE\n IF v_upper_bound IS NOT NULL THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname AND lower(o.name) COLLATE "C" < v_next_seek AND lower(o.name) COLLATE "C" >= v_prefix_lower\n ORDER BY lower(o.name) COLLATE "C" DESC LIMIT 1;\n ELSIF v_prefix_lower <> '' THEN\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname AND lower(o.name) COLLATE "C" < v_next_seek AND lower(o.name) COLLATE "C" >= v_prefix_lower\n ORDER BY lower(o.name) COLLATE "C" DESC LIMIT 1;\n ELSE\n SELECT o.name INTO v_peek_name FROM storage.objects o\n WHERE o.bucket_id = bucketname AND lower(o.name) COLLATE "C" < v_next_seek\n ORDER BY lower(o.name) COLLATE "C" DESC LIMIT 1;\n END IF;\n END IF;\n\n EXIT WHEN v_peek_name IS NULL;\n\n -- STEP 2: Check if this is a FOLDER or FILE\n v_common_prefix := storage.get_common_prefix(lower(v_peek_name), v_prefix_lower, v_delimiter);\n\n IF v_common_prefix IS NOT NULL THEN\n -- FOLDER: Handle offset, emit if needed, skip to next folder\n IF v_skipped < offsets THEN\n v_skipped := v_skipped + 1;\n ELSE\n name := split_part(rtrim(storage.get_common_prefix(v_peek_name, v_prefix, v_delimiter), v_delimiter), v_delimiter, levels);\n id := NULL;\n updated_at := NULL;\n created_at := NULL;\n last_accessed_at := NULL;\n metadata := NULL;\n RETURN NEXT;\n v_count := v_count + 1;\n END IF;\n\n -- Advance seek past the folder range\n IF v_is_asc THEN\n v_next_seek := lower(left(v_common_prefix, -1)) || chr(ascii(v_delimiter) + 1);\n ELSE\n v_next_seek := lower(v_common_prefix);\n END IF;\n ELSE\n -- FILE: Batch fetch using DYNAMIC SQL (overhead amortized over many rows)\n -- For ASC: upper_bound is the exclusive upper limit (< condition)\n -- For DESC: prefix_lower is the inclusive lower limit (>= condition)\n FOR v_current IN EXECUTE v_batch_query\n USING bucketname, v_next_seek,\n CASE WHEN v_is_asc THEN COALESCE(v_upper_bound, v_prefix_lower) ELSE v_prefix_lower END, v_file_batch_size\n LOOP\n v_common_prefix := storage.get_common_prefix(lower(v_current.name), v_prefix_lower, v_delimiter);\n\n IF v_common_prefix IS NOT NULL THEN\n -- Hit a folder: exit batch, let peek handle it\n v_next_seek := lower(v_current.name);\n EXIT;\n END IF;\n\n -- Handle offset skipping\n IF v_skipped < offsets THEN\n v_skipped := v_skipped + 1;\n ELSE\n -- Emit file\n name := split_part(v_current.name, v_delimiter, levels);\n id := v_current.id;\n updated_at := v_current.updated_at;\n created_at := v_current.created_at;\n last_accessed_at := v_current.last_accessed_at;\n metadata := v_current.metadata;\n RETURN NEXT;\n v_count := v_count + 1;\n END IF;\n\n -- Advance seek past this file\n IF v_is_asc THEN\n v_next_seek := lower(v_current.name) || v_delimiter;\n ELSE\n v_next_seek := lower(v_current.name);\n END IF;\n\n EXIT WHEN v_count >= v_limit;\n END LOOP;\n END IF;\n END LOOP;\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "search_by_timestamp", "routine_type": "FUNCTION", "language": "plpgsql", "args": "p_prefix text, p_bucket_id text, p_limit integer, p_level integer, p_start_after text, p_sort_order text, p_sort_column text, p_sort_column_after text", "definition": "CREATE OR REPLACE FUNCTION storage.search_by_timestamp(p_prefix text, p_bucket_id text, p_limit integer, p_level integer, p_start_after text, p_sort_order text, p_sort_column text, p_sort_column_after text)\n RETURNS TABLE(key text, name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb)\n LANGUAGE plpgsql\n STABLE\nAS $function$\nDECLARE\n v_cursor_op text;\n v_query text;\n v_prefix text;\nBEGIN\n v_prefix := coalesce(p_prefix, '');\n\n IF p_sort_order = 'asc' THEN\n v_cursor_op := '>';\n ELSE\n v_cursor_op := '<';\n END IF;\n\n v_query := format($sql$\n WITH raw_objects AS (\n SELECT\n o.name AS obj_name,\n o.id AS obj_id,\n o.updated_at AS obj_updated_at,\n o.created_at AS obj_created_at,\n o.last_accessed_at AS obj_last_accessed_at,\n o.metadata AS obj_metadata,\n storage.get_common_prefix(o.name, $1, '/') AS common_prefix\n FROM storage.objects o\n WHERE o.bucket_id = $2\n AND o.name COLLATE "C" LIKE $1 || '%%'\n ),\n -- Aggregate common prefixes (folders)\n -- Both created_at and updated_at use MIN(obj_created_at) to match the old prefixes table behavior\n aggregated_prefixes AS (\n SELECT\n rtrim(common_prefix, '/') AS name,\n NULL::uuid AS id,\n MIN(obj_created_at) AS updated_at,\n MIN(obj_created_at) AS created_at,\n NULL::timestamptz AS last_accessed_at,\n NULL::jsonb AS metadata,\n TRUE AS is_prefix\n FROM raw_objects\n WHERE common_prefix IS NOT NULL\n GROUP BY common_prefix\n ),\n leaf_objects AS (\n SELECT\n obj_name AS name,\n obj_id AS id,\n obj_updated_at AS updated_at,\n obj_created_at AS created_at,\n obj_last_accessed_at AS last_accessed_at,\n obj_metadata AS metadata,\n FALSE AS is_prefix\n FROM raw_objects\n WHERE common_prefix IS NULL\n ),\n combined AS (\n SELECT * FROM aggregated_prefixes\n UNION ALL\n SELECT * FROM leaf_objects\n ),\n filtered AS (\n SELECT *\n FROM combined\n WHERE (\n $5 = ''\n OR ROW(\n date_trunc('milliseconds', %I),\n name COLLATE "C"\n ) %s ROW(\n COALESCE(NULLIF($6, '')::timestamptz, 'epoch'::timestamptz),\n $5\n )\n )\n )\n SELECT\n split_part(name, '/', $3) AS key,\n name,\n id,\n updated_at,\n created_at,\n last_accessed_at,\n metadata\n FROM filtered\n ORDER BY\n COALESCE(date_trunc('milliseconds', %I), 'epoch'::timestamptz) %s,\n name COLLATE "C" %s\n LIMIT $4\n sql,\n p_sort_column,\n v_cursor_op,\n p_sort_column,\n p_sort_order,\n p_sort_order\n );\n\n RETURN QUERY EXECUTE v_query\n USING v_prefix, p_bucket_id, p_level, p_limit, p_start_after, p_sort_column_after;\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "search_v2", "routine_type": "FUNCTION", "language": "plpgsql", "args": "prefix text, bucket_name text, limits integer, levels integer, start_after text, sort_order text, sort_column text, sort_column_after text", "definition": "CREATE OR REPLACE FUNCTION storage.search_v2(prefix text, bucket_name text, limits integer DEFAULT 100, levels integer DEFAULT 1, start_after text DEFAULT ''::text, sort_order text DEFAULT 'asc'::text, sort_column text DEFAULT 'name'::text, sort_column_after text DEFAULT ''::text)\n RETURNS TABLE(key text, name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb)\n LANGUAGE plpgsql\n STABLE\nAS $function$\nDECLARE\n v_sort_col text;\n v_sort_ord text;\n v_limit int;\nBEGIN\n -- Cap limit to maximum of 1500 records\n v_limit := LEAST(coalesce(limits, 100), 1500);\n\n -- Validate and normalize sort_order\n v_sort_ord := lower(coalesce(sort_order, 'asc'));\n IF v_sort_ord NOT IN ('asc', 'desc') THEN\n v_sort_ord := 'asc';\n END IF;\n\n -- Validate and normalize sort_column\n v_sort_col := lower(coalesce(sort_column, 'name'));\n IF v_sort_col NOT IN ('name', 'updated_at', 'created_at') THEN\n v_sort_col := 'name';\n END IF;\n\n -- Route to appropriate implementation\n IF v_sort_col = 'name' THEN\n -- Use list_objects_with_delimiter for name sorting (most efficient: O(k * log n))\n RETURN QUERY\n SELECT\n split_part(l.name, '/', levels) AS key,\n l.name AS name,\n l.id,\n l.updated_at,\n l.created_at,\n l.last_accessed_at,\n l.metadata\n FROM storage.list_objects_with_delimiter(\n bucket_name,\n coalesce(prefix, ''),\n '/',\n v_limit,\n start_after,\n '',\n v_sort_ord\n ) l;\n ELSE\n -- Use aggregation approach for timestamp sorting\n -- Not efficient for large datasets but supports correct pagination\n RETURN QUERY SELECT * FROM storage.search_by_timestamp(\n prefix, bucket_name, v_limit, levels, start_after,\n v_sort_ord, v_sort_col, sort_column_after\n );\n END IF;\nEND;\n$function$\n" }, { "schema_name": "storage", "routine_name": "update_updated_at_column", "routine_type": "FUNCTION", "language": "plpgsql", "args": "", "definition": "CREATE OR REPLACE FUNCTION storage.update_updated_at_column()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n NEW.updated_at = now();\n RETURN NEW; \nEND;\n$function$\n" }, { "schema_name": "vault", "routine_name": "_crypto_aead_det_decrypt", "routine_type": "FUNCTION", "language": "c", "args": "message bytea, additional bytea, key_id bigint, context bytea, nonce bytea", "definition": "CREATE OR REPLACE FUNCTION vault._crypto_aead_det_decrypt(message bytea, additional bytea, key_id bigint, context bytea DEFAULT '\x7067736f6469756d'::bytea, nonce bytea DEFAULT NULL::bytea)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE\nAS '$libdir/supabase_vault', $function$pgsodium_crypto_aead_det_decrypt_by_id$function$\n" }, { "schema_name": "vault", "routine_name": "_crypto_aead_det_encrypt", "routine_type": "FUNCTION", "language": "c", "args": "message bytea, additional bytea, key_id bigint, context bytea, nonce bytea", "definition": "CREATE OR REPLACE FUNCTION vault._crypto_aead_det_encrypt(message bytea, additional bytea, key_id bigint, context bytea DEFAULT '\x7067736f6469756d'::bytea, nonce bytea DEFAULT NULL::bytea)\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE\nAS '$libdir/supabase_vault', $function$pgsodium_crypto_aead_det_encrypt_by_id$function$\n" }, { "schema_name": "vault", "routine_name": "_crypto_aead_det_noncegen", "routine_type": "FUNCTION", "language": "c", "args": "", "definition": "CREATE OR REPLACE FUNCTION vault._crypto_aead_det_noncegen()\n RETURNS bytea\n LANGUAGE c\n IMMUTABLE\nAS '$libdir/supabase_vault', $function$pgsodium_crypto_aead_det_noncegen$function$\n" }, { "schema_name": "vault", "routine_name": "create_secret", "routine_type": "FUNCTION", "language": "plpgsql", "args": "new_secret text, new_name text, new_description text, new_key_id uuid", "definition": "CREATE OR REPLACE FUNCTION vault.create_secret(new_secret text, new_name text DEFAULT NULL::text, new_description text DEFAULT ''::text, new_key_id uuid DEFAULT NULL::uuid)\n RETURNS uuid\n LANGUAGE plpgsql\n SECURITY DEFINER\n SET search_path TO ''\nAS $function$\nDECLARE\n rec record;\nBEGIN\n INSERT INTO vault.secrets (secret, name, description)\n VALUES (\n new_secret,\n new_name,\n new_description\n )\n RETURNING * INTO rec;\n UPDATE vault.secrets s\n SET secret = encode(vault._crypto_aead_det_encrypt(\n message := convert_to(rec.secret, 'utf8'),\n additional := convert_to(s.id::text, 'utf8'),\n key_id := 0,\n context := 'pgsodium'::bytea,\n nonce := rec.nonce\n ), 'base64')\n WHERE id = rec.id;\n RETURN rec.id;\nEND\n$function$\n" }, { "schema_name": "vault", "routine_name": "update_secret", "routine_type": "FUNCTION", "language": "plpgsql", "args": "secret_id uuid, new_secret text, new_name text, new_description text, new_key_id uuid", "definition": "CREATE OR REPLACE FUNCTION vault.update_secret(secret_id uuid, new_secret text DEFAULT NULL::text, new_name text DEFAULT NULL::text, new_description text DEFAULT NULL::text, new_key_id uuid DEFAULT NULL::uuid)\n RETURNS void\n LANGUAGE plpgsql\n SECURITY DEFINER\n SET search_path TO ''\nAS $function$\nDECLARE\n decrypted_secret text := (SELECT decrypted_secret FROM vault.decrypted_secrets WHERE id = secret_id);\nBEGIN\n UPDATE vault.secrets s\n SET\n secret = CASE WHEN new_secret IS NULL THEN s.secret\n ELSE encode(vault._crypto_aead_det_encrypt(\n message := convert_to(new_secret, 'utf8'),\n additional := convert_to(s.id::text, 'utf8'),\n key_id := 0,\n context := 'pgsodium'::bytea,\n nonce := s.nonce\n ), 'base64') END,\n name = coalesce(new_name, s.name),\n description = coalesce(new_description, s.description),\n updated_at = now()\n WHERE s.id = secret_id;\nEND\n$function$\n" } ]

[ { "schema_name": "public", "table_name": "car_votes", "trigger_name": "on_car_vote_inserted", "definition": "CREATE TRIGGER on_car_vote_inserted AFTER INSERT ON car_votes FOR EACH ROW EXECUTE FUNCTION handle_new_car_vote()" }, { "schema_name": "public", "table_name": "car_votes", "trigger_name": "trigger_check_car_verification", "definition": "CREATE TRIGGER trigger_check_car_verification AFTER INSERT ON car_votes FOR EACH ROW EXECUTE FUNCTION update_car_verification()" }, { "schema_name": "realtime", "table_name": "subscription", "trigger_name": "tr_check_filters", "definition": "CREATE TRIGGER tr_check_filters BEFORE INSERT OR UPDATE ON realtime.subscription FOR EACH ROW EXECUTE FUNCTION realtime.subscription_check_filters()" }, { "schema_name": "storage", "table_name": "buckets", "trigger_name": "enforce_bucket_name_length_trigger", "definition": "CREATE TRIGGER enforce_bucket_name_length_trigger BEFORE INSERT OR UPDATE OF name ON storage.buckets FOR EACH ROW EXECUTE FUNCTION storage.enforce_bucket_name_length()" }, { "schema_name": "storage", "table_name": "buckets", "trigger_name": "protect_buckets_delete", "definition": "CREATE TRIGGER protect_buckets_delete BEFORE DELETE ON storage.buckets FOR EACH STATEMENT EXECUTE FUNCTION storage.protect_delete()" }, { "schema_name": "storage", "table_name": "objects", "trigger_name": "protect_objects_delete", "definition": "CREATE TRIGGER protect_objects_delete BEFORE DELETE ON storage.objects FOR EACH STATEMENT EXECUTE FUNCTION storage.protect_delete()" }, { "schema_name": "storage", "table_name": "objects", "trigger_name": "update_objects_updated_at", "definition": "CREATE TRIGGER update_objects_updated_at BEFORE UPDATE ON storage.objects FOR EACH ROW EXECUTE FUNCTION storage.update_updated_at_column()" } ]

[ { "schema_name": "auth", "table_name": "audit_log_entries", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "custom_oauth_providers", "rls_enabled": false, "rls_forced": false }, { "schema_name": "auth", "table_name": "flow_state", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "identities", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "instances", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "mfa_amr_claims", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "mfa_challenges", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "mfa_factors", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "oauth_authorizations", "rls_enabled": false, "rls_forced": false }, { "schema_name": "auth", "table_name": "oauth_client_states", "rls_enabled": false, "rls_forced": false }, { "schema_name": "auth", "table_name": "oauth_clients", "rls_enabled": false, "rls_forced": false }, { "schema_name": "auth", "table_name": "oauth_consents", "rls_enabled": false, "rls_forced": false }, { "schema_name": "auth", "table_name": "one_time_tokens", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "refresh_tokens", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "saml_providers", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "saml_relay_states", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "schema_migrations", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "sessions", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "sso_domains", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "sso_providers", "rls_enabled": true, "rls_forced": false }, { "schema_name": "auth", "table_name": "users", "rls_enabled": true, "rls_forced": false }, { "schema_name": "public", "table_name": "car_reports", "rls_enabled": true, "rls_forced": false }, { "schema_name": "public", "table_name": "car_votes", "rls_enabled": true, "rls_forced": false }, { "schema_name": "public", "table_name": "collection_members", "rls_enabled": true, "rls_forced": false }, { "schema_name": "public", "table_name": "collections", "rls_enabled": true, "rls_forced": false }, { "schema_name": "public", "table_name": "global_cars", "rls_enabled": true, "rls_forced": false }, { "schema_name": "public", "table_name": "hotwheels", "rls_enabled": true, "rls_forced": false }, { "schema_name": "realtime", "table_name": "schema_migrations", "rls_enabled": false, "rls_forced": false }, { "schema_name": "realtime", "table_name": "subscription", "rls_enabled": false, "rls_forced": false }, { "schema_name": "storage", "table_name": "buckets", "rls_enabled": true, "rls_forced": false }, { "schema_name": "storage", "table_name": "buckets_analytics", "rls_enabled": true, "rls_forced": false }, { "schema_name": "storage", "table_name": "buckets_vectors", "rls_enabled": true, "rls_forced": false }, { "schema_name": "storage", "table_name": "migrations", "rls_enabled": true, "rls_forced": false }, { "schema_name": "storage", "table_name": "objects", "rls_enabled": true, "rls_forced": false }, { "schema_name": "storage", "table_name": "s3_multipart_uploads", "rls_enabled": true, "rls_forced": false }, { "schema_name": "storage", "table_name": "s3_multipart_uploads_parts", "rls_enabled": true, "rls_forced": false }, { "schema_name": "storage", "table_name": "vector_indexes", "rls_enabled": true, "rls_forced": false }, { "schema_name": "vault", "table_name": "secrets", "rls_enabled": false, "rls_forced": false } ]

[ { "schemaname": "public", "tablename": "car_reports", "policyname": "Users can create own car reports", "permissive": "PERMISSIVE", "roles": "{public}", "cmd": "INSERT", "qual": null, "with_check": "(reporter_user_id = auth.uid())" }, { "schemaname": "public", "tablename": "car_reports", "policyname": "Users can view own car reports", "permissive": "PERMISSIVE", "roles": "{public}", "cmd": "SELECT", "qual": "(reporter_user_id = auth.uid())", "with_check": null }, { "schemaname": "public", "tablename": "car_votes", "policyname": "Authenticated users can only vote for themselves", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "INSERT", "qual": null, "with_check": "(auth.uid() = user_id)" }, { "schemaname": "public", "tablename": "car_votes", "policyname": "Authenticated users can view votes", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "SELECT", "qual": "true", "with_check": null }, { "schemaname": "public", "tablename": "collection_members", "policyname": "Owner can add members", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "INSERT", "qual": null, "with_check": "(collection_id IN ( SELECT collections.id\n FROM collections\n WHERE (collections.owner_id = auth.uid())))" }, { "schemaname": "public", "tablename": "collection_members", "policyname": "Owner can remove members", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "DELETE", "qual": "((collection_id IN ( SELECT c.id\n FROM collections c\n WHERE (c.owner_id = auth.uid()))) OR (user_id = auth.uid()))", "with_check": null }, { "schemaname": "public", "tablename": "collection_members", "policyname": "Users can view own memberships", "permissive": "PERMISSIVE", "roles": "{public}", "cmd": "SELECT", "qual": "(user_id = auth.uid())", "with_check": null }, { "schemaname": "public", "tablename": "collections", "policyname": "Authenticated users can create collections", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "INSERT", "qual": null, "with_check": "(auth.uid() = owner_id)" }, { "schemaname": "public", "tablename": "collections", "policyname": "Members can view collections", "permissive": "PERMISSIVE", "roles": "{public}", "cmd": "SELECT", "qual": "((owner_id = auth.uid()) OR (EXISTS ( SELECT 1\n FROM collection_members cm\n WHERE ((cm.collection_id = collections.id) AND (cm.user_id = auth.uid())))))", "with_check": null }, { "schemaname": "public", "tablename": "collections", "policyname": "Owner can delete collection", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "DELETE", "qual": "(owner_id = auth.uid())", "with_check": null }, { "schemaname": "public", "tablename": "collections", "policyname": "Owner can update collection", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "UPDATE", "qual": "(owner_id = auth.uid())", "with_check": null }, { "schemaname": "public", "tablename": "global_cars", "policyname": "Authenticated users can insert global cars", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "INSERT", "qual": null, "with_check": "true" }, { "schemaname": "public", "tablename": "global_cars", "policyname": "Authenticated users can view global cars", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "SELECT", "qual": "true", "with_check": null }, { "schemaname": "public", "tablename": "hotwheels", "policyname": "Collection members can delete cars", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "DELETE", "qual": "(collection_id IN ( SELECT collection_members.collection_id\n FROM collection_members\n WHERE (collection_members.user_id = auth.uid())))", "with_check": null }, { "schemaname": "public", "tablename": "hotwheels", "policyname": "Collection members can insert cars", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "INSERT", "qual": null, "with_check": "(collection_id IN ( SELECT collection_members.collection_id\n FROM collection_members\n WHERE (collection_members.user_id = auth.uid())))" }, { "schemaname": "public", "tablename": "hotwheels", "policyname": "Collection members can update cars", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "UPDATE", "qual": "(collection_id IN ( SELECT collection_members.collection_id\n FROM collection_members\n WHERE (collection_members.user_id = auth.uid())))", "with_check": null }, { "schemaname": "public", "tablename": "hotwheels", "policyname": "Collection members can view cars", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "SELECT", "qual": "(collection_id IN ( SELECT collection_members.collection_id\n FROM collection_members\n WHERE (collection_members.user_id = auth.uid())))", "with_check": null }, { "schemaname": "storage", "tablename": "objects", "policyname": "Authenticated users can view images", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "SELECT", "qual": "(bucket_id = 'car-images'::text)", "with_check": null }, { "schemaname": "storage", "tablename": "objects", "policyname": "Users can delete their own car images", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "DELETE", "qual": "((bucket_id = 'car-images'::text) AND ((storage.foldername(name))[1] = (auth.uid())::text))", "with_check": null }, { "schemaname": "storage", "tablename": "objects", "policyname": "Users can upload their own car images", "permissive": "PERMISSIVE", "roles": "{authenticated}", "cmd": "INSERT", "qual": null, "with_check": "((bucket_id = 'car-images'::text) AND ((storage.foldername(name))[1] = (auth.uid())::text))" } ]

[ { "table_schema": "auth", "table_name": "audit_log_entries", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "audit_log_entries", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "audit_log_entries", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "audit_log_entries", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "audit_log_entries", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "audit_log_entries", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "audit_log_entries", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "custom_oauth_providers", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "flow_state", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "flow_state", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "flow_state", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "flow_state", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "flow_state", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "flow_state", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "flow_state", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "identities", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "identities", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "identities", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "identities", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "identities", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "identities", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "identities", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "instances", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "instances", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "instances", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "instances", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "instances", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "instances", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "instances", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_amr_claims", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_challenges", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_challenges", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_challenges", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_challenges", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_challenges", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_challenges", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_challenges", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_factors", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_factors", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_factors", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_factors", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_factors", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_factors", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "mfa_factors", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_authorizations", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_client_states", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_client_states", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_client_states", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_client_states", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_client_states", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_client_states", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_client_states", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_clients", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_clients", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_clients", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_clients", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_clients", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_clients", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_clients", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_consents", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_consents", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_consents", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_consents", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_consents", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_consents", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "oauth_consents", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "one_time_tokens", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "one_time_tokens", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "one_time_tokens", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "one_time_tokens", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "one_time_tokens", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "one_time_tokens", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "one_time_tokens", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "refresh_tokens", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "refresh_tokens", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "refresh_tokens", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "refresh_tokens", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "refresh_tokens", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "refresh_tokens", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "refresh_tokens", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_providers", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_providers", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_providers", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_providers", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_providers", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_providers", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_providers", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_relay_states", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_relay_states", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_relay_states", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_relay_states", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_relay_states", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_relay_states", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "saml_relay_states", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "schema_migrations", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sessions", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sessions", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sessions", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sessions", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sessions", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sessions", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sessions", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_domains", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_domains", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_domains", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_domains", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_domains", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_domains", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_domains", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_providers", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_providers", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_providers", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_providers", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_providers", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_providers", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "sso_providers", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "users", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "users", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "users", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "users", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "users", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "users", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "auth", "table_name": "users", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_hidden_indexes", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_hidden_indexes", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_hidden_indexes", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_hidden_indexes", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_hidden_indexes", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_hidden_indexes", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_hidden_indexes", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_list_indexes", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_list_indexes", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_list_indexes", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_list_indexes", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_list_indexes", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_list_indexes", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "hypopg_list_indexes", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "SELECT", "grantee": "PUBLIC" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "DELETE", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "INSERT", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "REFERENCES", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "SELECT", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "TRIGGER", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "TRUNCATE", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "UPDATE", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "SELECT", "grantee": "PUBLIC" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "DELETE", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "INSERT", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "REFERENCES", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "SELECT", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "TRIGGER", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "TRUNCATE", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "UPDATE", "grantee": "dashboard_user" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "extensions", "table_name": "pg_stat_statements_info", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_reports", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "car_votes", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collection_members", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "collections", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "global_cars", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "public", "table_name": "hotwheels", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "DELETE", "grantee": "dashboard_user" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "INSERT", "grantee": "dashboard_user" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "REFERENCES", "grantee": "dashboard_user" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "SELECT", "grantee": "dashboard_user" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "TRIGGER", "grantee": "dashboard_user" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "TRUNCATE", "grantee": "dashboard_user" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "UPDATE", "grantee": "dashboard_user" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "DELETE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "INSERT", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "REFERENCES", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "SELECT", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "TRIGGER", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "TRUNCATE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "messages", "privilege_type": "UPDATE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "DELETE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "INSERT", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "REFERENCES", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "SELECT", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "TRIGGER", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "TRUNCATE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "schema_migrations", "privilege_type": "UPDATE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "DELETE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "INSERT", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "REFERENCES", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "SELECT", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "TRIGGER", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "TRUNCATE", "grantee": "supabase_realtime_admin" }, { "table_schema": "realtime", "table_name": "subscription", "privilege_type": "UPDATE", "grantee": "supabase_realtime_admin" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_analytics", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "buckets_vectors", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "buckets_vectors", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "buckets_vectors", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "DELETE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "INSERT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "REFERENCES", "grantee": "anon" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRIGGER", "grantee": "anon" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRUNCATE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "UPDATE", "grantee": "anon" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "DELETE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "INSERT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "REFERENCES", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRIGGER", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRUNCATE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "UPDATE", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "INSERT", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRIGGER", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "UPDATE", "grantee": "postgres" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "objects", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "INSERT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "REFERENCES", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "TRIGGER", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "TRUNCATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "s3_multipart_uploads_parts", "privilege_type": "UPDATE", "grantee": "service_role" }, { "table_schema": "storage", "table_name": "vector_indexes", "privilege_type": "SELECT", "grantee": "anon" }, { "table_schema": "storage", "table_name": "vector_indexes", "privilege_type": "SELECT", "grantee": "authenticated" }, { "table_schema": "storage", "table_name": "vector_indexes", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "vault", "table_name": "decrypted_secrets", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "decrypted_secrets", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "decrypted_secrets", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "decrypted_secrets", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "decrypted_secrets", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "vault", "table_name": "decrypted_secrets", "privilege_type": "SELECT", "grantee": "service_role" }, { "table_schema": "vault", "table_name": "secrets", "privilege_type": "DELETE", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "secrets", "privilege_type": "REFERENCES", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "secrets", "privilege_type": "SELECT", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "secrets", "privilege_type": "TRUNCATE", "grantee": "postgres" }, { "table_schema": "vault", "table_name": "secrets", "privilege_type": "DELETE", "grantee": "service_role" }, { "table_schema": "vault", "table_name": "secrets", "privilege_type": "SELECT", "grantee": "service_role" } ]

[ { "routine_schema": "auth", "routine_name": "jwt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "armor", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "armor", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "armor", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "armor", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "armor", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "armor", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "crypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "crypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "crypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "dearmor", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "dearmor", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "dearmor", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "decrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "decrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "decrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "decrypt_iv", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "decrypt_iv", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "decrypt_iv", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "digest", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "digest", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "digest", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "digest", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "digest", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "digest", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "encrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "encrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "encrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "encrypt_iv", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "encrypt_iv", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "encrypt_iv", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "gen_random_bytes", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "gen_random_bytes", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "gen_random_bytes", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "gen_random_uuid", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "gen_random_uuid", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "gen_random_uuid", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "gen_salt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "gen_salt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "gen_salt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "gen_salt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "gen_salt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "gen_salt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "grant_pg_graphql_access", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hmac", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "hmac", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "hmac", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "hmac", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "hmac", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hmac", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_create_index", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_drop_index", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_get_indexdef", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_hidden_indexes", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_hide_index", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_relation_size", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_reset", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_reset_index", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_unhide_all_indexes", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "hypopg_unhide_index", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "index_advisor", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements_info", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements_info", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements_info", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements_reset", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pg_stat_statements_reset", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_armor_headers", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_armor_headers", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_armor_headers", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_key_id", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_key_id", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_key_id", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_pub_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_decrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgp_sym_encrypt_bytea", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgrst_ddl_watch", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "pgrst_drop_watch", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "set_graphql_placeholder", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v1", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v1", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v1", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v1mc", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v1mc", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v1mc", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v3", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v3", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v3", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v4", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v4", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v4", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v5", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v5", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_generate_v5", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_nil", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_nil", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_nil", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_dns", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_dns", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_dns", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_oid", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_oid", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_oid", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_url", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_url", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_url", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_x500", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_x500", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "extensions", "routine_name": "uuid_ns_x500", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql", "routine_name": "_internal_resolve", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "graphql", "routine_name": "_internal_resolve", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "graphql", "routine_name": "_internal_resolve", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql", "routine_name": "_internal_resolve", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "graphql", "routine_name": "comment_directive", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "graphql", "routine_name": "comment_directive", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "graphql", "routine_name": "comment_directive", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql", "routine_name": "comment_directive", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "graphql", "routine_name": "exception", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "graphql", "routine_name": "exception", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "graphql", "routine_name": "exception", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql", "routine_name": "exception", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "graphql", "routine_name": "get_schema_version", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "graphql", "routine_name": "get_schema_version", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "graphql", "routine_name": "get_schema_version", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql", "routine_name": "get_schema_version", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "graphql", "routine_name": "increment_schema_version", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "graphql", "routine_name": "increment_schema_version", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "graphql", "routine_name": "increment_schema_version", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql", "routine_name": "increment_schema_version", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "graphql", "routine_name": "resolve", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "graphql", "routine_name": "resolve", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "graphql", "routine_name": "resolve", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql", "routine_name": "resolve", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "graphql_public", "routine_name": "graphql", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "graphql_public", "routine_name": "graphql", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "graphql_public", "routine_name": "graphql", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "graphql_public", "routine_name": "graphql", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "public", "routine_name": "get_collection_counts", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "public", "routine_name": "get_collection_counts", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "public", "routine_name": "get_collection_counts", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "public", "routine_name": "get_collection_counts", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "public", "routine_name": "get_collection_counts", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "public", "routine_name": "get_collection_members", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "public", "routine_name": "get_collection_members", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "public", "routine_name": "get_collection_members", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "public", "routine_name": "get_collection_members", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "public", "routine_name": "get_collection_members", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "public", "routine_name": "get_user_id_by_email", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "public", "routine_name": "get_user_id_by_email", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "public", "routine_name": "get_user_id_by_email", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "public", "routine_name": "get_user_id_by_email", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "public", "routine_name": "get_user_id_by_email", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "public", "routine_name": "handle_new_car_vote", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "public", "routine_name": "handle_new_car_vote", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "public", "routine_name": "handle_new_car_vote", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "public", "routine_name": "handle_new_car_vote", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "public", "routine_name": "handle_new_car_vote", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "public", "routine_name": "remove_collection_member", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "public", "routine_name": "remove_collection_member", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "public", "routine_name": "remove_collection_member", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "public", "routine_name": "remove_collection_member", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "public", "routine_name": "remove_collection_member", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "public", "routine_name": "rls_auto_enable", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "public", "routine_name": "rls_auto_enable", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "public", "routine_name": "rls_auto_enable", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "public", "routine_name": "rls_auto_enable", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "public", "routine_name": "rls_auto_enable", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "public", "routine_name": "update_car_verification", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "public", "routine_name": "update_car_verification", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "public", "routine_name": "update_car_verification", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "public", "routine_name": "update_car_verification", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "public", "routine_name": "update_car_verification", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "apply_rls", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "apply_rls", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "apply_rls", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "apply_rls", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "apply_rls", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "broadcast_changes", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "build_prepared_statement_sql", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "build_prepared_statement_sql", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "build_prepared_statement_sql", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "build_prepared_statement_sql", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "build_prepared_statement_sql", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "cast", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "cast", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "cast", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "cast", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "cast", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "check_equality_op", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "check_equality_op", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "check_equality_op", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "check_equality_op", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "check_equality_op", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "is_visible_through_filters", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "is_visible_through_filters", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "is_visible_through_filters", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "is_visible_through_filters", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "is_visible_through_filters", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "list_changes", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "list_changes", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "list_changes", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "list_changes", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "list_changes", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "quote_wal2json", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "quote_wal2json", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "quote_wal2json", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "quote_wal2json", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "quote_wal2json", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "send", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "subscription_check_filters", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "subscription_check_filters", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "subscription_check_filters", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "subscription_check_filters", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "subscription_check_filters", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "to_regrole", "privilege_type": "EXECUTE", "grantee": "anon" }, { "routine_schema": "realtime", "routine_name": "to_regrole", "privilege_type": "EXECUTE", "grantee": "authenticated" }, { "routine_schema": "realtime", "routine_name": "to_regrole", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "to_regrole", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "realtime", "routine_name": "to_regrole", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "realtime", "routine_name": "topic", "privilege_type": "EXECUTE", "grantee": "PUBLIC" }, { "routine_schema": "realtime", "routine_name": "topic", "privilege_type": "EXECUTE", "grantee": "dashboard_user" }, { "routine_schema": "realtime", "routine_name": "topic", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "realtime", "routine_name": "topic", "privilege_type": "EXECUTE", "grantee": "supabase_realtime_admin" }, { "routine_schema": "vault", "routine_name": "_crypto_aead_det_decrypt", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "vault", "routine_name": "_crypto_aead_det_decrypt", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "vault", "routine_name": "create_secret", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "vault", "routine_name": "create_secret", "privilege_type": "EXECUTE", "grantee": "service_role" }, { "routine_schema": "vault", "routine_name": "update_secret", "privilege_type": "EXECUTE", "grantee": "postgres" }, { "routine_schema": "vault", "routine_name": "update_secret", "privilege_type": "EXECUTE", "grantee": "service_role" } ]

[ { "sequence_schema": "auth", "sequence_name": "refresh_tokens_id_seq", "data_type": "bigint", "start_value": "1", "minimum_value": "1", "maximum_value": "9223372036854775807", "increment": "1", "cycle_option": "NO" }, { "sequence_schema": "graphql", "sequence_name": "seq_schema_version", "data_type": "integer", "start_value": "1", "minimum_value": "1", "maximum_value": "2147483647", "increment": "1", "cycle_option": "YES" } ]

RLS Policies

Document Row Level Security rules and expected access behavior.

RPC Functions

List all RPC functions and their purpose.

Migration Workflow

Describe how migrations are authored, reviewed, and applied.

Atomic collection creation RPC

  • Script: db/atomic_create_collection_with_owner.sql
  • Purpose: create collections row + owner membership in one DB transaction
  • App integration: CollectionService.create() will call this RPC when present

Operational Checklist

  • Verify schema changes in staging first
  • Confirm RLS policy impact
  • Validate app compatibility with query/RPC changes
  • Keep rollback strategy documented