pratik-org/big-data-ai-basic-storage / lakekeeper-catalog.sql
prpatel's picture
download
raw
110 kB
--
-- PostgreSQL database dump
--
\restrict gbRTxAEIG8ACxsFIau1XS3kK51K4bzseHNb06VV3xMgTTsSvJbk82hxwEE5Ytfw
-- Dumped from database version 18.6 (Ubuntu 18.6-0ubuntu0.26.04.1)
-- Dumped by pg_dump version 18.6 (Ubuntu 18.6-0ubuntu0.26.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
ALTER TABLE IF EXISTS ONLY public.warehouse_statistics DROP CONSTRAINT IF EXISTS warehouse_statistics_warehouse_id_fkey;
ALTER TABLE IF EXISTS ONLY public.warehouse_statistics_history DROP CONSTRAINT IF EXISTS warehouse_statistics_history_warehouse_id_fkey;
ALTER TABLE IF EXISTS ONLY public.warehouse DROP CONSTRAINT IF EXISTS warehouse_project_id_fk;
ALTER TABLE IF EXISTS ONLY public.view_version DROP CONSTRAINT IF EXISTS view_version_view_id_schema_id_fkey;
ALTER TABLE IF EXISTS ONLY public.view_version_log DROP CONSTRAINT IF EXISTS view_version_log_view_id_version_id_fkey;
ALTER TABLE IF EXISTS ONLY public.view_version DROP CONSTRAINT IF EXISTS view_version_default_namespace_id_fkey;
ALTER TABLE IF EXISTS ONLY public.view_schema DROP CONSTRAINT IF EXISTS view_schema_view_id_fkey;
ALTER TABLE IF EXISTS ONLY public.view_representation DROP CONSTRAINT IF EXISTS view_representation_view_id_view_version_id_fkey;
ALTER TABLE IF EXISTS ONLY public.view_properties DROP CONSTRAINT IF EXISTS view_properties_view_id_fkey;
ALTER TABLE IF EXISTS ONLY public.task DROP CONSTRAINT IF EXISTS task_warehouse_id_fk;
ALTER TABLE IF EXISTS ONLY public.task_log DROP CONSTRAINT IF EXISTS task_log_warehouse_id_fkey;
ALTER TABLE IF EXISTS ONLY public.task_config DROP CONSTRAINT IF EXISTS task_config_warehouse_id_fkey;
ALTER TABLE IF EXISTS ONLY public.tabular DROP CONSTRAINT IF EXISTS tabular_warehouse_id_namespace_id_namespace_name_fkey;
ALTER TABLE IF EXISTS ONLY public.tabular DROP CONSTRAINT IF EXISTS tabular_warehouse_id_namespace_id_fkey;
ALTER TABLE IF EXISTS ONLY public.view DROP CONSTRAINT IF EXISTS tabular_ident_fk;
ALTER TABLE IF EXISTS ONLY public."table" DROP CONSTRAINT IF EXISTS tabular_ident_fk;
ALTER TABLE IF EXISTS ONLY public.table_statistics DROP CONSTRAINT IF EXISTS table_statistics_table_id_snapshot_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_sort_order DROP CONSTRAINT IF EXISTS table_sort_order_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_snapshot DROP CONSTRAINT IF EXISTS table_snapshot_table_id_schema_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_snapshot_log DROP CONSTRAINT IF EXISTS table_snapshot_log_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_schema DROP CONSTRAINT IF EXISTS table_schema_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_refs DROP CONSTRAINT IF EXISTS table_refs_table_id_snapshot_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_refs DROP CONSTRAINT IF EXISTS table_refs_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_properties DROP CONSTRAINT IF EXISTS table_properties_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_partition_spec DROP CONSTRAINT IF EXISTS table_partition_spec_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_metadata_log DROP CONSTRAINT IF EXISTS table_metadata_log_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_encryption_keys DROP CONSTRAINT IF EXISTS table_encryption_keys_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_default_sort_order DROP CONSTRAINT IF EXISTS table_default_sort_order_table_id_sort_order_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_default_partition_spec DROP CONSTRAINT IF EXISTS table_default_partition_spec_table_id_partition_spec_id_fkey;
ALTER TABLE IF EXISTS ONLY public.table_current_schema DROP CONSTRAINT IF EXISTS table_current_schema_table_id_schema_id_fkey;
ALTER TABLE IF EXISTS ONLY public.role DROP CONSTRAINT IF EXISTS role_project_id_fkey;
ALTER TABLE IF EXISTS ONLY public.partition_statistics DROP CONSTRAINT IF EXISTS partition_statistics_table_id_snapshot_id_fkey;
ALTER TABLE IF EXISTS ONLY public.partition_statistics DROP CONSTRAINT IF EXISTS partition_statistics_table_id_fkey;
ALTER TABLE IF EXISTS ONLY public.namespace DROP CONSTRAINT IF EXISTS namespace_warehouse_id_fkey;
ALTER TABLE IF EXISTS ONLY public.endpoint_statistics DROP CONSTRAINT IF EXISTS endpoint_statistics_project_id_fkey;
ALTER TABLE IF EXISTS ONLY public.current_view_metadata_version DROP CONSTRAINT IF EXISTS current_view_metadata_version_view_id_version_id_fkey;
ALTER TABLE IF EXISTS ONLY public.current_view_metadata_version DROP CONSTRAINT IF EXISTS current_view_metadata_version_view_id_fkey;
DROP TRIGGER IF EXISTS update_counts_trunc ON public.tabular;
DROP TRIGGER IF EXISTS update_counts ON public.tabular;
DROP TRIGGER IF EXISTS set_updated_at ON public.warehouse_statistics_history;
DROP TRIGGER IF EXISTS set_updated_at ON public.warehouse_statistics;
DROP TRIGGER IF EXISTS set_updated_at ON public.warehouse;
DROP TRIGGER IF EXISTS set_updated_at ON public.view_version;
DROP TRIGGER IF EXISTS set_updated_at ON public.view_schema;
DROP TRIGGER IF EXISTS set_updated_at ON public.view_representation;
DROP TRIGGER IF EXISTS set_updated_at ON public.view_properties;
DROP TRIGGER IF EXISTS set_updated_at ON public.view;
DROP TRIGGER IF EXISTS set_updated_at ON public.users;
DROP TRIGGER IF EXISTS set_updated_at ON public.task_config;
DROP TRIGGER IF EXISTS set_updated_at ON public.task;
DROP TRIGGER IF EXISTS set_updated_at ON public.tabular;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_statistics;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_sort_order;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_snapshot_log;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_snapshot;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_schema;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_refs;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_properties;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_partition_spec;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_metadata_log;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_encryption_keys;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_default_sort_order;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_default_partition_spec;
DROP TRIGGER IF EXISTS set_updated_at ON public.table_current_schema;
DROP TRIGGER IF EXISTS set_updated_at ON public."table";
DROP TRIGGER IF EXISTS set_updated_at ON public.server;
DROP TRIGGER IF EXISTS set_updated_at ON public.secret;
DROP TRIGGER IF EXISTS set_updated_at ON public.role;
DROP TRIGGER IF EXISTS set_updated_at ON public.project;
DROP TRIGGER IF EXISTS set_updated_at ON public.partition_statistics;
DROP TRIGGER IF EXISTS set_updated_at ON public.namespace;
DROP TRIGGER IF EXISTS set_updated_at ON public.endpoint_statistics;
DROP TRIGGER IF EXISTS set_updated_at ON public.current_view_metadata_version;
DROP TRIGGER IF EXISTS before_insert_check_metadata ON public."table";
DROP INDEX IF EXISTS public.warehouse_status_idx;
DROP INDEX IF EXISTS public.warehouse_project_id_name;
DROP INDEX IF EXISTS public.view_representation_view_id_version_id_idx;
DROP INDEX IF EXISTS public.users_name_email_gist_idx;
DROP INDEX IF EXISTS public.unique_user_email;
DROP INDEX IF EXISTS public.unique_role_name_in_project;
DROP INDEX IF EXISTS public.task_warehouse_queue_created_at_idx;
DROP INDEX IF EXISTS public.task_warehouse_id_entity_type_entity_id_idx;
DROP INDEX IF EXISTS public.task_warehouse_created_at_id_idx;
DROP INDEX IF EXISTS public.task_queue_name_status_idx;
DROP INDEX IF EXISTS public.task_log_warehouse_queue_created_at_idx;
DROP INDEX IF EXISTS public.task_log_warehouse_id_entity_type_entity_id_idx;
DROP INDEX IF EXISTS public.task_log_warehouse_created_at_id_attempt_idx;
DROP INDEX IF EXISTS public.tabular_warehouse_id_location_idx;
DROP INDEX IF EXISTS public.tabular_name_namespace_name_gist_index;
DROP INDEX IF EXISTS public.role_project_id_idx;
DROP INDEX IF EXISTS public.role_name_gist_idx;
DROP INDEX IF EXISTS public.namespace_warehouse_id_idx;
DROP INDEX IF EXISTS public.namespace_namespace_name_idx;
DROP INDEX IF EXISTS public.idx_warehouse_stats_history_time;
DROP INDEX IF EXISTS public.idx_endpoint_stats_project_warehouse_time;
DROP INDEX IF EXISTS public.idx_endpoint_stats_project_timestamp;
DROP INDEX IF EXISTS public.idx_endpoint_stats_project_status_time;
ALTER TABLE IF EXISTS ONLY public.warehouse_statistics DROP CONSTRAINT IF EXISTS warehouse_statistics_pkey;
ALTER TABLE IF EXISTS ONLY public.warehouse_statistics_history DROP CONSTRAINT IF EXISTS warehouse_statistics_history_pkey;
ALTER TABLE IF EXISTS ONLY public.warehouse DROP CONSTRAINT IF EXISTS warehouse_pkey;
ALTER TABLE IF EXISTS ONLY public.view_version_log DROP CONSTRAINT IF EXISTS view_version_log_pkey;
ALTER TABLE IF EXISTS ONLY public.view_representation DROP CONSTRAINT IF EXISTS view_representation_pkey;
ALTER TABLE IF EXISTS ONLY public.view_properties DROP CONSTRAINT IF EXISTS view_properties_pkey;
ALTER TABLE IF EXISTS ONLY public.view DROP CONSTRAINT IF EXISTS view_pkey;
ALTER TABLE IF EXISTS ONLY public.users DROP CONSTRAINT IF EXISTS users_pkey;
ALTER TABLE IF EXISTS ONLY public.warehouse DROP CONSTRAINT IF EXISTS unique_warehouse_name_in_project;
ALTER TABLE IF EXISTS ONLY public.namespace DROP CONSTRAINT IF EXISTS unique_warehouse_id_namespace_id_namespace_name;
ALTER TABLE IF EXISTS ONLY public.view_version DROP CONSTRAINT IF EXISTS unique_version_per_metadata;
ALTER TABLE IF EXISTS ONLY public.view_schema DROP CONSTRAINT IF EXISTS unique_schema_per_view;
ALTER TABLE IF EXISTS ONLY public.namespace DROP CONSTRAINT IF EXISTS unique_namespace_per_warehouse;
ALTER TABLE IF EXISTS ONLY public.namespace DROP CONSTRAINT IF EXISTS unique_namespace_id_per_warehouse;
ALTER TABLE IF EXISTS ONLY public.tabular DROP CONSTRAINT IF EXISTS unique_name_per_namespace_id;
ALTER TABLE IF EXISTS ONLY public.task DROP CONSTRAINT IF EXISTS task_unique_warehouse_id_entity_type_entity_id_queue_name;
ALTER TABLE IF EXISTS ONLY public.task DROP CONSTRAINT IF EXISTS task_pkey;
ALTER TABLE IF EXISTS ONLY public.task_log DROP CONSTRAINT IF EXISTS task_log_pkey;
ALTER TABLE IF EXISTS ONLY public.task_config DROP CONSTRAINT IF EXISTS task_config_pkey;
ALTER TABLE IF EXISTS ONLY public.tabular DROP CONSTRAINT IF EXISTS tabular_pkey;
ALTER TABLE IF EXISTS ONLY public.table_statistics DROP CONSTRAINT IF EXISTS table_statistics_pkey;
ALTER TABLE IF EXISTS ONLY public.table_sort_order DROP CONSTRAINT IF EXISTS table_sort_order_pkey;
ALTER TABLE IF EXISTS ONLY public.table_snapshot DROP CONSTRAINT IF EXISTS table_snapshot_pkey;
ALTER TABLE IF EXISTS ONLY public.table_snapshot_log DROP CONSTRAINT IF EXISTS table_snapshot_log_pkey;
ALTER TABLE IF EXISTS ONLY public.table_schema DROP CONSTRAINT IF EXISTS table_schema_pkey;
ALTER TABLE IF EXISTS ONLY public.table_refs DROP CONSTRAINT IF EXISTS table_refs_pkey;
ALTER TABLE IF EXISTS ONLY public.table_properties DROP CONSTRAINT IF EXISTS table_properties_pkey;
ALTER TABLE IF EXISTS ONLY public."table" DROP CONSTRAINT IF EXISTS table_pkey;
ALTER TABLE IF EXISTS ONLY public.table_partition_spec DROP CONSTRAINT IF EXISTS table_partition_spec_pkey;
ALTER TABLE IF EXISTS ONLY public.table_metadata_log DROP CONSTRAINT IF EXISTS table_metadata_log_pkey;
ALTER TABLE IF EXISTS ONLY public.table_encryption_keys DROP CONSTRAINT IF EXISTS table_encryption_keys_pkey;
ALTER TABLE IF EXISTS ONLY public.table_default_sort_order DROP CONSTRAINT IF EXISTS table_default_sort_order_pkey;
ALTER TABLE IF EXISTS ONLY public.table_default_partition_spec DROP CONSTRAINT IF EXISTS table_default_partition_spec_pkey;
ALTER TABLE IF EXISTS ONLY public.table_current_schema DROP CONSTRAINT IF EXISTS table_current_schema_pkey;
ALTER TABLE IF EXISTS ONLY public.server DROP CONSTRAINT IF EXISTS server_pkey;
ALTER TABLE IF EXISTS ONLY public.secret DROP CONSTRAINT IF EXISTS secret_pkey;
ALTER TABLE IF EXISTS ONLY public.role DROP CONSTRAINT IF EXISTS role_pkey;
ALTER TABLE IF EXISTS ONLY public.project DROP CONSTRAINT IF EXISTS project_pkey;
ALTER TABLE IF EXISTS ONLY public.partition_statistics DROP CONSTRAINT IF EXISTS partition_statistics_pkey;
ALTER TABLE IF EXISTS ONLY public.namespace DROP CONSTRAINT IF EXISTS namespace_pkey;
ALTER TABLE IF EXISTS ONLY public.endpoint_statistics DROP CONSTRAINT IF EXISTS endpoint_statistics_project_id_warehouse_id_matched_path_st_key;
ALTER TABLE IF EXISTS ONLY public.endpoint_statistics DROP CONSTRAINT IF EXISTS endpoint_statistics_pkey;
ALTER TABLE IF EXISTS ONLY public.current_view_metadata_version DROP CONSTRAINT IF EXISTS current_view_metadata_version_pkey;
ALTER TABLE IF EXISTS ONLY public._sqlx_migrations DROP CONSTRAINT IF EXISTS _sqlx_migrations_pkey;
ALTER TABLE IF EXISTS public.table_snapshot_log ALTER COLUMN sequence_number DROP DEFAULT;
ALTER TABLE IF EXISTS public.table_metadata_log ALTER COLUMN sequence_number DROP DEFAULT;
DROP TABLE IF EXISTS public.warehouse_statistics_history;
DROP TABLE IF EXISTS public.warehouse_statistics;
DROP TABLE IF EXISTS public.view_version_log;
DROP TABLE IF EXISTS public.view_version;
DROP TABLE IF EXISTS public.view_schema;
DROP TABLE IF EXISTS public.view_representation;
DROP TABLE IF EXISTS public.view_properties;
DROP TABLE IF EXISTS public.view;
DROP TABLE IF EXISTS public.users;
DROP TABLE IF EXISTS public.task_log;
DROP TABLE IF EXISTS public.task_config;
DROP TABLE IF EXISTS public.task;
DROP TABLE IF EXISTS public.table_statistics;
DROP TABLE IF EXISTS public.table_sort_order;
DROP SEQUENCE IF EXISTS public.table_snapshot_log_sequence_number_seq;
DROP TABLE IF EXISTS public.table_snapshot_log;
DROP TABLE IF EXISTS public.table_snapshot;
DROP TABLE IF EXISTS public.table_schema;
DROP TABLE IF EXISTS public.table_refs;
DROP TABLE IF EXISTS public.table_properties;
DROP TABLE IF EXISTS public.table_partition_spec;
DROP SEQUENCE IF EXISTS public.table_metadata_log_sequence_number_seq;
DROP TABLE IF EXISTS public.table_metadata_log;
DROP TABLE IF EXISTS public.table_encryption_keys;
DROP TABLE IF EXISTS public.table_default_sort_order;
DROP TABLE IF EXISTS public.table_default_partition_spec;
DROP TABLE IF EXISTS public.table_current_schema;
DROP TABLE IF EXISTS public."table";
DROP TABLE IF EXISTS public.server;
DROP TABLE IF EXISTS public.secret;
DROP TABLE IF EXISTS public.role;
DROP TABLE IF EXISTS public.project;
DROP TABLE IF EXISTS public.partition_statistics;
DROP TABLE IF EXISTS public.namespace;
DROP TABLE IF EXISTS public.endpoint_statistics;
DROP TABLE IF EXISTS public.current_view_metadata_version;
DROP VIEW IF EXISTS public.active_views;
DROP VIEW IF EXISTS public.active_tables;
DROP VIEW IF EXISTS public.active_tabulars;
DROP TABLE IF EXISTS public.warehouse;
DROP TABLE IF EXISTS public.tabular;
DROP TABLE IF EXISTS public._sqlx_migrations;
DROP FUNCTION IF EXISTS public.update_counts();
DROP FUNCTION IF EXISTS public.trigger_updated_at(tablename regclass);
DROP FUNCTION IF EXISTS public.set_updated_at();
DROP FUNCTION IF EXISTS public.prohibit_updates_of_metadata_blob();
DROP FUNCTION IF EXISTS public.get_stats_interval_unit();
DROP FUNCTION IF EXISTS public.get_stats_interval();
DROP FUNCTION IF EXISTS public.get_stats_date_default();
DROP FUNCTION IF EXISTS public.concat_namespace_name_tabular_name(nsn text[], tn text);
DROP PROCEDURE IF EXISTS public.add_time_columns(IN tablename regclass);
DROP TYPE IF EXISTS public.warehouse_status;
DROP TYPE IF EXISTS public.view_representation_type;
DROP TYPE IF EXISTS public.view_format_version;
DROP TYPE IF EXISTS public.user_type;
DROP TYPE IF EXISTS public.user_last_updated_with;
DROP TYPE IF EXISTS public.task_intermediate_status;
DROP TYPE IF EXISTS public.task_final_status;
DROP TYPE IF EXISTS public.tabular_type;
DROP TYPE IF EXISTS public.tabular_delete_mode;
DROP TYPE IF EXISTS public.table_format_version;
DROP TYPE IF EXISTS public.entity_type;
DROP TYPE IF EXISTS public.deletion_kind;
DROP TYPE IF EXISTS public.api_endpoints;
DROP EXTENSION IF EXISTS "uuid-ossp";
DROP EXTENSION IF EXISTS pgcrypto;
DROP EXTENSION IF EXISTS pg_trgm;
DROP EXTENSION IF EXISTS btree_gist;
DROP EXTENSION IF EXISTS btree_gin;
DROP COLLATION IF EXISTS public.case_insensitive;
--
-- Name: case_insensitive; Type: COLLATION; Schema: public; Owner: postgres
--
CREATE COLLATION public.case_insensitive (provider = icu, deterministic = false, locale = 'und-u-ks-level2');
ALTER COLLATION public.case_insensitive OWNER TO postgres;
--
-- Name: btree_gin; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS btree_gin WITH SCHEMA public;
--
-- Name: EXTENSION btree_gin; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION btree_gin IS 'support for indexing common datatypes in GIN';
--
-- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
--
-- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
--
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
--
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
--
-- Name: api_endpoints; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.api_endpoints AS ENUM (
'sign-s3-request-global',
'sign-s3-request-prefix',
'catalog-v1-get-config',
'catalog-v1-list-namespaces',
'catalog-v1-create-namespace',
'catalog-v1-load-namespace-metadata',
'catalog-v1-namespace-exists',
'catalog-v1-fetch-scan-tasks',
'catalog-v1-drop-namespace',
'catalog-v1-update-namespace-properties',
'catalog-v1-list-tables',
'catalog-v1-create-table',
'catalog-v1-load-table',
'catalog-v1-update-table',
'catalog-v1-drop-table',
'catalog-v1-table-exists',
'catalog-v1-load-credentials',
'catalog-v1-rename-table',
'catalog-v1-register-table',
'catalog-v1-report-metrics',
'catalog-v1-commit-transaction',
'catalog-v1-create-view',
'catalog-v1-list-views',
'catalog-v1-load-view',
'catalog-v1-replace-view',
'catalog-v1-drop-view',
'catalog-v1-view-exists',
'catalog-v1-rename-view',
'management-v1-server-info',
'management-v1-bootstrap',
'management-v1-create-role',
'management-v1-list-role',
'management-v1-update-role',
'management-v1-get-role',
'management-v1-delete-role',
'management-v1-search-role',
'management-v1-whoami',
'management-v1-search-user',
'management-v1-update-user',
'management-v1-get-user',
'management-v1-delete-user',
'management-v1-create-user',
'management-v1-list-user',
'management-v1-create-project',
'management-v1-get-default-project',
'management-v1-delete-default-project',
'management-v1-rename-default-project',
'management-v1-get-default-project-by-id',
'management-v1-load-endpoint-statistics',
'management-v1-delete-project-by-id',
'management-v1-create-warehouse',
'management-v1-list-warehouses',
'management-v1-list-projects',
'management-v1-get-warehouse',
'management-v1-delete-warehouse',
'management-v1-rename-warehouse',
'management-v1-deactivate-warehouse',
'management-v1-activate-warehouse',
'management-v1-update-storage-profile',
'management-v1-update-storage-credential',
'management-v1-get-warehouse-statistics',
'management-v1-list-deleted-tabulars',
'management-v1-undrop-tabulars-deprecated',
'management-v1-undrop-tabulars',
'management-v1-update-warehouse-delete-profile',
'permission-v1-get',
'permission-v1-post',
'permission-v1-head',
'permission-v1-delete',
'management-v1-set-warehouse-protection',
'management-v1-set-namespace-protection',
'management-v1-set-table-protection',
'management-v1-set-view-protection',
'catalog-v1-cancel-planning',
'catalog-v1-fetch-planning-result',
'catalog-v1-plan-table-scan',
'management-v1-get-view-protection',
'management-v1-get-table-protection',
'management-v1-get-namespace-protection',
'management-v1-rename-default-project-deprecated',
'management-v1-get-default-project-deprecated',
'management-v1-delete-default-project-deprecated',
'permission-v1-put',
'management-v1-rename-project-by-id',
'sign-s3-request-tabular',
'management-v1-set-task-queue-config',
'management-v1-get-task-queue-config',
'management-v1-control-tasks',
'management-v1-get-task-details',
'management-v1-list-tasks',
'management-v1-search-tabular'
);
ALTER TYPE public.api_endpoints OWNER TO postgres;
--
-- Name: deletion_kind; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.deletion_kind AS ENUM (
'default',
'purge'
);
ALTER TYPE public.deletion_kind OWNER TO postgres;
--
-- Name: entity_type; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.entity_type AS ENUM (
'table',
'view'
);
ALTER TYPE public.entity_type OWNER TO postgres;
--
-- Name: table_format_version; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.table_format_version AS ENUM (
'1',
'2',
'3'
);
ALTER TYPE public.table_format_version OWNER TO postgres;
--
-- Name: tabular_delete_mode; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.tabular_delete_mode AS ENUM (
'soft',
'hard'
);
ALTER TYPE public.tabular_delete_mode OWNER TO postgres;
--
-- Name: tabular_type; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.tabular_type AS ENUM (
'table',
'view'
);
ALTER TYPE public.tabular_type OWNER TO postgres;
--
-- Name: task_final_status; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.task_final_status AS ENUM (
'failed',
'cancelled',
'success'
);
ALTER TYPE public.task_final_status OWNER TO postgres;
--
-- Name: task_intermediate_status; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.task_intermediate_status AS ENUM (
'running',
'scheduled',
'should-stop'
);
ALTER TYPE public.task_intermediate_status OWNER TO postgres;
--
-- Name: user_last_updated_with; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.user_last_updated_with AS ENUM (
'create-endpoint',
'config-call-creation',
'update-endpoint'
);
ALTER TYPE public.user_last_updated_with OWNER TO postgres;
--
-- Name: user_type; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.user_type AS ENUM (
'application',
'human'
);
ALTER TYPE public.user_type OWNER TO postgres;
--
-- Name: view_format_version; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.view_format_version AS ENUM (
'v1'
);
ALTER TYPE public.view_format_version OWNER TO postgres;
--
-- Name: view_representation_type; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.view_representation_type AS ENUM (
'sql'
);
ALTER TYPE public.view_representation_type OWNER TO postgres;
--
-- Name: warehouse_status; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.warehouse_status AS ENUM (
'active',
'inactive'
);
ALTER TYPE public.warehouse_status OWNER TO postgres;
--
-- Name: add_time_columns(regclass); Type: PROCEDURE; Schema: public; Owner: postgres
--
CREATE PROCEDURE public.add_time_columns(IN tablename regclass)
LANGUAGE plpgsql
AS $$
begin
execute format(
'alter table %s
add column if not exists created_at timestamptz not null default now(),
add column if not exists updated_at timestamptz;',
tablename
);
end;
$$;
ALTER PROCEDURE public.add_time_columns(IN tablename regclass) OWNER TO postgres;
--
-- Name: concat_namespace_name_tabular_name(text[], text); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.concat_namespace_name_tabular_name(nsn text[], tn text) RETURNS text
LANGUAGE sql IMMUTABLE
AS $$
SELECT CASE
WHEN nsn IS NULL OR cardinality(nsn) = 0 THEN tn
ELSE array_to_string(nsn, '.') || '.' || tn
END;
$$;
ALTER FUNCTION public.concat_namespace_name_tabular_name(nsn text[], tn text) OWNER TO postgres;
--
-- Name: get_stats_date_default(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.get_stats_date_default() RETURNS timestamp with time zone
LANGUAGE plpgsql
AS $$
BEGIN
RETURN date_trunc(get_stats_interval_unit(), now()) + get_stats_interval();
END;
$$;
ALTER FUNCTION public.get_stats_date_default() OWNER TO postgres;
--
-- Name: get_stats_interval(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.get_stats_interval() RETURNS interval
LANGUAGE plpgsql
AS $$
BEGIN
RETURN interval '1 ' || get_stats_interval_unit();
END;
$$;
ALTER FUNCTION public.get_stats_interval() OWNER TO postgres;
--
-- Name: get_stats_interval_unit(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.get_stats_interval_unit() RETURNS text
LANGUAGE plpgsql
AS $$
BEGIN
RETURN 'hour';
END;
$$;
ALTER FUNCTION public.get_stats_interval_unit() OWNER TO postgres;
--
-- Name: prohibit_updates_of_metadata_blob(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.prohibit_updates_of_metadata_blob() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF NEW.metadata IS NOT NULL THEN
RAISE EXCEPTION 'Insert or Update failed: metadata must be null';
END IF;
RETURN NEW;
END;
$$;
ALTER FUNCTION public.prohibit_updates_of_metadata_blob() OWNER TO postgres;
--
-- Name: set_updated_at(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.set_updated_at() RETURNS trigger
LANGUAGE plpgsql
AS $$ begin NEW.updated_at = now();
return NEW;
end;
$$;
ALTER FUNCTION public.set_updated_at() OWNER TO postgres;
--
-- Name: trigger_updated_at(regclass); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.trigger_updated_at(tablename regclass) RETURNS void
LANGUAGE plpgsql
AS $$ begin execute format(
'CREATE TRIGGER set_updated_at
BEFORE UPDATE
ON %s
FOR EACH ROW
WHEN (OLD is distinct from NEW)
EXECUTE FUNCTION set_updated_at();',
tablename
);
end;
$$;
ALTER FUNCTION public.trigger_updated_at(tablename regclass) OWNER TO postgres;
--
-- Name: update_counts(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION public.update_counts() RETURNS trigger
LANGUAGE plpgsql
AS $$
declare
delta_view integer;
delta_table integer;
coalesced_namespace_id uuid;
coalesced_type tabular_type;
truncated_date timestamptz;
old_views integer;
old_tables integer;
old_ts timestamptz;
target_wh uuid;
begin
-- COALESCE here is to handle the case when the row is being deleted and NEW is null
coalesced_type := COALESCE(NEW.typ, OLD.typ);
coalesced_namespace_id := COALESCE(NEW.namespace_id, OLD.namespace_id);
truncated_date := get_stats_date_default();
delta_view := CASE
WHEN coalesced_type = 'view' THEN
CASE
WHEN TG_OP = 'INSERT' THEN 1
WHEN TG_OP = 'DELETE' THEN -1
ELSE 0
END
ELSE 0
END;
delta_table := CASE
WHEN coalesced_type = 'table' THEN
CASE
WHEN TG_OP = 'INSERT' THEN 1
WHEN TG_OP = 'DELETE' THEN -1
ELSE 0 END
ELSE 0
END;
if delta_view = 0 and delta_table = 0 then
return null;
end if;
WITH old_data AS (SELECT timestamp, number_of_views, number_of_tables, warehouse_id
FROM warehouse_statistics
WHERE warehouse_id =
(SELECT warehouse_id FROM namespace WHERE namespace_id = coalesced_namespace_id))
UPDATE warehouse_statistics ws
SET number_of_views = GREATEST(number_of_views + delta_view, 0),
number_of_tables = GREATEST(number_of_tables + delta_table, 0),
timestamp = truncated_date
WHERE ws.warehouse_id = (SELECT warehouse_id FROM namespace WHERE namespace_id = coalesced_namespace_id)
RETURNING (SELECT timestamp FROM old_data) AS old_timestamp,
(SELECT number_of_views FROM old_data) AS old_views,
(SELECT number_of_tables FROM old_data) AS old_tables,
(SELECT warehouse_id FROM old_data) AS warehouse_id
INTO old_ts, old_views, old_tables, target_wh;
if old_ts < truncated_date then
INSERT INTO warehouse_statistics_history (number_of_views,
number_of_tables,
warehouse_id,
timestamp)
SELECT old_views,
old_tables,
target_wh,
old_ts
ON CONFLICT DO NOTHING;
end if;
RETURN NULL;
end;
$$;
ALTER FUNCTION public.update_counts() OWNER TO postgres;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: _sqlx_migrations; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public._sqlx_migrations (
version bigint NOT NULL,
description text NOT NULL,
installed_on timestamp with time zone DEFAULT now() NOT NULL,
success boolean NOT NULL,
checksum bytea NOT NULL,
execution_time bigint NOT NULL
);
ALTER TABLE public._sqlx_migrations OWNER TO postgres;
--
-- Name: tabular; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.tabular (
tabular_id uuid NOT NULL,
namespace_id uuid NOT NULL,
name text NOT NULL COLLATE public.case_insensitive,
typ public.tabular_type NOT NULL,
metadata_location text,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
deleted_at timestamp with time zone,
fs_protocol text NOT NULL,
fs_location text NOT NULL,
protected boolean DEFAULT false NOT NULL,
warehouse_id uuid NOT NULL,
tabular_namespace_name text[] NOT NULL COLLATE public.case_insensitive,
CONSTRAINT tabular_check CHECK ((((typ = 'view'::public.tabular_type) AND (metadata_location IS NOT NULL)) OR (typ = 'table'::public.tabular_type)))
);
ALTER TABLE public.tabular OWNER TO postgres;
--
-- Name: warehouse; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.warehouse (
warehouse_id uuid DEFAULT public.uuid_generate_v1mc() NOT NULL,
warehouse_name text NOT NULL COLLATE public.case_insensitive,
storage_profile jsonb DEFAULT '{}'::jsonb NOT NULL,
storage_secret_id uuid,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
status public.warehouse_status NOT NULL,
tabular_expiration_seconds bigint,
tabular_delete_mode public.tabular_delete_mode NOT NULL,
project_id text CONSTRAINT warehouse_project_id_text_not_null NOT NULL,
protected boolean DEFAULT false NOT NULL,
CONSTRAINT warehouse_check CHECK ((((tabular_expiration_seconds IS NOT NULL) AND (tabular_delete_mode = 'soft'::public.tabular_delete_mode)) OR ((tabular_expiration_seconds IS NULL) AND (tabular_delete_mode = 'hard'::public.tabular_delete_mode))))
);
ALTER TABLE public.warehouse OWNER TO postgres;
--
-- Name: active_tabulars; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW public.active_tabulars AS
SELECT t.tabular_id,
t.namespace_id,
t.name,
t.typ,
t.metadata_location,
t.fs_protocol,
t.fs_location,
t.warehouse_id,
t.tabular_namespace_name AS namespace_name
FROM (public.tabular t
JOIN public.warehouse w ON (((t.warehouse_id = w.warehouse_id) AND (w.status = 'active'::public.warehouse_status))));
ALTER VIEW public.active_tabulars OWNER TO postgres;
--
-- Name: active_tables; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW public.active_tables AS
SELECT tabular_id AS table_id,
namespace_id,
warehouse_id,
name,
metadata_location,
fs_protocol,
fs_location
FROM public.active_tabulars t
WHERE (typ = 'table'::public.tabular_type);
ALTER VIEW public.active_tables OWNER TO postgres;
--
-- Name: active_views; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW public.active_views AS
SELECT tabular_id AS view_id,
namespace_id,
warehouse_id,
name,
metadata_location,
fs_protocol,
fs_location
FROM public.active_tabulars t
WHERE (typ = 'view'::public.tabular_type);
ALTER VIEW public.active_views OWNER TO postgres;
--
-- Name: current_view_metadata_version; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.current_view_metadata_version (
view_id uuid NOT NULL,
version_id integer NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.current_view_metadata_version OWNER TO postgres;
--
-- Name: endpoint_statistics; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.endpoint_statistics (
endpoint_statistics_id uuid DEFAULT public.uuid_generate_v1mc() NOT NULL,
warehouse_id uuid,
project_id text NOT NULL,
matched_path public.api_endpoints NOT NULL,
status_code integer NOT NULL,
count bigint DEFAULT 0 NOT NULL,
"timestamp" timestamp with time zone DEFAULT public.get_stats_date_default() NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone
);
ALTER TABLE public.endpoint_statistics OWNER TO postgres;
--
-- Name: namespace; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.namespace (
namespace_id uuid DEFAULT public.uuid_generate_v1mc() NOT NULL,
warehouse_id uuid NOT NULL,
namespace_name text[] NOT NULL COLLATE public.case_insensitive,
namespace_properties jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
protected boolean DEFAULT false NOT NULL
);
ALTER TABLE public.namespace OWNER TO postgres;
--
-- Name: partition_statistics; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.partition_statistics (
snapshot_id bigint NOT NULL,
table_id uuid NOT NULL,
statistics_path text NOT NULL,
file_size_in_bytes bigint NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.partition_statistics OWNER TO postgres;
--
-- Name: project; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.project (
project_name text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
project_id text CONSTRAINT project_project_id_text_not_null NOT NULL
);
ALTER TABLE public.project OWNER TO postgres;
--
-- Name: role; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.role (
id uuid NOT NULL,
name text NOT NULL,
description text,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
project_id text CONSTRAINT role_project_id_text_not_null NOT NULL
);
ALTER TABLE public.role OWNER TO postgres;
--
-- Name: secret; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.secret (
secret_id uuid DEFAULT public.uuid_generate_v1mc() NOT NULL,
secret bytea NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone
);
ALTER TABLE public.secret OWNER TO postgres;
--
-- Name: server; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.server (
single_row boolean DEFAULT true NOT NULL,
server_id uuid NOT NULL,
terms_accepted boolean NOT NULL,
open_for_bootstrap boolean NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
CONSTRAINT single_row CHECK (single_row)
);
ALTER TABLE public.server OWNER TO postgres;
--
-- Name: table; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."table" (
table_id uuid DEFAULT public.uuid_generate_v1mc() NOT NULL,
metadata jsonb,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
table_format_version public.table_format_version NOT NULL,
last_column_id integer NOT NULL,
last_sequence_number bigint NOT NULL,
last_updated_ms bigint NOT NULL,
last_partition_id integer NOT NULL,
warehouse_id uuid NOT NULL,
next_row_id bigint NOT NULL,
CONSTRAINT table_next_row_id_check CHECK ((next_row_id >= 0))
);
ALTER TABLE public."table" OWNER TO postgres;
--
-- Name: table_current_schema; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_current_schema (
table_id uuid NOT NULL,
schema_id integer NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_current_schema OWNER TO postgres;
--
-- Name: table_default_partition_spec; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_default_partition_spec (
table_id uuid NOT NULL,
partition_spec_id integer NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_default_partition_spec OWNER TO postgres;
--
-- Name: table_default_sort_order; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_default_sort_order (
table_id uuid NOT NULL,
sort_order_id bigint NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_default_sort_order OWNER TO postgres;
--
-- Name: table_encryption_keys; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_encryption_keys (
warehouse_id uuid NOT NULL,
table_id uuid NOT NULL,
key_id text NOT NULL,
encrypted_key_metadata bytea NOT NULL,
encrypted_by_id text,
properties jsonb,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone
);
ALTER TABLE public.table_encryption_keys OWNER TO postgres;
--
-- Name: table_metadata_log; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_metadata_log (
sequence_number bigint NOT NULL,
table_id uuid NOT NULL,
"timestamp" bigint NOT NULL,
metadata_file text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_metadata_log OWNER TO postgres;
--
-- Name: table_metadata_log_sequence_number_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.table_metadata_log_sequence_number_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.table_metadata_log_sequence_number_seq OWNER TO postgres;
--
-- Name: table_metadata_log_sequence_number_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.table_metadata_log_sequence_number_seq OWNED BY public.table_metadata_log.sequence_number;
--
-- Name: table_partition_spec; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_partition_spec (
partition_spec_id integer NOT NULL,
table_id uuid NOT NULL,
partition_spec jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_partition_spec OWNER TO postgres;
--
-- Name: table_properties; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_properties (
table_id uuid NOT NULL,
key text NOT NULL,
value text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_properties OWNER TO postgres;
--
-- Name: table_refs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_refs (
table_id uuid NOT NULL,
table_ref_name text NOT NULL,
snapshot_id bigint NOT NULL,
retention jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_refs OWNER TO postgres;
--
-- Name: table_schema; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_schema (
schema_id integer NOT NULL,
table_id uuid NOT NULL,
schema jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_schema OWNER TO postgres;
--
-- Name: table_snapshot; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_snapshot (
snapshot_id bigint NOT NULL,
table_id uuid NOT NULL,
parent_snapshot_id bigint,
sequence_number bigint NOT NULL,
manifest_list text NOT NULL,
summary jsonb NOT NULL,
schema_id integer,
timestamp_ms bigint NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL,
first_row_id bigint,
assigned_rows bigint,
key_id text
);
ALTER TABLE public.table_snapshot OWNER TO postgres;
--
-- Name: table_snapshot_log; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_snapshot_log (
sequence_number bigint NOT NULL,
table_id uuid NOT NULL,
snapshot_id bigint NOT NULL,
"timestamp" bigint NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_snapshot_log OWNER TO postgres;
--
-- Name: table_snapshot_log_sequence_number_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.table_snapshot_log_sequence_number_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.table_snapshot_log_sequence_number_seq OWNER TO postgres;
--
-- Name: table_snapshot_log_sequence_number_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.table_snapshot_log_sequence_number_seq OWNED BY public.table_snapshot_log.sequence_number;
--
-- Name: table_sort_order; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_sort_order (
sort_order_id bigint NOT NULL,
table_id uuid NOT NULL,
sort_order jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_sort_order OWNER TO postgres;
--
-- Name: table_statistics; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.table_statistics (
snapshot_id bigint NOT NULL,
table_id uuid NOT NULL,
statistics_path text NOT NULL,
file_size_in_bytes bigint NOT NULL,
file_footer_size_in_bytes bigint NOT NULL,
key_metadata text,
blob_metadata jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.table_statistics OWNER TO postgres;
--
-- Name: task; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.task (
task_id uuid NOT NULL,
warehouse_id uuid NOT NULL,
queue_name text CONSTRAINT task_task_name_not_null NOT NULL,
status public.task_intermediate_status NOT NULL,
picked_up_at timestamp with time zone,
scheduled_for timestamp with time zone DEFAULT now() NOT NULL,
attempt integer DEFAULT 0 NOT NULL,
parent_task_id uuid,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
task_data jsonb NOT NULL,
entity_id uuid NOT NULL,
last_heartbeat_at timestamp with time zone,
progress real DEFAULT 0.0 NOT NULL,
execution_details jsonb,
entity_name text[] NOT NULL COLLATE public.case_insensitive,
entity_type public.entity_type NOT NULL
);
ALTER TABLE public.task OWNER TO postgres;
--
-- Name: task_config; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.task_config (
warehouse_id uuid NOT NULL,
queue_name text NOT NULL,
config jsonb NOT NULL,
max_time_since_last_heartbeat interval,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone
);
ALTER TABLE public.task_config OWNER TO postgres;
--
-- Name: task_log; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.task_log (
task_id uuid NOT NULL,
attempt integer NOT NULL,
warehouse_id uuid NOT NULL,
queue_name text NOT NULL,
task_data jsonb NOT NULL,
status public.task_final_status NOT NULL,
entity_id uuid NOT NULL,
started_at timestamp with time zone,
duration interval,
message text,
created_at timestamp with time zone DEFAULT now() NOT NULL,
progress real DEFAULT 0.0 NOT NULL,
execution_details jsonb,
attempt_scheduled_for timestamp with time zone NOT NULL,
last_heartbeat_at timestamp with time zone,
parent_task_id uuid,
task_created_at timestamp with time zone NOT NULL,
entity_name text[] NOT NULL COLLATE public.case_insensitive,
entity_type public.entity_type NOT NULL
);
ALTER TABLE public.task_log OWNER TO postgres;
--
-- Name: users; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.users (
id text NOT NULL,
name text NOT NULL,
email text,
user_type public.user_type NOT NULL,
last_updated_with public.user_last_updated_with NOT NULL,
deleted_at timestamp with time zone,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone
);
ALTER TABLE public.users OWNER TO postgres;
--
-- Name: view; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.view (
view_id uuid DEFAULT public.uuid_generate_v1mc() NOT NULL,
view_format_version public.view_format_version NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.view OWNER TO postgres;
--
-- Name: view_properties; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.view_properties (
view_id uuid NOT NULL,
key text NOT NULL,
value text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.view_properties OWNER TO postgres;
--
-- Name: view_representation; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.view_representation (
view_representation_id uuid DEFAULT public.uuid_generate_v1mc() NOT NULL,
view_version_id integer NOT NULL,
view_id uuid NOT NULL,
typ public.view_representation_type NOT NULL,
sql text NOT NULL,
dialect text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.view_representation OWNER TO postgres;
--
-- Name: view_schema; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.view_schema (
schema_id integer NOT NULL,
view_id uuid NOT NULL,
schema jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.view_schema OWNER TO postgres;
--
-- Name: view_version; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.view_version (
view_id uuid NOT NULL,
version_id integer NOT NULL,
schema_id integer NOT NULL,
"timestamp" timestamp with time zone NOT NULL,
default_namespace_id uuid,
default_catalog text,
summary jsonb NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.view_version OWNER TO postgres;
--
-- Name: view_version_log; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.view_version_log (
view_id uuid NOT NULL,
version_id integer NOT NULL,
"timestamp" timestamp with time zone DEFAULT now() NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone,
warehouse_id uuid NOT NULL
);
ALTER TABLE public.view_version_log OWNER TO postgres;
--
-- Name: warehouse_statistics; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.warehouse_statistics (
warehouse_id uuid NOT NULL,
number_of_views bigint NOT NULL,
number_of_tables bigint NOT NULL,
"timestamp" timestamp with time zone DEFAULT public.get_stats_date_default() NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone
);
ALTER TABLE public.warehouse_statistics OWNER TO postgres;
--
-- Name: warehouse_statistics_history; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.warehouse_statistics_history (
number_of_views bigint NOT NULL,
number_of_tables bigint NOT NULL,
warehouse_id uuid NOT NULL,
"timestamp" timestamp with time zone DEFAULT public.get_stats_date_default() NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone
);
ALTER TABLE public.warehouse_statistics_history OWNER TO postgres;
--
-- Name: table_metadata_log sequence_number; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_metadata_log ALTER COLUMN sequence_number SET DEFAULT nextval('public.table_metadata_log_sequence_number_seq'::regclass);
--
-- Name: table_snapshot_log sequence_number; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_snapshot_log ALTER COLUMN sequence_number SET DEFAULT nextval('public.table_snapshot_log_sequence_number_seq'::regclass);
--
-- Data for Name: _sqlx_migrations; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public._sqlx_migrations (version, description, installed_on, success, checksum, execution_time) FROM stdin;
1 setup 2026-08-21 10:23:36.522686+00 t \\x44748caaec8b09f6fa20eb95f83d8aea7f9d51afdc52bfcafa8c58d44bec7fb1a6fc711b6d7cc0548a9367dd2ac19a81 11583808
2 warehouse 2026-08-21 10:23:36.522686+00 t \\x58f595584b3b88f1865995e4af0ef84d8908c80d2f77e8a19e02f130d4332292643a70664b9d297d16a7e8505fb3cfa3 3988726
3 secret 2026-08-21 10:23:36.522686+00 t \\x225a1b4719428159722d577e561d28b65e05f0b25b194ffbf6b60c8a249622538387049a083769171281f6d0ea7b3dcb 1519657
4 namespace 2026-08-21 10:23:36.522686+00 t \\xcecdbb17a4110070c57062bd62c8dd239bf71fa5610e2f9b471c794d580d7381bf6b7b2ca68e48e139828176efb690c9 2601379
5 table 2026-08-21 10:23:36.522686+00 t \\x9aef13da32da13ffe98a021198fd0201d5ea7a25f82db1f9ddab765e307988de099005e4f6f26f0bf87ebd35e8b8ca89 2524673
20240620151429 timecolumns 2026-08-21 10:23:36.522686+00 t \\x255792dcad31ae41b33215ec2a724a6c758c8b56dd0cdb5916798745f55521c006c907085af498045869f48d42574547 257080
20240620151514 tabular identifiers 2026-08-21 10:23:36.522686+00 t \\xd229b1be11187cac021d6e546b4b6f4af59c4504ed8c3f1ddf6bcd96376e66ea8665f9d565a8e2e6c3b4ce7dfa6fb311 7063001
20240620151544 views 2026-08-21 10:23:36.522686+00 t \\x070336ffd87183e9e5bd4b1c72b025d71ed504d9d92ab12b33b8031fd5af2cf1a0dd9917e6bb4e625c749e1408dd1e1b 11402874
20240897111544 view versions are i32 2026-08-21 10:23:36.522686+00 t \\x84f46223a0c4a900a026d08922ea82c40e0961bc506310b38e3f247ee0b62c0f84daf48fc840ea93dd269b7f201ed128 9293643
20240898160621 tabular deleted at 2026-08-21 10:23:36.522686+00 t \\x19152bb9a9069d3e708d6559d816b284db33823f8b6fa52656a80cc0b46009e9830cf3b9b7c9b9087f4c68cffcf6e3d1 217067
20240898175225 tabular deletion extended 2026-08-21 10:23:36.522686+00 t \\x96f284a89006b4f8317c7c78e0969b5f81948124d71c17338cd9267954e4ff117a0eecbf99acbdae6d6b46a330db08ad 944182
20240899175225 tabular expiration 2026-08-21 10:23:36.522686+00 t \\x19cac9768c9b611a14f459c434cbe02291a8fdbf6585db17f3349db51c6ab17f9771b6487141a2ea70b310cd12590458 6315194
20240909120857 configurable drops 2026-08-21 10:23:36.522686+00 t \\xc7b480b4d576d774c6da07b2011225be3e1392d6e80c102722e1f64bbf7d7317c64fc193dd9bdc33e81ae80dba0d1c06 797421
20240911094637 unique tabular location 2026-08-21 10:23:36.522686+00 t \\x5d68135df940e2bf31b496b258df36e31218ce4feacb49ab37cc272603edfb2a5f6d67edfafc34ba6773d75bbfb7878e 739656
20241006083546 projects-table 2026-08-21 10:23:36.522686+00 t \\x300a586e0947cf994fb1043af0acddd2eabed168b94b215038e3c9f7668a1328402914abd5e5983cd5b6b25698dfb153 2334319
20241009122911 users and roles 2026-08-21 10:23:36.522686+00 t \\x633c0a8822c896e89249d5ada24c39dc1197b132b57d462cc4e59566851fc5dbeb5d064e900f15345de5c221af59a579 21682571
20241011203612 server 2026-08-21 10:23:36.522686+00 t \\x4571f34b4f62ecc9f90e413c228d37f59c278b478d3ceefb7ec546b31321df2a8aa020db9b7e5be266481c1ffdb2b577 1422329
20241106163000 user email search 2026-08-21 10:23:36.522686+00 t \\x4e98d3e168ffc1c9901351bbc86d085025ede29b96270154cc843749d9c27a7bb1052a8703e0ec345c88523780610e82 638709
20241106201139 split table metadata 2026-08-21 10:23:36.522686+00 t \\xc4292b2f4c49baa6c42aabebbee93c9dc64c63b45ecbb791a875b78f48a84980db8b9fcb3b2baf20d26c8870e1ef4e4c 19688759
20241117144332 task queue indexes 2026-08-21 10:23:36.522686+00 t \\x93069e237dc85e2d6ec5bf717feb088b71beffa3c74c97003c859e9ded5c5f265e8121970952f907777d6b2744695cdf 702284
20241216114355 table statistics 2026-08-21 10:23:36.522686+00 t \\x8ddc9dbca113fb69dfcf3c5311c3e5b24450b42300eeb2848cceb3f56de3e9e1b9a95953b5f8b5d224937f94477007eb 3800871
20241216150545 fix schemaless snapshots 2026-08-21 10:23:36.522686+00 t \\xc06ec31cf310ef63bbed99590b05ee1a4d1df51cf1378bc3291d82261f864c0ae4501896cca3ec35e44cf123e28976da 225127
20241224055514 unique user email 2026-08-21 10:23:36.522686+00 t \\xd5fc3bcb8af5706cea9434a948fc6426f083e6bf31f94389953440d4e7f054994562f6cdedec1ab7df5cc06f892918cf 514019
20250108131004 statistics 2026-08-21 10:23:36.522686+00 t \\x87c07858acedf8b9599d1eee6a9bbe23e2430aef4012f673b2d2ff719df3f99cb214252a0307993cb114339eb04a949d 3236778
20250216105917 variant protocols 2026-08-21 10:23:36.522686+00 t \\x76c58ded446245c86dd7cac5bddd34ccd9126db5eae307a5942c18875126f5999238569c02076742d63dc3c7a98fa222 2407305
20250304100842 string project ids 2026-08-21 10:23:36.522686+00 t \\x42d41bcc48fde8622073cd669b7eeba8396f3b463aec28e4370402ada7f9eefa424cca45f074ca540a7c4dfea46e5d65 3662031
20250310181331 endpoint stats 2026-08-21 10:23:36.522686+00 t \\x0e475131b17449d48330d9979e78c69e43d72854e691528a9a7a9a83acf8658142865c552424848089b45239848ee59f 4042829
20250326153233 table statistics fkey 2026-08-21 10:23:36.522686+00 t \\xda90a37bee3f857b21e8374f1adefc865b8bf05ce090d06626eb34a135f58159ae598a0afab8bb29aa6a2e16ca440c9b 1233764
20250328131139 fix sequence number 2026-08-21 10:23:36.522686+00 t \\xd8a6efb1006b7f9477c511c70591da1c73e6b2e6ada9fa9062524444213faed8cd8dc32ce5db8a7254a4ffc4459532fe 606186
20250401163352 project id constraints 2026-08-21 10:23:36.522686+00 t \\xa16230d4226b6a55a644c24239f5fbb40be816d96aa4ecc3b155a41042bd30892ec06996dcb64f3951110419b48e6a53 854936
20250407144536 fix warehouse deletion fk 2026-08-21 10:23:36.522686+00 t \\xdc02cc58d053f9fad616db6705cfff33364fa822e22e29f0f9228feab8835164cd266b7466c72ced1b12eeee3d8fa590 898539
20250409201248 cascade delete 2026-08-21 10:23:36.522686+00 t \\x725285449a654945fffa2a2941799acecce7e38d37fe13e32b8ad690b6365760a058ebc2fcdb9ba9d8e2b57892d9e8d9 1637705
20250410024101 fix warehouse stats 2026-08-21 10:23:36.522686+00 t \\x563ba555ceeade50819aee877fd130d1c5b7cf8286b571ba8fc28f01d3a97c73de60a2027c62dd6abfc00fec1d3b49bb 4976712
20250412220607 restructure endpoints 2026-08-21 10:23:36.522686+00 t \\xa82ad2ccbb7eaa4e3bcac1c246ce901ab97e12951345d3b55699e6428b3560f2103bde8899694a7ea0d80fbf2a43c7c8 15687672
20250428072447 add task warehouse id idx 2026-08-21 10:23:36.522686+00 t \\x456a06466a8f75dd5db3779c046ae55dfb3c4f9ce3d5b72bce99aa4a77ce4bf85545fcd0390b0e3f8c5106185b95ea28 2918644
20250505101407 fix index function 2026-08-21 10:23:36.522686+00 t \\x2b2885dbc012ecaac71fc2e3a2c67399c5d30139f8176e613c574dd834e07a7010f5cfdaf7206e3f0ac48fef7e795593 265870
20250506094141 fix index function2 2026-08-21 10:23:36.522686+00 t \\x41d5623f06bcd747458a96bef6d49edd8f21820d484f95e97298032bb143dc671cc5f8c6defc7305727525b25830b302 316994
20250513172324 s3 sign table endpoint 2026-08-21 10:23:36.522686+00 t \\x14c7c0c6f8698b881fb1b7886c8e77c9aafb1e2a0b5c83f92b676cee98267f444448d0fcad4a6616cebfb55b2bb84891 223547
20250523101407 tasks store their state 2026-08-21 10:23:36.522686+00 t \\xd683513c18f6c69d5554f5b6668440a0f0f986cace59c1b5be5c81be9c72c65db2190f22554348b1b51a949a6f841309 12383789
20250623114333 fix soft deleted tabulars 2026-08-21 10:23:36.522686+00 t \\x69c17d9fa0097f5fdae0038bba6456928b019b013fa1fa2e59f94557f200b02d5c7e93c48c32f158a21212a8a2594bfd 2720219
20250826171037 task runtime information 2026-08-21 10:23:36.522686+00 t \\xe94445d3c02c310458359196019123c8ca5f1e060139730b3e914b26d1b51cbf0011a1feff343929af3ba1cff4c7b6c2 13234234
20250904142650 reusable table id 2026-08-21 10:23:36.522686+00 t \\xa514abf508d7e9183c5bc293656010c2cf1e42e05f0caba5fa3e2a2f2dd43d8f5aae151a13eea886459720faa4dd95fc 34194039
20250919101934 add task entity name 2026-08-21 10:23:36.522686+00 t \\x5f1014aa1080bb434de90cb511101d77cf471b210afe9bbaf9f197d50da51f439a5d60fec317c0546d6e4ade0bf7ebc9 3649790
20250923102542 v3 support 2026-08-21 10:23:36.522686+00 t \\x3a79587d573174c1286da46ad4644b97badcefe80556fe4c50cb2e84d57d7435783b62f671dcab7a8bd4a70c4884f64d 3258829
20250923164029 fuzzy tabular search 2026-08-21 10:23:36.522686+00 t \\xa00be4d2e02b1b13cb6d9bacd85e5d36ff569c9f2c1bf63e5f93eddd8cb1ea6f72eee4295e87d478072618df81f62e13 26803053
20250930101627 active tabulars remove namespace join 2026-08-21 10:23:36.522686+00 t \\x593c731cd893b3fd8ef983a4f75009528808d810593f2727f52ca10a344a0d1e8174d7a9e88881f79417f5666dc28a59 629188
20251003103404 fix project endpoint stats 2026-08-21 10:23:36.522686+00 t \\x569ccc3f2c9d7bb50ec89fdc888769a65ca3236f89b01b896f13867b4bddfcdb262b9002cede9e93f2bf5cd4e54600bf 434943
\.
--
-- Data for Name: current_view_metadata_version; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.current_view_metadata_version (view_id, version_id, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: endpoint_statistics; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.endpoint_statistics (endpoint_statistics_id, warehouse_id, project_id, matched_path, status_code, count, "timestamp", created_at, updated_at) FROM stdin;
3dd102ae-9d4b-11f1-ae27-cf6b3f54c7d5 \N 00000000-0000-0000-0000-000000000000 management-v1-create-warehouse 201 1 2026-08-21 10:00:01+00 2026-08-21 10:29:51.033372+00 \N
3dd103e4-9d4b-11f1-ae27-8f00374ee733 \N 00000000-0000-0000-0000-000000000000 management-v1-bootstrap 204 1 2026-08-21 10:00:01+00 2026-08-21 10:29:51.033372+00 \N
3dd10510-9d4b-11f1-ae27-ab1a93680031 20ad557e-9d4b-11f1-af16-0ffd2f7e297a 00000000-0000-0000-0000-000000000000 catalog-v1-load-namespace-metadata 404 1 2026-08-21 10:00:01+00 2026-08-21 10:29:51.033372+00 \N
3dd10628-9d4b-11f1-ae27-13ee97771377 20ad557e-9d4b-11f1-af16-0ffd2f7e297a 00000000-0000-0000-0000-000000000000 catalog-v1-create-namespace 200 1 2026-08-21 10:00:01+00 2026-08-21 10:29:51.033372+00 \N
3dd10196-9d4b-11f1-ae27-1b0a2a420047 20ad557e-9d4b-11f1-af16-0ffd2f7e297a 00000000-0000-0000-0000-000000000000 catalog-v1-load-table 404 3 2026-08-21 10:00:01+00 2026-08-21 10:29:51.033372+00 2026-08-21 10:43:11.375549+00
3dd0efe4-9d4b-11f1-ae27-f7e30321098d 20ad557e-9d4b-11f1-af16-0ffd2f7e297a 00000000-0000-0000-0000-000000000000 catalog-v1-create-table 400 2 2026-08-21 10:00:01+00 2026-08-21 10:29:51.033372+00 2026-08-21 10:43:11.375549+00
1ada9dd0-9d4d-11f1-83f5-039a2c085097 20ad557e-9d4b-11f1-af16-0ffd2f7e297a 00000000-0000-0000-0000-000000000000 catalog-v1-load-namespace-metadata 200 1 2026-08-21 10:00:01+00 2026-08-21 10:43:11.375549+00 \N
3dd0ffde-9d4b-11f1-ae27-7749988f1e8e 20ad557e-9d4b-11f1-af16-0ffd2f7e297a 00000000-0000-0000-0000-000000000000 catalog-v1-get-config 200 2 2026-08-21 10:00:01+00 2026-08-21 10:29:51.033372+00 2026-08-21 10:43:11.375549+00
2cbdb154-9d4d-11f1-8d0f-eb085a17e832 20ad557e-9d4b-11f1-af16-0ffd2f7e297a 00000000-0000-0000-0000-000000000000 catalog-v1-load-view 404 1 2026-08-21 10:00:01+00 2026-08-21 10:43:41.385466+00 \N
\.
--
-- Data for Name: namespace; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.namespace (namespace_id, warehouse_id, namespace_name, namespace_properties, created_at, updated_at, protected) FROM stdin;
01a023de-3319-7622-9700-3e1c122290d1 20ad557e-9d4b-11f1-af16-0ffd2f7e297a {housing} {"owner": "user", "location": "s3://warehouse/01a023de-3319-7622-9700-3e1c122290d1"} 2026-08-21 10:29:19.769303+00 \N f
\.
--
-- Data for Name: partition_statistics; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.partition_statistics (snapshot_id, table_id, statistics_path, file_size_in_bytes, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: project; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.project (project_name, created_at, updated_at, project_id) FROM stdin;
Default Project 2026-08-21 10:29:02.039039+00 \N 00000000-0000-0000-0000-000000000000
\.
--
-- Data for Name: role; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.role (id, name, description, created_at, updated_at, project_id) FROM stdin;
\.
--
-- Data for Name: secret; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.secret (secret_id, secret, created_at, updated_at) FROM stdin;
20acd2ca-9d4b-11f1-a8cc-e78ad3985f54 \\xc30d04090302b5a62e92f5045b9072d2b00154a6ffa8392eb39c009e49d183d7946a8a9d65cd0a5e00906fc6ac32d46de57078ba817820f50cee2665022f8ee216056379c62470f14d08011110c4ee26e1c11ea4569d5db9f6e3ba1b0e48c7d1d45854373ed3ab2f92ae11fb04aa62d2bb53fb0091fc92a328baf69f4dfd8bb73f0b7e457e7db905ce275df5b462af7ddee1360305295f3e98830c6fc51627c0728980ee318105d9e83ca0d032fcab1949b8507a3acb2640660f9f5287b1b957c3 2026-08-21 10:29:02.149619+00 \N
\.
--
-- Data for Name: server; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.server (single_row, server_id, terms_accepted, open_for_bootstrap, created_at, updated_at) FROM stdin;
t 01a023d8-f751-7773-a770-8ac672b914a7 t f 2026-08-21 10:23:36.522686+00 2026-08-21 10:29:02.037118+00
\.
--
-- Data for Name: table; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public."table" (table_id, metadata, created_at, updated_at, table_format_version, last_column_id, last_sequence_number, last_updated_ms, last_partition_id, warehouse_id, next_row_id) FROM stdin;
\.
--
-- Data for Name: table_current_schema; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_current_schema (table_id, schema_id, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_default_partition_spec; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_default_partition_spec (table_id, partition_spec_id, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_default_sort_order; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_default_sort_order (table_id, sort_order_id, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_encryption_keys; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_encryption_keys (warehouse_id, table_id, key_id, encrypted_key_metadata, encrypted_by_id, properties, created_at, updated_at) FROM stdin;
\.
--
-- Data for Name: table_metadata_log; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_metadata_log (sequence_number, table_id, "timestamp", metadata_file, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_partition_spec; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_partition_spec (partition_spec_id, table_id, partition_spec, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_properties; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_properties (table_id, key, value, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_refs; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_refs (table_id, table_ref_name, snapshot_id, retention, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_schema; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_schema (schema_id, table_id, schema, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_snapshot; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_snapshot (snapshot_id, table_id, parent_snapshot_id, sequence_number, manifest_list, summary, schema_id, timestamp_ms, created_at, updated_at, warehouse_id, first_row_id, assigned_rows, key_id) FROM stdin;
\.
--
-- Data for Name: table_snapshot_log; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_snapshot_log (sequence_number, table_id, snapshot_id, "timestamp", created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_sort_order; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_sort_order (sort_order_id, table_id, sort_order, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: table_statistics; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.table_statistics (snapshot_id, table_id, statistics_path, file_size_in_bytes, file_footer_size_in_bytes, key_metadata, blob_metadata, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: tabular; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.tabular (tabular_id, namespace_id, name, typ, metadata_location, created_at, updated_at, deleted_at, fs_protocol, fs_location, protected, warehouse_id, tabular_namespace_name) FROM stdin;
\.
--
-- Data for Name: task; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.task (task_id, warehouse_id, queue_name, status, picked_up_at, scheduled_for, attempt, parent_task_id, created_at, updated_at, task_data, entity_id, last_heartbeat_at, progress, execution_details, entity_name, entity_type) FROM stdin;
\.
--
-- Data for Name: task_config; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.task_config (warehouse_id, queue_name, config, max_time_since_last_heartbeat, created_at, updated_at) FROM stdin;
\.
--
-- Data for Name: task_log; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.task_log (task_id, attempt, warehouse_id, queue_name, task_data, status, entity_id, started_at, duration, message, created_at, progress, execution_details, attempt_scheduled_for, last_heartbeat_at, parent_task_id, task_created_at, entity_name, entity_type) FROM stdin;
\.
--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.users (id, name, email, user_type, last_updated_with, deleted_at, created_at, updated_at) FROM stdin;
\.
--
-- Data for Name: view; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.view (view_id, view_format_version, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: view_properties; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.view_properties (view_id, key, value, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: view_representation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.view_representation (view_representation_id, view_version_id, view_id, typ, sql, dialect, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: view_schema; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.view_schema (schema_id, view_id, schema, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: view_version; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.view_version (view_id, version_id, schema_id, "timestamp", default_namespace_id, default_catalog, summary, created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: view_version_log; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.view_version_log (view_id, version_id, "timestamp", created_at, updated_at, warehouse_id) FROM stdin;
\.
--
-- Data for Name: warehouse; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.warehouse (warehouse_id, warehouse_name, storage_profile, storage_secret_id, created_at, updated_at, status, tabular_expiration_seconds, tabular_delete_mode, project_id, protected) FROM stdin;
20ad557e-9d4b-11f1-af16-0ffd2f7e297a lakehouse {"type": "s3", "bucket": "warehouse", "flavor": "s3-compat", "region": "us-east-1", "endpoint": "http://127.0.0.1:9000/", "key-prefix": null, "sts-enabled": true, "sts-role-arn": null, "assume-role-arn": null, "aws-kms-key-arn": null, "sts-session-tags": {}, "path-style-access": true, "push-s3-delete-disabled": true, "remote-signing-url-style": "auto", "sts-token-validity-seconds": 3600, "allow-alternative-protocols": null} 20acd2ca-9d4b-11f1-a8cc-e78ad3985f54 2026-08-21 10:29:02.14913+00 \N active \N hard 00000000-0000-0000-0000-000000000000 f
\.
--
-- Data for Name: warehouse_statistics; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.warehouse_statistics (warehouse_id, number_of_views, number_of_tables, "timestamp", created_at, updated_at) FROM stdin;
20ad557e-9d4b-11f1-af16-0ffd2f7e297a 0 0 2026-08-21 10:00:01+00 2026-08-21 10:29:02.14913+00 \N
\.
--
-- Data for Name: warehouse_statistics_history; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.warehouse_statistics_history (number_of_views, number_of_tables, warehouse_id, "timestamp", created_at, updated_at) FROM stdin;
\.
--
-- Name: table_metadata_log_sequence_number_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.table_metadata_log_sequence_number_seq', 1, false);
--
-- Name: table_snapshot_log_sequence_number_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.table_snapshot_log_sequence_number_seq', 1, false);
--
-- Name: _sqlx_migrations _sqlx_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public._sqlx_migrations
ADD CONSTRAINT _sqlx_migrations_pkey PRIMARY KEY (version);
--
-- Name: current_view_metadata_version current_view_metadata_version_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.current_view_metadata_version
ADD CONSTRAINT current_view_metadata_version_pkey PRIMARY KEY (warehouse_id, view_id);
--
-- Name: endpoint_statistics endpoint_statistics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.endpoint_statistics
ADD CONSTRAINT endpoint_statistics_pkey PRIMARY KEY (endpoint_statistics_id);
--
-- Name: endpoint_statistics endpoint_statistics_project_id_warehouse_id_matched_path_st_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.endpoint_statistics
ADD CONSTRAINT endpoint_statistics_project_id_warehouse_id_matched_path_st_key UNIQUE NULLS NOT DISTINCT (project_id, warehouse_id, matched_path, status_code, "timestamp");
--
-- Name: namespace namespace_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.namespace
ADD CONSTRAINT namespace_pkey PRIMARY KEY (namespace_id);
--
-- Name: partition_statistics partition_statistics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.partition_statistics
ADD CONSTRAINT partition_statistics_pkey PRIMARY KEY (warehouse_id, table_id, snapshot_id);
--
-- Name: project project_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.project
ADD CONSTRAINT project_pkey PRIMARY KEY (project_id);
--
-- Name: role role_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.role
ADD CONSTRAINT role_pkey PRIMARY KEY (id);
--
-- Name: secret secret_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.secret
ADD CONSTRAINT secret_pkey PRIMARY KEY (secret_id);
--
-- Name: server server_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.server
ADD CONSTRAINT server_pkey PRIMARY KEY (single_row);
--
-- Name: table_current_schema table_current_schema_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_current_schema
ADD CONSTRAINT table_current_schema_pkey PRIMARY KEY (warehouse_id, table_id);
--
-- Name: table_default_partition_spec table_default_partition_spec_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_default_partition_spec
ADD CONSTRAINT table_default_partition_spec_pkey PRIMARY KEY (warehouse_id, table_id);
--
-- Name: table_default_sort_order table_default_sort_order_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_default_sort_order
ADD CONSTRAINT table_default_sort_order_pkey PRIMARY KEY (warehouse_id, table_id);
--
-- Name: table_encryption_keys table_encryption_keys_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_encryption_keys
ADD CONSTRAINT table_encryption_keys_pkey PRIMARY KEY (warehouse_id, table_id, key_id);
--
-- Name: table_metadata_log table_metadata_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_metadata_log
ADD CONSTRAINT table_metadata_log_pkey PRIMARY KEY (warehouse_id, table_id, sequence_number);
--
-- Name: table_partition_spec table_partition_spec_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_partition_spec
ADD CONSTRAINT table_partition_spec_pkey PRIMARY KEY (warehouse_id, table_id, partition_spec_id);
--
-- Name: table table_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."table"
ADD CONSTRAINT table_pkey PRIMARY KEY (warehouse_id, table_id);
--
-- Name: table_properties table_properties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_properties
ADD CONSTRAINT table_properties_pkey PRIMARY KEY (warehouse_id, table_id, key);
--
-- Name: table_refs table_refs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_refs
ADD CONSTRAINT table_refs_pkey PRIMARY KEY (warehouse_id, table_id, table_ref_name);
--
-- Name: table_schema table_schema_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_schema
ADD CONSTRAINT table_schema_pkey PRIMARY KEY (warehouse_id, table_id, schema_id);
--
-- Name: table_snapshot_log table_snapshot_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_snapshot_log
ADD CONSTRAINT table_snapshot_log_pkey PRIMARY KEY (warehouse_id, table_id, sequence_number);
--
-- Name: table_snapshot table_snapshot_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_snapshot
ADD CONSTRAINT table_snapshot_pkey PRIMARY KEY (warehouse_id, table_id, snapshot_id);
--
-- Name: table_sort_order table_sort_order_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_sort_order
ADD CONSTRAINT table_sort_order_pkey PRIMARY KEY (warehouse_id, table_id, sort_order_id);
--
-- Name: table_statistics table_statistics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_statistics
ADD CONSTRAINT table_statistics_pkey PRIMARY KEY (warehouse_id, table_id, snapshot_id);
--
-- Name: tabular tabular_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.tabular
ADD CONSTRAINT tabular_pkey PRIMARY KEY (warehouse_id, tabular_id);
--
-- Name: task_config task_config_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.task_config
ADD CONSTRAINT task_config_pkey PRIMARY KEY (warehouse_id, queue_name);
--
-- Name: task_log task_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.task_log
ADD CONSTRAINT task_log_pkey PRIMARY KEY (task_id, attempt);
--
-- Name: task task_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.task
ADD CONSTRAINT task_pkey PRIMARY KEY (task_id);
--
-- Name: task task_unique_warehouse_id_entity_type_entity_id_queue_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.task
ADD CONSTRAINT task_unique_warehouse_id_entity_type_entity_id_queue_name UNIQUE (warehouse_id, entity_type, entity_id, queue_name);
--
-- Name: tabular unique_name_per_namespace_id; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.tabular
ADD CONSTRAINT unique_name_per_namespace_id UNIQUE NULLS NOT DISTINCT (warehouse_id, namespace_id, name, deleted_at);
--
-- Name: namespace unique_namespace_id_per_warehouse; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.namespace
ADD CONSTRAINT unique_namespace_id_per_warehouse UNIQUE (warehouse_id, namespace_id);
--
-- Name: namespace unique_namespace_per_warehouse; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.namespace
ADD CONSTRAINT unique_namespace_per_warehouse UNIQUE (warehouse_id, namespace_name);
--
-- Name: view_schema unique_schema_per_view; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_schema
ADD CONSTRAINT unique_schema_per_view PRIMARY KEY (warehouse_id, view_id, schema_id);
--
-- Name: view_version unique_version_per_metadata; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_version
ADD CONSTRAINT unique_version_per_metadata PRIMARY KEY (warehouse_id, view_id, version_id);
--
-- Name: namespace unique_warehouse_id_namespace_id_namespace_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.namespace
ADD CONSTRAINT unique_warehouse_id_namespace_id_namespace_name UNIQUE (warehouse_id, namespace_id, namespace_name);
--
-- Name: warehouse unique_warehouse_name_in_project; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.warehouse
ADD CONSTRAINT unique_warehouse_name_in_project UNIQUE (project_id, warehouse_name);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: view view_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view
ADD CONSTRAINT view_pkey PRIMARY KEY (warehouse_id, view_id);
--
-- Name: view_properties view_properties_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_properties
ADD CONSTRAINT view_properties_pkey PRIMARY KEY (warehouse_id, view_id, key);
--
-- Name: view_representation view_representation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_representation
ADD CONSTRAINT view_representation_pkey PRIMARY KEY (warehouse_id, view_representation_id);
--
-- Name: view_version_log view_version_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_version_log
ADD CONSTRAINT view_version_log_pkey PRIMARY KEY (warehouse_id, view_id, version_id, "timestamp");
--
-- Name: warehouse warehouse_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.warehouse
ADD CONSTRAINT warehouse_pkey PRIMARY KEY (warehouse_id);
--
-- Name: warehouse_statistics_history warehouse_statistics_history_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.warehouse_statistics_history
ADD CONSTRAINT warehouse_statistics_history_pkey PRIMARY KEY (warehouse_id, "timestamp");
--
-- Name: warehouse_statistics warehouse_statistics_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.warehouse_statistics
ADD CONSTRAINT warehouse_statistics_pkey PRIMARY KEY (warehouse_id);
--
-- Name: idx_endpoint_stats_project_status_time; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX idx_endpoint_stats_project_status_time ON public.endpoint_statistics USING btree (project_id, status_code, "timestamp" DESC);
--
-- Name: idx_endpoint_stats_project_timestamp; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX idx_endpoint_stats_project_timestamp ON public.endpoint_statistics USING btree (project_id, "timestamp" DESC);
--
-- Name: idx_endpoint_stats_project_warehouse_time; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX idx_endpoint_stats_project_warehouse_time ON public.endpoint_statistics USING btree (project_id, warehouse_id, "timestamp" DESC);
--
-- Name: idx_warehouse_stats_history_time; Type: INDEX; Schema: public; Owner: postgres
--
CREATE UNIQUE INDEX idx_warehouse_stats_history_time ON public.warehouse_statistics_history USING btree (warehouse_id, "timestamp" DESC);
--
-- Name: namespace_namespace_name_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX namespace_namespace_name_idx ON public.namespace USING btree (namespace_name);
--
-- Name: namespace_warehouse_id_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX namespace_warehouse_id_idx ON public.namespace USING btree (warehouse_id);
--
-- Name: role_name_gist_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX role_name_gist_idx ON public.role USING gist (name public.gist_trgm_ops (siglen='256'));
--
-- Name: role_project_id_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX role_project_id_idx ON public.role USING btree (project_id);
--
-- Name: tabular_name_namespace_name_gist_index; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX tabular_name_namespace_name_gist_index ON public.tabular USING gist (warehouse_id, public.concat_namespace_name_tabular_name(tabular_namespace_name, name) public.gist_trgm_ops (siglen='256')) WHERE ((deleted_at IS NULL) AND (metadata_location IS NOT NULL));
--
-- Name: tabular_warehouse_id_location_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX tabular_warehouse_id_location_idx ON public.tabular USING btree (warehouse_id, fs_location);
--
-- Name: task_log_warehouse_created_at_id_attempt_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX task_log_warehouse_created_at_id_attempt_idx ON public.task_log USING btree (warehouse_id, task_created_at DESC);
--
-- Name: task_log_warehouse_id_entity_type_entity_id_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX task_log_warehouse_id_entity_type_entity_id_idx ON public.task_log USING btree (warehouse_id, entity_type, entity_id, task_created_at DESC);
--
-- Name: task_log_warehouse_queue_created_at_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX task_log_warehouse_queue_created_at_idx ON public.task_log USING btree (warehouse_id, queue_name, task_created_at DESC);
--
-- Name: task_queue_name_status_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX task_queue_name_status_idx ON public.task USING btree (queue_name, status, scheduled_for);
--
-- Name: task_warehouse_created_at_id_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX task_warehouse_created_at_id_idx ON public.task USING btree (warehouse_id, created_at DESC);
--
-- Name: task_warehouse_id_entity_type_entity_id_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX task_warehouse_id_entity_type_entity_id_idx ON public.task USING btree (warehouse_id, entity_type, entity_id, created_at DESC);
--
-- Name: task_warehouse_queue_created_at_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX task_warehouse_queue_created_at_idx ON public.task USING btree (warehouse_id, queue_name, created_at DESC);
--
-- Name: unique_role_name_in_project; Type: INDEX; Schema: public; Owner: postgres
--
CREATE UNIQUE INDEX unique_role_name_in_project ON public.role USING btree (project_id, lower(name));
--
-- Name: unique_user_email; Type: INDEX; Schema: public; Owner: postgres
--
CREATE UNIQUE INDEX unique_user_email ON public.users USING btree (email);
--
-- Name: users_name_email_gist_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX users_name_email_gist_idx ON public.users USING gist ((((name || ' '::text) || email)) public.gist_trgm_ops (siglen='256'));
--
-- Name: view_representation_view_id_version_id_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX view_representation_view_id_version_id_idx ON public.view_representation USING btree (warehouse_id, view_id, view_version_id);
--
-- Name: warehouse_project_id_name; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX warehouse_project_id_name ON public.warehouse USING btree (project_id, warehouse_name);
--
-- Name: warehouse_status_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX warehouse_status_idx ON public.warehouse USING btree (status);
--
-- Name: table before_insert_check_metadata; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER before_insert_check_metadata BEFORE INSERT OR UPDATE ON public."table" FOR EACH ROW EXECUTE FUNCTION public.prohibit_updates_of_metadata_blob();
--
-- Name: current_view_metadata_version set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.current_view_metadata_version FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: endpoint_statistics set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.endpoint_statistics FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: namespace set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.namespace FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: partition_statistics set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.partition_statistics FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: project set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.project FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: role set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.role FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: secret set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.secret FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: server set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.server FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public."table" FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_current_schema set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_current_schema FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_default_partition_spec set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_default_partition_spec FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_default_sort_order set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_default_sort_order FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_encryption_keys set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_encryption_keys FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_metadata_log set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_metadata_log FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_partition_spec set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_partition_spec FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_properties set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_properties FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_refs set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_refs FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_schema set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_schema FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_snapshot set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_snapshot FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_snapshot_log set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_snapshot_log FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_sort_order set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_sort_order FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: table_statistics set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.table_statistics FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: tabular set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.tabular FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: task set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.task FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: task_config set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.task_config FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: users set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.users FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: view set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.view FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: view_properties set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.view_properties FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: view_representation set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.view_representation FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: view_schema set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.view_schema FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: view_version set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.view_version FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: warehouse set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.warehouse FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: warehouse_statistics set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.warehouse_statistics FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: warehouse_statistics_history set_updated_at; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER set_updated_at BEFORE UPDATE ON public.warehouse_statistics_history FOR EACH ROW WHEN ((old.* IS DISTINCT FROM new.*)) EXECUTE FUNCTION public.set_updated_at();
--
-- Name: tabular update_counts; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE CONSTRAINT TRIGGER update_counts AFTER INSERT OR DELETE ON public.tabular DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE FUNCTION public.update_counts();
--
-- Name: tabular update_counts_trunc; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER update_counts_trunc AFTER TRUNCATE ON public.tabular FOR EACH STATEMENT EXECUTE FUNCTION public.update_counts();
--
-- Name: current_view_metadata_version current_view_metadata_version_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.current_view_metadata_version
ADD CONSTRAINT current_view_metadata_version_view_id_fkey FOREIGN KEY (warehouse_id, view_id) REFERENCES public.view(warehouse_id, view_id) ON DELETE CASCADE;
--
-- Name: current_view_metadata_version current_view_metadata_version_view_id_version_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.current_view_metadata_version
ADD CONSTRAINT current_view_metadata_version_view_id_version_id_fkey FOREIGN KEY (warehouse_id, view_id, version_id) REFERENCES public.view_version(warehouse_id, view_id, version_id) ON DELETE CASCADE;
--
-- Name: endpoint_statistics endpoint_statistics_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.endpoint_statistics
ADD CONSTRAINT endpoint_statistics_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project(project_id) ON DELETE CASCADE;
--
-- Name: namespace namespace_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.namespace
ADD CONSTRAINT namespace_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.warehouse(warehouse_id);
--
-- Name: partition_statistics partition_statistics_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.partition_statistics
ADD CONSTRAINT partition_statistics_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: partition_statistics partition_statistics_table_id_snapshot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.partition_statistics
ADD CONSTRAINT partition_statistics_table_id_snapshot_id_fkey FOREIGN KEY (warehouse_id, table_id, snapshot_id) REFERENCES public.table_snapshot(warehouse_id, table_id, snapshot_id) ON DELETE CASCADE;
--
-- Name: role role_project_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.role
ADD CONSTRAINT role_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.project(project_id);
--
-- Name: table_current_schema table_current_schema_table_id_schema_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_current_schema
ADD CONSTRAINT table_current_schema_table_id_schema_id_fkey FOREIGN KEY (warehouse_id, table_id, schema_id) REFERENCES public.table_schema(warehouse_id, table_id, schema_id) ON DELETE CASCADE;
--
-- Name: table_default_partition_spec table_default_partition_spec_table_id_partition_spec_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_default_partition_spec
ADD CONSTRAINT table_default_partition_spec_table_id_partition_spec_id_fkey FOREIGN KEY (warehouse_id, table_id, partition_spec_id) REFERENCES public.table_partition_spec(warehouse_id, table_id, partition_spec_id) ON DELETE CASCADE;
--
-- Name: table_default_sort_order table_default_sort_order_table_id_sort_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_default_sort_order
ADD CONSTRAINT table_default_sort_order_table_id_sort_order_id_fkey FOREIGN KEY (warehouse_id, table_id, sort_order_id) REFERENCES public.table_sort_order(warehouse_id, table_id, sort_order_id) ON DELETE CASCADE;
--
-- Name: table_encryption_keys table_encryption_keys_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_encryption_keys
ADD CONSTRAINT table_encryption_keys_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_metadata_log table_metadata_log_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_metadata_log
ADD CONSTRAINT table_metadata_log_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_partition_spec table_partition_spec_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_partition_spec
ADD CONSTRAINT table_partition_spec_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_properties table_properties_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_properties
ADD CONSTRAINT table_properties_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_refs table_refs_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_refs
ADD CONSTRAINT table_refs_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_refs table_refs_table_id_snapshot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_refs
ADD CONSTRAINT table_refs_table_id_snapshot_id_fkey FOREIGN KEY (warehouse_id, table_id, snapshot_id) REFERENCES public.table_snapshot(warehouse_id, table_id, snapshot_id) ON DELETE CASCADE;
--
-- Name: table_schema table_schema_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_schema
ADD CONSTRAINT table_schema_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_snapshot_log table_snapshot_log_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_snapshot_log
ADD CONSTRAINT table_snapshot_log_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_snapshot table_snapshot_table_id_schema_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_snapshot
ADD CONSTRAINT table_snapshot_table_id_schema_id_fkey FOREIGN KEY (warehouse_id, table_id, schema_id) REFERENCES public.table_schema(warehouse_id, table_id, schema_id) ON DELETE CASCADE;
--
-- Name: table_sort_order table_sort_order_table_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_sort_order
ADD CONSTRAINT table_sort_order_table_id_fkey FOREIGN KEY (warehouse_id, table_id) REFERENCES public."table"(warehouse_id, table_id) ON DELETE CASCADE;
--
-- Name: table_statistics table_statistics_table_id_snapshot_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.table_statistics
ADD CONSTRAINT table_statistics_table_id_snapshot_id_fkey FOREIGN KEY (warehouse_id, table_id, snapshot_id) REFERENCES public.table_snapshot(warehouse_id, table_id, snapshot_id) ON DELETE CASCADE;
--
-- Name: table tabular_ident_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."table"
ADD CONSTRAINT tabular_ident_fk FOREIGN KEY (warehouse_id, table_id) REFERENCES public.tabular(warehouse_id, tabular_id) ON DELETE CASCADE;
--
-- Name: view tabular_ident_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view
ADD CONSTRAINT tabular_ident_fk FOREIGN KEY (warehouse_id, view_id) REFERENCES public.tabular(warehouse_id, tabular_id) ON DELETE CASCADE;
--
-- Name: tabular tabular_warehouse_id_namespace_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.tabular
ADD CONSTRAINT tabular_warehouse_id_namespace_id_fkey FOREIGN KEY (warehouse_id, namespace_id) REFERENCES public.namespace(warehouse_id, namespace_id) ON DELETE CASCADE;
--
-- Name: tabular tabular_warehouse_id_namespace_id_namespace_name_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.tabular
ADD CONSTRAINT tabular_warehouse_id_namespace_id_namespace_name_fkey FOREIGN KEY (warehouse_id, namespace_id, tabular_namespace_name) REFERENCES public.namespace(warehouse_id, namespace_id, namespace_name) ON UPDATE CASCADE;
--
-- Name: task_config task_config_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.task_config
ADD CONSTRAINT task_config_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.warehouse(warehouse_id) ON DELETE CASCADE;
--
-- Name: task_log task_log_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.task_log
ADD CONSTRAINT task_log_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.warehouse(warehouse_id) ON DELETE CASCADE;
--
-- Name: task task_warehouse_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.task
ADD CONSTRAINT task_warehouse_id_fk FOREIGN KEY (warehouse_id) REFERENCES public.warehouse(warehouse_id);
--
-- Name: view_properties view_properties_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_properties
ADD CONSTRAINT view_properties_view_id_fkey FOREIGN KEY (warehouse_id, view_id) REFERENCES public.view(warehouse_id, view_id) ON DELETE CASCADE;
--
-- Name: view_representation view_representation_view_id_view_version_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_representation
ADD CONSTRAINT view_representation_view_id_view_version_id_fkey FOREIGN KEY (warehouse_id, view_id, view_version_id) REFERENCES public.view_version(warehouse_id, view_id, version_id) ON DELETE CASCADE;
--
-- Name: view_schema view_schema_view_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_schema
ADD CONSTRAINT view_schema_view_id_fkey FOREIGN KEY (warehouse_id, view_id) REFERENCES public.view(warehouse_id, view_id) ON DELETE CASCADE;
--
-- Name: view_version view_version_default_namespace_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_version
ADD CONSTRAINT view_version_default_namespace_id_fkey FOREIGN KEY (default_namespace_id) REFERENCES public.namespace(namespace_id);
--
-- Name: view_version_log view_version_log_view_id_version_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_version_log
ADD CONSTRAINT view_version_log_view_id_version_id_fkey FOREIGN KEY (warehouse_id, view_id, version_id) REFERENCES public.view_version(warehouse_id, view_id, version_id) ON DELETE CASCADE;
--
-- Name: view_version view_version_view_id_schema_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.view_version
ADD CONSTRAINT view_version_view_id_schema_id_fkey FOREIGN KEY (warehouse_id, view_id, schema_id) REFERENCES public.view_schema(warehouse_id, view_id, schema_id) ON DELETE CASCADE;
--
-- Name: warehouse warehouse_project_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.warehouse
ADD CONSTRAINT warehouse_project_id_fk FOREIGN KEY (project_id) REFERENCES public.project(project_id) ON UPDATE CASCADE;
--
-- Name: warehouse_statistics_history warehouse_statistics_history_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.warehouse_statistics_history
ADD CONSTRAINT warehouse_statistics_history_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.warehouse(warehouse_id) ON DELETE CASCADE;
--
-- Name: warehouse_statistics warehouse_statistics_warehouse_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.warehouse_statistics
ADD CONSTRAINT warehouse_statistics_warehouse_id_fkey FOREIGN KEY (warehouse_id) REFERENCES public.warehouse(warehouse_id) ON DELETE CASCADE;
--
-- PostgreSQL database dump complete
--
\unrestrict gbRTxAEIG8ACxsFIau1XS3kK51K4bzseHNb06VV3xMgTTsSvJbk82hxwEE5Ytfw

Xet Storage Details

Size:
110 kB
·
Xet hash:
8fc75d39ea5a429badd720d4ac65fdd9acb75dea81b3d9c79744e983dc166a55

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.