CREATE TABLE packages_tags (
    id bigint NOT NULL,
    package_id bigint NOT NULL,
    name character varying(255) NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint,
    CONSTRAINT check_91b8472153 CHECK ((project_id IS NOT NULL))
);

CREATE SEQUENCE packages_tags_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE packages_tags_id_seq OWNED BY packages_tags.id;

CREATE TABLE packages_terraform_module_metadata (
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    package_id bigint NOT NULL,
    project_id bigint NOT NULL,
    fields jsonb NOT NULL,
    CONSTRAINT chk_rails_49f7b485ae CHECK ((char_length((fields)::text) <= 10485760))
);

CREATE TABLE pages_deployment_states (
    pages_deployment_id bigint NOT NULL,
    verification_state smallint DEFAULT 0 NOT NULL,
    verification_started_at timestamp with time zone,
    verification_retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    verification_retry_count smallint,
    verification_checksum bytea,
    verification_failure text,
    project_id bigint,
    CONSTRAINT check_15217e8c3a CHECK ((char_length(verification_failure) <= 255))
);

CREATE SEQUENCE pages_deployment_states_pages_deployment_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pages_deployment_states_pages_deployment_id_seq OWNED BY pages_deployment_states.pages_deployment_id;

CREATE TABLE pages_deployments (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    ci_build_id bigint,
    file_store smallint NOT NULL,
    file text NOT NULL,
    file_count integer NOT NULL,
    file_sha256 bytea NOT NULL,
    size bigint,
    root_directory text DEFAULT 'public'::text,
    path_prefix text,
    build_ref text,
    deleted_at timestamp with time zone,
    upload_ready boolean DEFAULT false,
    expires_at timestamp with time zone,
    CONSTRAINT check_4d04b8dc9a CHECK ((char_length(path_prefix) <= 128)),
    CONSTRAINT check_5f9132a958 CHECK ((size IS NOT NULL)),
    CONSTRAINT check_7e938c810a CHECK ((char_length(root_directory) <= 255)),
    CONSTRAINT check_b44e900e5c CHECK ((char_length(build_ref) <= 512)),
    CONSTRAINT check_f0fe8032dd CHECK ((char_length(file) <= 255))
);

CREATE SEQUENCE pages_deployments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pages_deployments_id_seq OWNED BY pages_deployments.id;

CREATE TABLE pages_domain_acme_orders (
    id bigint NOT NULL,
    pages_domain_id bigint NOT NULL,
    expires_at timestamp with time zone NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    url character varying NOT NULL,
    challenge_token character varying NOT NULL,
    challenge_file_content text NOT NULL,
    encrypted_private_key text NOT NULL,
    encrypted_private_key_iv text NOT NULL,
    project_id bigint
);

CREATE SEQUENCE pages_domain_acme_orders_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pages_domain_acme_orders_id_seq OWNED BY pages_domain_acme_orders.id;

CREATE TABLE pages_domains (
    id bigint NOT NULL,
    project_id bigint,
    certificate text,
    encrypted_key text,
    encrypted_key_iv character varying,
    encrypted_key_salt character varying,
    domain character varying,
    verified_at timestamp with time zone,
    verification_code character varying NOT NULL,
    enabled_until timestamp with time zone,
    remove_at timestamp with time zone,
    auto_ssl_enabled boolean DEFAULT false NOT NULL,
    certificate_valid_not_before timestamp with time zone,
    certificate_valid_not_after timestamp with time zone,
    certificate_source smallint DEFAULT 0 NOT NULL,
    wildcard boolean DEFAULT false NOT NULL,
    usage smallint DEFAULT 0 NOT NULL,
    scope smallint DEFAULT 2 NOT NULL,
    auto_ssl_failed boolean DEFAULT false NOT NULL,
    CONSTRAINT check_790fbb64fa CHECK ((project_id IS NOT NULL))
);

CREATE SEQUENCE pages_domains_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pages_domains_id_seq OWNED BY pages_domains.id;

CREATE TABLE path_locks (
    id bigint NOT NULL,
    path character varying NOT NULL,
    project_id bigint,
    user_id bigint,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    CONSTRAINT check_e1de2eb0f1 CHECK ((project_id IS NOT NULL))
);

CREATE SEQUENCE path_locks_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE path_locks_id_seq OWNED BY path_locks.id;

CREATE TABLE personal_access_tokens (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    name character varying NOT NULL,
    revoked boolean DEFAULT false,
    expires_at date,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    scopes character varying DEFAULT '--- []
'::character varying NOT NULL,
    impersonation boolean DEFAULT false NOT NULL,
    token_digest character varying,
    expire_notification_delivered boolean DEFAULT false NOT NULL,
    last_used_at timestamp with time zone,
    after_expiry_notification_delivered boolean DEFAULT false NOT NULL,
    previous_personal_access_token_id bigint,
    advanced_scopes text,
    organization_id bigint NOT NULL,
    seven_days_notification_sent_at timestamp with time zone,
    thirty_days_notification_sent_at timestamp with time zone,
    sixty_days_notification_sent_at timestamp with time zone,
    CONSTRAINT check_aa95773861 CHECK ((char_length(advanced_scopes) <= 4096))
);

CREATE SEQUENCE personal_access_tokens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE personal_access_tokens_id_seq OWNED BY personal_access_tokens.id;

CREATE TABLE pipl_users (
    user_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    initial_email_sent_at timestamp with time zone,
    last_access_from_pipl_country_at timestamp with time zone NOT NULL
);

CREATE TABLE plan_limits (
    id bigint NOT NULL,
    plan_id bigint NOT NULL,
    ci_pipeline_size integer DEFAULT 0 NOT NULL,
    ci_active_jobs integer DEFAULT 0 NOT NULL,
    project_hooks integer DEFAULT 100 NOT NULL,
    group_hooks integer DEFAULT 50 NOT NULL,
    ci_project_subscriptions integer DEFAULT 2 NOT NULL,
    ci_pipeline_schedules integer DEFAULT 10 NOT NULL,
    offset_pagination_limit integer DEFAULT 50000 NOT NULL,
    ci_instance_level_variables integer DEFAULT 25 NOT NULL,
    storage_size_limit integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_lsif integer DEFAULT 100 NOT NULL,
    ci_max_artifact_size_archive integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_metadata integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_trace integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_junit integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_sast integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_dependency_scanning integer DEFAULT 350 NOT NULL,
    ci_max_artifact_size_container_scanning integer DEFAULT 150 NOT NULL,
    ci_max_artifact_size_dast integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_codequality integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_license_management integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_license_scanning integer DEFAULT 100 NOT NULL,
    ci_max_artifact_size_performance integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_metrics integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_metrics_referee integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_network_referee integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_dotenv integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_cobertura integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_terraform integer DEFAULT 5 NOT NULL,
    ci_max_artifact_size_accessibility integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_cluster_applications integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_secret_detection integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_requirements integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_coverage_fuzzing integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_browser_performance integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_load_performance integer DEFAULT 0 NOT NULL,
    ci_needs_size_limit integer DEFAULT 50 NOT NULL,
    conan_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
    maven_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
    npm_max_file_size bigint DEFAULT 524288000 NOT NULL,
    nuget_max_file_size bigint DEFAULT 524288000 NOT NULL,
    pypi_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
    generic_packages_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL,
    golang_max_file_size bigint DEFAULT 104857600 NOT NULL,
    debian_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
    project_feature_flags integer DEFAULT 200 NOT NULL,
    ci_max_artifact_size_api_fuzzing integer DEFAULT 0 NOT NULL,
    ci_pipeline_deployments integer DEFAULT 500 NOT NULL,
    pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL,
    daily_invites integer DEFAULT 0 NOT NULL,
    rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL,
    terraform_module_max_file_size bigint DEFAULT 1073741824 NOT NULL,
    helm_max_file_size bigint DEFAULT 5242880 NOT NULL,
    ci_registered_group_runners integer DEFAULT 1000 NOT NULL,
    ci_registered_project_runners integer DEFAULT 1000 NOT NULL,
    ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_running_container_scanning integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_cluster_image_scanning integer DEFAULT 0 NOT NULL,
    ci_jobs_trace_size_limit integer DEFAULT 100 NOT NULL,
    pages_file_entries integer DEFAULT 200000 NOT NULL,
    dast_profile_schedules integer DEFAULT 1 NOT NULL,
    external_audit_event_destinations integer DEFAULT 5 NOT NULL,
    dotenv_variables integer DEFAULT 20 NOT NULL,
    dotenv_size integer DEFAULT 5120 NOT NULL,
    pipeline_triggers integer DEFAULT 25000 NOT NULL,
    project_ci_secure_files integer DEFAULT 100 NOT NULL,
    repository_size bigint,
    security_policy_scan_execution_schedules integer DEFAULT 0 NOT NULL,
    web_hook_calls_mid integer DEFAULT 0 NOT NULL,
    web_hook_calls_low integer DEFAULT 0 NOT NULL,
    project_ci_variables integer DEFAULT 8000 NOT NULL,
    group_ci_variables integer DEFAULT 30000 NOT NULL,
    ci_max_artifact_size_cyclonedx integer DEFAULT 1 NOT NULL,
    rpm_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL,
    ci_max_artifact_size_requirements_v2 integer DEFAULT 0 NOT NULL,
    pipeline_hierarchy_size integer DEFAULT 1000 NOT NULL,
    enforcement_limit integer DEFAULT 0 NOT NULL,
    notification_limit integer DEFAULT 0 NOT NULL,
    dashboard_limit_enabled_at timestamp with time zone,
    web_hook_calls integer DEFAULT 0 NOT NULL,
    project_access_token_limit integer DEFAULT 0 NOT NULL,
    google_cloud_logging_configurations integer DEFAULT 5 NOT NULL,
    ml_model_max_file_size bigint DEFAULT '10737418240'::bigint NOT NULL,
    limits_history jsonb DEFAULT '{}'::jsonb NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    ci_max_artifact_size_annotations integer DEFAULT 0 NOT NULL,
    ci_job_annotations_size integer DEFAULT 81920 NOT NULL,
    ci_job_annotations_num integer DEFAULT 20 NOT NULL,
    file_size_limit_mb double precision DEFAULT 100.0 NOT NULL,
    audit_events_amazon_s3_configurations integer DEFAULT 5 NOT NULL,
    ci_max_artifact_size_repository_xray bigint DEFAULT 1073741824 NOT NULL,
    active_versioned_pages_deployments_limit_by_namespace integer DEFAULT 0 NOT NULL,
    ci_max_artifact_size_jacoco bigint DEFAULT 0 NOT NULL,
    import_placeholder_user_limit_tier_1 integer DEFAULT 0 NOT NULL,
    import_placeholder_user_limit_tier_2 integer DEFAULT 0 NOT NULL,
    import_placeholder_user_limit_tier_3 integer DEFAULT 0 NOT NULL,
    import_placeholder_user_limit_tier_4 integer DEFAULT 0 NOT NULL
);

CREATE SEQUENCE plan_limits_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE plan_limits_id_seq OWNED BY plan_limits.id;

CREATE TABLE plans (
    id bigint NOT NULL,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    name character varying,
    title character varying
);

CREATE SEQUENCE plans_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE plans_id_seq OWNED BY plans.id;

CREATE TABLE pm_advisories (
    id bigint NOT NULL,
    advisory_xid text NOT NULL,
    published_date date NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    source_xid smallint NOT NULL,
    title text,
    description text,
    cvss_v2 text,
    cvss_v3 text,
    urls text[] DEFAULT '{}'::text[],
    identifiers jsonb NOT NULL,
    CONSTRAINT check_152def3868 CHECK ((char_length(cvss_v2) <= 128)),
    CONSTRAINT check_19cbd06439 CHECK ((char_length(advisory_xid) <= 36)),
    CONSTRAINT check_bed97fa77a CHECK ((char_length(cvss_v3) <= 128)),
    CONSTRAINT check_e4bfd3ffbf CHECK ((char_length(title) <= 256)),
    CONSTRAINT check_fee880f7aa CHECK ((char_length(description) <= 8192)),
    CONSTRAINT chk_rails_e73af9de76 CHECK ((cardinality(urls) <= 20))
);

CREATE SEQUENCE pm_advisories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_advisories_id_seq OWNED BY pm_advisories.id;

CREATE TABLE pm_affected_packages (
    id bigint NOT NULL,
    pm_advisory_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    purl_type smallint NOT NULL,
    package_name text NOT NULL,
    distro_version text DEFAULT ''::text NOT NULL,
    solution text,
    affected_range text NOT NULL,
    fixed_versions text[] DEFAULT '{}'::text[],
    overridden_advisory_fields jsonb DEFAULT '{}'::jsonb NOT NULL,
    versions jsonb DEFAULT '[]'::jsonb NOT NULL,
    CONSTRAINT check_5dd528a2be CHECK ((char_length(package_name) <= 256)),
    CONSTRAINT check_80dea16c7b CHECK ((char_length(affected_range) <= 512)),
    CONSTRAINT check_d1d4646298 CHECK ((char_length(solution) <= 2048)),
    CONSTRAINT check_ec4c8efb5e CHECK ((char_length(distro_version) <= 256)),
    CONSTRAINT chk_rails_a0f80d74e0 CHECK ((cardinality(fixed_versions) <= 10))
);

CREATE SEQUENCE pm_affected_packages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_affected_packages_id_seq OWNED BY pm_affected_packages.id;

CREATE TABLE pm_checkpoints (
    sequence integer NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    purl_type smallint NOT NULL,
    chunk smallint NOT NULL,
    data_type smallint DEFAULT 1 NOT NULL,
    version_format smallint DEFAULT 1 NOT NULL,
    id bigint NOT NULL
);

CREATE SEQUENCE pm_checkpoints_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_checkpoints_id_seq OWNED BY pm_checkpoints.id;

CREATE TABLE pm_cve_enrichment (
    id bigint NOT NULL,
    epss_score double precision NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    cve text NOT NULL,
    is_known_exploit boolean DEFAULT false NOT NULL,
    CONSTRAINT check_16651e3ffb CHECK ((char_length(cve) <= 24))
);

CREATE SEQUENCE pm_cve_enrichment_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_cve_enrichment_id_seq OWNED BY pm_cve_enrichment.id;

CREATE TABLE pm_licenses (
    id bigint NOT NULL,
    spdx_identifier text NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT check_c1eb81d1ba CHECK ((char_length(spdx_identifier) <= 50))
);

CREATE SEQUENCE pm_licenses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_licenses_id_seq OWNED BY pm_licenses.id;

CREATE TABLE pm_package_version_licenses (
    pm_package_version_id bigint NOT NULL,
    pm_license_id bigint NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    id bigint NOT NULL
);

CREATE SEQUENCE pm_package_version_licenses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_package_version_licenses_id_seq OWNED BY pm_package_version_licenses.id;

CREATE TABLE pm_package_versions (
    id bigint NOT NULL,
    pm_package_id bigint NOT NULL,
    version text NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT check_2d8a88cfcc CHECK ((char_length(version) <= 255))
);

CREATE SEQUENCE pm_package_versions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_package_versions_id_seq OWNED BY pm_package_versions.id;

CREATE TABLE pm_packages (
    id bigint NOT NULL,
    purl_type smallint NOT NULL,
    name text NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    licenses jsonb,
    CONSTRAINT check_3a3aedb8ba CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE pm_packages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pm_packages_id_seq OWNED BY pm_packages.id;

CREATE TABLE pool_repositories (
    id bigint NOT NULL,
    shard_id bigint NOT NULL,
    disk_path character varying,
    state character varying,
    source_project_id bigint
);

CREATE SEQUENCE pool_repositories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE pool_repositories_id_seq OWNED BY pool_repositories.id;

CREATE TABLE postgres_async_foreign_key_validations (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    name text NOT NULL,
    table_name text NOT NULL,
    last_error text,
    attempts integer DEFAULT 0 NOT NULL,
    constraint_type smallint DEFAULT 0 NOT NULL,
    CONSTRAINT check_536a40afbf CHECK ((char_length(last_error) <= 10000)),
    CONSTRAINT check_74fb7c8e57 CHECK ((char_length(name) <= 63)),
    CONSTRAINT check_cd435d6301 CHECK ((char_length(table_name) <= 63))
);

CREATE SEQUENCE postgres_async_foreign_key_validations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE postgres_async_foreign_key_validations_id_seq OWNED BY postgres_async_foreign_key_validations.id;

CREATE TABLE postgres_async_indexes (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    name text NOT NULL,
    definition text NOT NULL,
    table_name text NOT NULL,
    attempts integer DEFAULT 0 NOT NULL,
    last_error text,
    CONSTRAINT check_083b21157b CHECK ((char_length(definition) <= 2048)),
    CONSTRAINT check_45dc23c315 CHECK ((char_length(last_error) <= 10000)),
    CONSTRAINT check_b732c6cd1d CHECK ((char_length(name) <= 63)),
    CONSTRAINT check_schema_and_name_length CHECK ((char_length(table_name) <= 127))
);

CREATE SEQUENCE postgres_async_indexes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE postgres_async_indexes_id_seq OWNED BY postgres_async_indexes.id;

CREATE VIEW postgres_autovacuum_activity AS
 WITH processes AS (
         SELECT postgres_pg_stat_activity_autovacuum.query,
            postgres_pg_stat_activity_autovacuum.query_start,
            regexp_matches(postgres_pg_stat_activity_autovacuum.query, '^autovacuum: VACUUM (\w+)\.(\w+)'::text) AS matches,
                CASE
                    WHEN (postgres_pg_stat_activity_autovacuum.query ~~* '%wraparound)'::text) THEN true
                    ELSE false
                END AS wraparound_prevention
           FROM postgres_pg_stat_activity_autovacuum() postgres_pg_stat_activity_autovacuum(query, query_start)
          WHERE (postgres_pg_stat_activity_autovacuum.query ~* '^autovacuum: VACUUM \w+\.\w+'::text)
        )
 SELECT ((processes.matches[1] || '.'::text) || processes.matches[2]) AS table_identifier,
    processes.matches[1] AS schema,
    processes.matches[2] AS "table",
    processes.query_start AS vacuum_start,
    processes.wraparound_prevention
   FROM processes;

COMMENT ON VIEW postgres_autovacuum_activity IS 'Contains information about PostgreSQL backends currently performing autovacuum operations on the tables indicated here.';

CREATE VIEW postgres_constraints AS
 SELECT pg_constraint.oid,
    pg_constraint.conname AS name,
    pg_constraint.contype AS constraint_type,
    pg_constraint.convalidated AS constraint_valid,
    ( SELECT array_agg(pg_attribute.attname ORDER BY attnums.ordering) AS array_agg
           FROM (unnest(pg_constraint.conkey) WITH ORDINALITY attnums(attnum, ordering)
             JOIN pg_attribute ON (((pg_attribute.attnum = attnums.attnum) AND (pg_attribute.attrelid = pg_class.oid))))) AS column_names,
    (((pg_namespace.nspname)::text || '.'::text) || (pg_class.relname)::text) AS table_identifier,
    NULLIF(pg_constraint.conparentid, (0)::oid) AS parent_constraint_oid,
    pg_get_constraintdef(pg_constraint.oid) AS definition
   FROM ((pg_constraint
     JOIN pg_class ON ((pg_constraint.conrelid = pg_class.oid)))
     JOIN pg_namespace ON ((pg_class.relnamespace = pg_namespace.oid)));

CREATE VIEW postgres_foreign_keys AS
 SELECT pg_constraint.oid,
    pg_constraint.conname AS name,
    (((constrained_namespace.nspname)::text || '.'::text) || (constrained_table.relname)::text) AS constrained_table_identifier,
    (((referenced_namespace.nspname)::text || '.'::text) || (referenced_table.relname)::text) AS referenced_table_identifier,
    (constrained_table.relname)::text AS constrained_table_name,
    (referenced_table.relname)::text AS referenced_table_name,
    constrained_cols.constrained_columns,
    referenced_cols.referenced_columns,
    pg_constraint.confdeltype AS on_delete_action,
    pg_constraint.confupdtype AS on_update_action,
    (pg_constraint.coninhcount > 0) AS is_inherited,
    pg_constraint.convalidated AS is_valid,
    partitioned_parent_oids.parent_oid
   FROM (((((((pg_constraint
     JOIN pg_class constrained_table ON ((constrained_table.oid = pg_constraint.conrelid)))
     JOIN pg_class referenced_table ON ((referenced_table.oid = pg_constraint.confrelid)))
     JOIN pg_namespace constrained_namespace ON ((constrained_table.relnamespace = constrained_namespace.oid)))
     JOIN pg_namespace referenced_namespace ON ((referenced_table.relnamespace = referenced_namespace.oid)))
     CROSS JOIN LATERAL ( SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) AS array_agg
           FROM (unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)
             JOIN pg_attribute ON (((pg_attribute.attnum = conkey.attnum) AND (pg_attribute.attrelid = constrained_table.oid))))) constrained_cols(constrained_columns))
     CROSS JOIN LATERAL ( SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx) AS array_agg
           FROM (unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)
             JOIN pg_attribute ON (((pg_attribute.attnum = confkey.attnum) AND (pg_attribute.attrelid = referenced_table.oid))))) referenced_cols(referenced_columns))
     LEFT JOIN LATERAL ( SELECT pg_depend.refobjid AS parent_oid
           FROM pg_depend
          WHERE ((pg_depend.objid = pg_constraint.oid) AND (pg_depend.deptype = 'P'::"char") AND (pg_depend.refobjid IN ( SELECT pg_constraint_1.oid
                   FROM pg_constraint pg_constraint_1
                  WHERE (pg_constraint_1.contype = 'f'::"char"))))
         LIMIT 1) partitioned_parent_oids(parent_oid) ON (true))
  WHERE (pg_constraint.contype = 'f'::"char");

CREATE VIEW postgres_index_bloat_estimates AS
 SELECT (((relation_stats.nspname)::text || '.'::text) || (relation_stats.idxname)::text) AS identifier,
    (
        CASE
            WHEN ((relation_stats.relpages)::double precision > relation_stats.est_pages_ff) THEN ((relation_stats.bs)::double precision * ((relation_stats.relpages)::double precision - relation_stats.est_pages_ff))
            ELSE (0)::double precision
        END)::bigint AS bloat_size_bytes
   FROM ( SELECT COALESCE(((1)::double precision + ceil((rows_hdr_pdg_stats.reltuples / floor((((((rows_hdr_pdg_stats.bs - (rows_hdr_pdg_stats.pageopqdata)::numeric) - (rows_hdr_pdg_stats.pagehdr)::numeric) * (rows_hdr_pdg_stats.fillfactor)::numeric))::double precision / ((100)::double precision * (((4)::numeric + rows_hdr_pdg_stats.nulldatahdrwidth))::double precision)))))), (0)::double precision) AS est_pages_ff,
            rows_hdr_pdg_stats.bs,
            rows_hdr_pdg_stats.nspname,
            rows_hdr_pdg_stats.tblname,
            rows_hdr_pdg_stats.idxname,
            rows_hdr_pdg_stats.relpages,
            rows_hdr_pdg_stats.is_na
           FROM ( SELECT rows_data_stats.maxalign,
                    rows_data_stats.bs,
                    rows_data_stats.nspname,
                    rows_data_stats.tblname,
                    rows_data_stats.idxname,
                    rows_data_stats.reltuples,
                    rows_data_stats.relpages,
                    rows_data_stats.idxoid,
                    rows_data_stats.fillfactor,
                    (((((((rows_data_stats.index_tuple_hdr_bm + rows_data_stats.maxalign) -
                        CASE
                            WHEN ((rows_data_stats.index_tuple_hdr_bm % rows_data_stats.maxalign) = 0) THEN rows_data_stats.maxalign
                            ELSE (rows_data_stats.index_tuple_hdr_bm % rows_data_stats.maxalign)
                        END))::double precision + rows_data_stats.nulldatawidth) + (rows_data_stats.maxalign)::double precision) - (
                        CASE
                            WHEN (rows_data_stats.nulldatawidth = (0)::double precision) THEN 0
                            WHEN (((rows_data_stats.nulldatawidth)::integer % rows_data_stats.maxalign) = 0) THEN rows_data_stats.maxalign
                            ELSE ((rows_data_stats.nulldatawidth)::integer % rows_data_stats.maxalign)
                        END)::double precision))::numeric AS nulldatahdrwidth,
                    rows_data_stats.pagehdr,
                    rows_data_stats.pageopqdata,
                    rows_data_stats.is_na
                   FROM ( SELECT n.nspname,
                            i.tblname,
                            i.idxname,
                            i.reltuples,
                            i.relpages,
                            i.idxoid,
                            i.fillfactor,
                            (current_setting('block_size'::text))::numeric AS bs,
                                CASE
                                    WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8
                                    ELSE 4
                                END AS maxalign,
                            24 AS pagehdr,
                            16 AS pageopqdata,
                                CASE
                                    WHEN (max(COALESCE(s.null_frac, (0)::real)) = (0)::double precision) THEN 2
                                    ELSE (2 + (((32 + 8) - 1) / 8))
                                END AS index_tuple_hdr_bm,
                            sum((((1)::double precision - COALESCE(s.null_frac, (0)::real)) * (COALESCE(s.avg_width, 1024))::double precision)) AS nulldatawidth,
                            (max(
                                CASE
                                    WHEN (i.atttypid = ('name'::regtype)::oid) THEN 1
                                    ELSE 0
                                END) > 0) AS is_na
                           FROM ((( SELECT ct.relname AS tblname,
                                    ct.relnamespace,
                                    ic.idxname,
                                    ic.attpos,
                                    ic.indkey,
                                    ic.indkey[ic.attpos] AS indkey,
                                    ic.reltuples,
                                    ic.relpages,
                                    ic.tbloid,
                                    ic.idxoid,
                                    ic.fillfactor,
                                    COALESCE(a1.attnum, a2.attnum) AS attnum,
                                    COALESCE(a1.attname, a2.attname) AS attname,
                                    COALESCE(a1.atttypid, a2.atttypid) AS atttypid,
CASE
 WHEN (a1.attnum IS NULL) THEN ic.idxname
 ELSE ct.relname
END AS attrelname
                                   FROM (((( SELECT idx_data.idxname,
    idx_data.reltuples,
    idx_data.relpages,
    idx_data.tbloid,
    idx_data.idxoid,
    idx_data.fillfactor,
    idx_data.indkey,
    generate_series(1, (idx_data.indnatts)::integer) AS attpos
   FROM ( SELECT ci.relname AS idxname,
      ci.reltuples,
      ci.relpages,
      i_1.indrelid AS tbloid,
      i_1.indexrelid AS idxoid,
      COALESCE((("substring"(array_to_string(ci.reloptions, ' '::text), 'fillfactor=([0-9]+)'::text))::smallint)::integer, 90) AS fillfactor,
      i_1.indnatts,
      (string_to_array(textin(int2vectorout(i_1.indkey)), ' '::text))::integer[] AS indkey
     FROM (pg_index i_1
       JOIN pg_class ci ON ((ci.oid = i_1.indexrelid)))
    WHERE ((ci.relam = ( SELECT pg_am.oid
       FROM pg_am
      WHERE (pg_am.amname = 'btree'::name))) AND (ci.relpages > 0))) idx_data) ic
                                     JOIN pg_class ct ON ((ct.oid = ic.tbloid)))
                                     LEFT JOIN pg_attribute a1 ON (((ic.indkey[ic.attpos] <> 0) AND (a1.attrelid = ic.tbloid) AND (a1.attnum = ic.indkey[ic.attpos]))))
                                     LEFT JOIN pg_attribute a2 ON (((ic.indkey[ic.attpos] = 0) AND (a2.attrelid = ic.idxoid) AND (a2.attnum = ic.attpos))))) i(tblname, relnamespace, idxname, attpos, indkey, indkey_1, reltuples, relpages, tbloid, idxoid, fillfactor, attnum, attname, atttypid, attrelname)
                             JOIN pg_namespace n ON ((n.oid = i.relnamespace)))
                             JOIN pg_stats s ON (((s.schemaname = n.nspname) AND (s.tablename = i.attrelname) AND (s.attname = i.attname))))
                          GROUP BY n.nspname, i.tblname, i.idxname, i.reltuples, i.relpages, i.idxoid, i.fillfactor, (current_setting('block_size'::text))::numeric,
                                CASE
                                    WHEN ((version() ~ 'mingw32'::text) OR (version() ~ '64-bit|x86_64|ppc64|ia64|amd64'::text)) THEN 8
                                    ELSE 4
                                END, 24::integer, 16::integer) rows_data_stats) rows_hdr_pdg_stats) relation_stats
  WHERE ((relation_stats.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name])) AND (NOT relation_stats.is_na))
  ORDER BY relation_stats.nspname, relation_stats.tblname, relation_stats.idxname;

CREATE VIEW postgres_indexes AS
 SELECT (((pg_namespace.nspname)::text || '.'::text) || (i.relname)::text) AS identifier,
    pg_index.indexrelid,
    pg_namespace.nspname AS schema,
    i.relname AS name,
    pg_indexes.tablename,
    a.amname AS type,
    pg_index.indisunique AS "unique",
    pg_index.indisvalid AS valid_index,
    i.relispartition AS partitioned,
    pg_index.indisexclusion AS exclusion,
    (pg_index.indexprs IS NOT NULL) AS expression,
    (pg_index.indpred IS NOT NULL) AS partial,
    pg_indexes.indexdef AS definition,
    pg_relation_size((i.oid)::regclass) AS ondisk_size_bytes
   FROM ((((pg_index
     JOIN pg_class i ON ((i.oid = pg_index.indexrelid)))
     JOIN pg_namespace ON ((i.relnamespace = pg_namespace.oid)))
     JOIN pg_indexes ON (((i.relname = pg_indexes.indexname) AND (pg_namespace.nspname = pg_indexes.schemaname))))
     JOIN pg_am a ON ((i.relam = a.oid)))
  WHERE ((pg_namespace.nspname <> 'pg_catalog'::name) AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name])));

CREATE VIEW postgres_partitioned_tables AS
 SELECT (((pg_namespace.nspname)::text || '.'::text) || (pg_class.relname)::text) AS identifier,
    pg_class.oid,
    pg_namespace.nspname AS schema,
    pg_class.relname AS name,
        CASE partitioned_tables.partstrat
            WHEN 'l'::"char" THEN 'list'::text
            WHEN 'r'::"char" THEN 'range'::text
            WHEN 'h'::"char" THEN 'hash'::text
            ELSE NULL::text
        END AS strategy,
    array_agg(pg_attribute.attname) AS key_columns
   FROM (((( SELECT pg_partitioned_table.partrelid,
            pg_partitioned_table.partstrat,
            unnest(pg_partitioned_table.partattrs) AS column_position
           FROM pg_partitioned_table) partitioned_tables
     JOIN pg_class ON ((partitioned_tables.partrelid = pg_class.oid)))
     JOIN pg_namespace ON ((pg_class.relnamespace = pg_namespace.oid)))
     JOIN pg_attribute ON (((pg_attribute.attrelid = pg_class.oid) AND (pg_attribute.attnum = partitioned_tables.column_position))))
  WHERE (pg_namespace.nspname = "current_schema"())
  GROUP BY (((pg_namespace.nspname)::text || '.'::text) || (pg_class.relname)::text), pg_class.oid, pg_namespace.nspname, pg_class.relname,
        CASE partitioned_tables.partstrat
            WHEN 'l'::"char" THEN 'list'::text
            WHEN 'r'::"char" THEN 'range'::text
            WHEN 'h'::"char" THEN 'hash'::text
            ELSE NULL::text
        END;

CREATE VIEW postgres_partitions AS
 SELECT (((pg_namespace.nspname)::text || '.'::text) || (pg_class.relname)::text) AS identifier,
    pg_class.oid,
    pg_namespace.nspname AS schema,
    pg_class.relname AS name,
    (((parent_namespace.nspname)::text || '.'::text) || (parent_class.relname)::text) AS parent_identifier,
    pg_get_expr(pg_class.relpartbound, pg_inherits.inhrelid) AS condition
   FROM ((((pg_class
     JOIN pg_namespace ON ((pg_namespace.oid = pg_class.relnamespace)))
     JOIN pg_inherits ON ((pg_class.oid = pg_inherits.inhrelid)))
     JOIN pg_class parent_class ON ((pg_inherits.inhparent = parent_class.oid)))
     JOIN pg_namespace parent_namespace ON ((parent_class.relnamespace = parent_namespace.oid)))
  WHERE (pg_class.relispartition AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name])));

CREATE TABLE postgres_reindex_actions (
    id bigint NOT NULL,
    action_start timestamp with time zone NOT NULL,
    action_end timestamp with time zone,
    ondisk_size_bytes_start bigint NOT NULL,
    ondisk_size_bytes_end bigint,
    state smallint DEFAULT 0 NOT NULL,
    index_identifier text NOT NULL,
    bloat_estimate_bytes_start bigint,
    CONSTRAINT check_f12527622c CHECK ((char_length(index_identifier) <= 255))
);

CREATE SEQUENCE postgres_reindex_actions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE postgres_reindex_actions_id_seq OWNED BY postgres_reindex_actions.id;

CREATE TABLE postgres_reindex_queued_actions (
    id bigint NOT NULL,
    index_identifier text NOT NULL,
    state smallint DEFAULT 0 NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    CONSTRAINT check_e4b01395c0 CHECK ((char_length(index_identifier) <= 255))
);

CREATE SEQUENCE postgres_reindex_queued_actions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE postgres_reindex_queued_actions_id_seq OWNED BY postgres_reindex_queued_actions.id;

CREATE VIEW postgres_sequences AS
 SELECT seq_pg_class.relname AS seq_name,
    dep_pg_class.relname AS table_name,
    pg_attribute.attname AS col_name,
    pg_sequence.seqmax AS seq_max,
    pg_sequence.seqmin AS seq_min,
    pg_sequence.seqstart AS seq_start
   FROM ((((pg_class seq_pg_class
     JOIN pg_sequence ON ((seq_pg_class.oid = pg_sequence.seqrelid)))
     LEFT JOIN pg_depend ON (((seq_pg_class.oid = pg_depend.objid) AND (pg_depend.classid = ('pg_class'::regclass)::oid) AND (pg_depend.refclassid = ('pg_class'::regclass)::oid))))
     LEFT JOIN pg_class dep_pg_class ON ((pg_depend.refobjid = dep_pg_class.oid)))
     LEFT JOIN pg_attribute ON (((dep_pg_class.oid = pg_attribute.attrelid) AND (pg_depend.refobjsubid = pg_attribute.attnum))))
  WHERE (seq_pg_class.relkind = 'S'::"char");

CREATE TABLE programming_languages (
    id bigint NOT NULL,
    name character varying NOT NULL,
    color character varying NOT NULL,
    created_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE programming_languages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE programming_languages_id_seq OWNED BY programming_languages.id;

CREATE TABLE project_access_tokens (
    personal_access_token_id bigint NOT NULL,
    project_id bigint NOT NULL
);

CREATE TABLE project_alerting_settings (
    project_id bigint NOT NULL,
    encrypted_token character varying NOT NULL,
    encrypted_token_iv character varying NOT NULL
);

CREATE TABLE project_aliases (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    name character varying NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE project_aliases_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_aliases_id_seq OWNED BY project_aliases.id;

CREATE TABLE project_authorizations (
    user_id bigint NOT NULL,
    project_id bigint NOT NULL,
    access_level integer NOT NULL,
    is_unique boolean
);

CREATE TABLE project_auto_devops (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    enabled boolean,
    deploy_strategy integer DEFAULT 0 NOT NULL
);

CREATE SEQUENCE project_auto_devops_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_auto_devops_id_seq OWNED BY project_auto_devops.id;

CREATE TABLE project_build_artifacts_size_refreshes (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    last_job_artifact_id bigint,
    state smallint DEFAULT 1 NOT NULL,
    refresh_started_at timestamp with time zone,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    last_job_artifact_id_on_refresh_start bigint DEFAULT 0
);

CREATE SEQUENCE project_build_artifacts_size_refreshes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_build_artifacts_size_refreshes_id_seq OWNED BY project_build_artifacts_size_refreshes.id;

CREATE TABLE project_ci_cd_settings (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    group_runners_enabled boolean DEFAULT true NOT NULL,
    merge_pipelines_enabled boolean,
    default_git_depth integer,
    forward_deployment_enabled boolean,
    merge_trains_enabled boolean DEFAULT false,
    auto_rollback_enabled boolean DEFAULT false NOT NULL,
    keep_latest_artifact boolean DEFAULT true NOT NULL,
    restrict_user_defined_variables boolean DEFAULT false NOT NULL,
    job_token_scope_enabled boolean DEFAULT false NOT NULL,
    runner_token_expiration_interval integer,
    separated_caches boolean DEFAULT true NOT NULL,
    allow_fork_pipelines_to_run_in_parent_project boolean DEFAULT true NOT NULL,
    inbound_job_token_scope_enabled boolean DEFAULT true NOT NULL,
    forward_deployment_rollback_allowed boolean DEFAULT true NOT NULL,
    merge_trains_skip_train_allowed boolean DEFAULT false NOT NULL,
    restrict_pipeline_cancellation_role smallint DEFAULT 0 NOT NULL,
    pipeline_variables_minimum_override_role smallint DEFAULT 3 NOT NULL,
    push_repository_for_job_token_allowed boolean DEFAULT false NOT NULL,
    id_token_sub_claim_components character varying[] DEFAULT '{project_path,ref_type,ref}'::character varying[] NOT NULL
);

CREATE SEQUENCE project_ci_cd_settings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_ci_cd_settings_id_seq OWNED BY project_ci_cd_settings.id;

CREATE TABLE project_ci_feature_usages (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    feature smallint NOT NULL,
    default_branch boolean DEFAULT false NOT NULL
);

CREATE SEQUENCE project_ci_feature_usages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_ci_feature_usages_id_seq OWNED BY project_ci_feature_usages.id;

CREATE TABLE project_compliance_framework_settings (
    project_id bigint NOT NULL,
    framework_id bigint,
    id bigint NOT NULL,
    CONSTRAINT check_d348de9e2d CHECK ((framework_id IS NOT NULL))
);

CREATE SEQUENCE project_compliance_framework_settings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_compliance_framework_settings_id_seq OWNED BY project_compliance_framework_settings.id;

CREATE SEQUENCE project_compliance_framework_settings_project_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_compliance_framework_settings_project_id_seq OWNED BY project_compliance_framework_settings.project_id;

CREATE TABLE project_compliance_standards_adherence (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    status smallint NOT NULL,
    check_name smallint NOT NULL,
    standard smallint NOT NULL
);

CREATE SEQUENCE project_compliance_standards_adherence_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_compliance_standards_adherence_id_seq OWNED BY project_compliance_standards_adherence.id;

CREATE TABLE project_custom_attributes (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    key character varying NOT NULL,
    value character varying NOT NULL
);

CREATE SEQUENCE project_custom_attributes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_custom_attributes_id_seq OWNED BY project_custom_attributes.id;

CREATE TABLE project_daily_statistics (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    fetch_count integer NOT NULL,
    date date
);

CREATE SEQUENCE project_daily_statistics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_daily_statistics_id_seq OWNED BY project_daily_statistics.id;

CREATE TABLE project_data_transfers (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    repository_egress bigint DEFAULT 0 NOT NULL,
    artifacts_egress bigint DEFAULT 0 NOT NULL,
    packages_egress bigint DEFAULT 0 NOT NULL,
    registry_egress bigint DEFAULT 0 NOT NULL,
    date date NOT NULL,
    created_at timestamp with time zone NOT NULL,
    CONSTRAINT project_data_transfers_project_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
);

CREATE SEQUENCE project_data_transfers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_data_transfers_id_seq OWNED BY project_data_transfers.id;

CREATE TABLE project_deploy_tokens (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    deploy_token_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE project_deploy_tokens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_deploy_tokens_id_seq OWNED BY project_deploy_tokens.id;

CREATE TABLE project_error_tracking_settings (
    project_id bigint NOT NULL,
    enabled boolean DEFAULT false NOT NULL,
    api_url character varying,
    encrypted_token character varying,
    encrypted_token_iv character varying,
    project_name character varying,
    organization_name character varying,
    integrated boolean DEFAULT true NOT NULL,
    sentry_project_id bigint
);

CREATE TABLE project_export_jobs (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    status smallint DEFAULT 0 NOT NULL,
    jid character varying(100) NOT NULL,
    user_id bigint,
    exported_by_admin boolean DEFAULT false
);

CREATE SEQUENCE project_export_jobs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_export_jobs_id_seq OWNED BY project_export_jobs.id;

CREATE TABLE project_feature_usages (
    project_id bigint NOT NULL,
    jira_dvcs_cloud_last_sync_at timestamp without time zone,
    jira_dvcs_server_last_sync_at timestamp without time zone
);

CREATE TABLE project_features (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    merge_requests_access_level integer,
    issues_access_level integer,
    wiki_access_level integer,
    snippets_access_level integer DEFAULT 20 NOT NULL,
    builds_access_level integer,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    repository_access_level integer DEFAULT 20 NOT NULL,
    pages_access_level integer NOT NULL,
    forking_access_level integer,
    metrics_dashboard_access_level integer,
    requirements_access_level integer DEFAULT 20 NOT NULL,
    operations_access_level integer DEFAULT 20 NOT NULL,
    analytics_access_level integer DEFAULT 20 NOT NULL,
    security_and_compliance_access_level integer DEFAULT 10 NOT NULL,
    container_registry_access_level integer DEFAULT 0 NOT NULL,
    package_registry_access_level integer DEFAULT 0 NOT NULL,
    monitor_access_level integer DEFAULT 20 NOT NULL,
    infrastructure_access_level integer DEFAULT 20 NOT NULL,
    feature_flags_access_level integer DEFAULT 20 NOT NULL,
    environments_access_level integer DEFAULT 20 NOT NULL,
    releases_access_level integer DEFAULT 20 NOT NULL,
    model_experiments_access_level integer DEFAULT 20 NOT NULL,
    model_registry_access_level integer DEFAULT 20 NOT NULL
);

CREATE SEQUENCE project_features_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_features_id_seq OWNED BY project_features.id;

CREATE TABLE project_group_links (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    group_id bigint NOT NULL,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    group_access integer DEFAULT 30 NOT NULL,
    expires_at date
);

CREATE SEQUENCE project_group_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_group_links_id_seq OWNED BY project_group_links.id;

CREATE TABLE project_import_data (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    data text,
    encrypted_credentials text,
    encrypted_credentials_iv character varying,
    encrypted_credentials_salt character varying
);

CREATE SEQUENCE project_import_data_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_import_data_id_seq OWNED BY project_import_data.id;

CREATE TABLE project_incident_management_settings (
    project_id bigint NOT NULL,
    create_issue boolean DEFAULT false NOT NULL,
    send_email boolean DEFAULT false NOT NULL,
    issue_template_key text,
    pagerduty_active boolean DEFAULT false NOT NULL,
    encrypted_pagerduty_token bytea,
    encrypted_pagerduty_token_iv bytea,
    auto_close_incident boolean DEFAULT true NOT NULL,
    sla_timer boolean DEFAULT false,
    sla_timer_minutes integer,
    CONSTRAINT pagerduty_token_iv_length_constraint CHECK ((octet_length(encrypted_pagerduty_token_iv) <= 12)),
    CONSTRAINT pagerduty_token_length_constraint CHECK ((octet_length(encrypted_pagerduty_token) <= 255))
);

CREATE SEQUENCE project_incident_management_settings_project_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_incident_management_settings_project_id_seq OWNED BY project_incident_management_settings.project_id;

CREATE TABLE project_metrics_settings (
    project_id bigint NOT NULL,
    external_dashboard_url character varying,
    dashboard_timezone smallint DEFAULT 0 NOT NULL
);

CREATE TABLE project_mirror_data (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    retry_count integer DEFAULT 0 NOT NULL,
    last_update_started_at timestamp without time zone,
    last_update_scheduled_at timestamp without time zone,
    next_execution_timestamp timestamp without time zone,
    status character varying,
    jid character varying,
    last_error text,
    last_update_at timestamp with time zone,
    last_successful_update_at timestamp with time zone,
    correlation_id_value character varying(128),
    checksums jsonb DEFAULT '{}'::jsonb NOT NULL
);

CREATE SEQUENCE project_mirror_data_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_mirror_data_id_seq OWNED BY project_mirror_data.id;

CREATE TABLE project_pages_metadata (
    project_id bigint NOT NULL,
    deployed boolean DEFAULT false NOT NULL,
    pages_deployment_id bigint,
    onboarding_complete boolean DEFAULT false NOT NULL
);

CREATE TABLE project_relation_export_uploads (
    id bigint NOT NULL,
    project_relation_export_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    export_file text NOT NULL,
    CONSTRAINT check_d8ee243e9e CHECK ((char_length(export_file) <= 255))
);

CREATE SEQUENCE project_relation_export_uploads_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_relation_export_uploads_id_seq OWNED BY project_relation_export_uploads.id;

CREATE TABLE project_relation_exports (
    id bigint NOT NULL,
    project_export_job_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    status smallint DEFAULT 0 NOT NULL,
    relation text NOT NULL,
    jid text,
    export_error text,
    project_id bigint,
    CONSTRAINT check_15e644d856 CHECK ((char_length(jid) <= 255)),
    CONSTRAINT check_4b5880b795 CHECK ((char_length(relation) <= 255)),
    CONSTRAINT check_dbd1cf73d0 CHECK ((char_length(export_error) <= 300))
);

CREATE SEQUENCE project_relation_exports_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_relation_exports_id_seq OWNED BY project_relation_exports.id;

CREATE TABLE project_repositories (
    id bigint NOT NULL,
    shard_id bigint NOT NULL,
    disk_path character varying NOT NULL,
    project_id bigint NOT NULL,
    object_format smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE project_repositories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_repositories_id_seq OWNED BY project_repositories.id;

CREATE TABLE project_repository_storage_moves (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    state smallint DEFAULT 1 NOT NULL,
    source_storage_name text NOT NULL,
    destination_storage_name text NOT NULL,
    error_message text,
    CONSTRAINT check_85854380db CHECK ((char_length(error_message) <= 256)),
    CONSTRAINT project_repository_storage_moves_destination_storage_name CHECK ((char_length(destination_storage_name) <= 255)),
    CONSTRAINT project_repository_storage_moves_source_storage_name CHECK ((char_length(source_storage_name) <= 255))
);

CREATE SEQUENCE project_repository_storage_moves_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_repository_storage_moves_id_seq OWNED BY project_repository_storage_moves.id;

CREATE TABLE project_saved_replies (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    name text NOT NULL,
    content text NOT NULL,
    CONSTRAINT check_5569cfc14e CHECK ((char_length(content) <= 10000)),
    CONSTRAINT check_a3993908da CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE project_saved_replies_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_saved_replies_id_seq OWNED BY project_saved_replies.id;

CREATE TABLE project_secrets_managers (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    status smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE project_secrets_managers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_secrets_managers_id_seq OWNED BY project_secrets_managers.id;

CREATE TABLE project_security_exclusions (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    scanner smallint NOT NULL,
    type smallint NOT NULL,
    active boolean DEFAULT true NOT NULL,
    description text,
    value text NOT NULL,
    CONSTRAINT check_3c70ee8804 CHECK ((char_length(description) <= 255)),
    CONSTRAINT check_3e918b71ed CHECK ((char_length(value) <= 255))
);

CREATE SEQUENCE project_security_exclusions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_security_exclusions_id_seq OWNED BY project_security_exclusions.id;

CREATE TABLE project_security_settings (
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    auto_fix_container_scanning boolean DEFAULT true NOT NULL,
    auto_fix_dast boolean DEFAULT true NOT NULL,
    auto_fix_dependency_scanning boolean DEFAULT true NOT NULL,
    auto_fix_sast boolean DEFAULT true NOT NULL,
    continuous_vulnerability_scans_enabled boolean DEFAULT false NOT NULL,
    container_scanning_for_registry_enabled boolean DEFAULT false NOT NULL,
    pre_receive_secret_detection_enabled boolean DEFAULT false NOT NULL
);

CREATE SEQUENCE project_security_settings_project_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_security_settings_project_id_seq OWNED BY project_security_settings.project_id;

CREATE TABLE project_security_statistics (
    project_id bigint NOT NULL,
    vulnerability_count integer DEFAULT 0 NOT NULL
);

CREATE TABLE project_settings (
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    push_rule_id bigint,
    show_default_award_emojis boolean DEFAULT true,
    allow_merge_on_skipped_pipeline boolean,
    squash_option smallint DEFAULT 3,
    has_confluence boolean DEFAULT false NOT NULL,
    has_vulnerabilities boolean DEFAULT false NOT NULL,
    prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL,
    cve_id_request_enabled boolean DEFAULT true NOT NULL,
    mr_default_target_self boolean DEFAULT false NOT NULL,
    previous_default_branch text,
    warn_about_potentially_unwanted_characters boolean DEFAULT true NOT NULL,
    merge_commit_template text,
    has_shimo boolean DEFAULT false NOT NULL,
    squash_commit_template text,
    legacy_open_source_license_available boolean DEFAULT true NOT NULL,
    target_platforms character varying[] DEFAULT '{}'::character varying[] NOT NULL,
    enforce_auth_checks_on_uploads boolean DEFAULT true NOT NULL,
    selective_code_owner_removals boolean DEFAULT false NOT NULL,
    issue_branch_template text,
    show_diff_preview_in_email boolean DEFAULT true NOT NULL,
    suggested_reviewers_enabled boolean DEFAULT false NOT NULL,
    only_allow_merge_if_all_status_checks_passed boolean DEFAULT false NOT NULL,
    mirror_branch_regex text,
    allow_pipeline_trigger_approve_deployment boolean DEFAULT false NOT NULL,
    emails_enabled boolean DEFAULT true NOT NULL,
    pages_unique_domain_enabled boolean DEFAULT false NOT NULL,
    pages_unique_domain text,
    runner_registration_enabled boolean DEFAULT true,
    product_analytics_instrumentation_key text,
    product_analytics_data_collector_host text,
    cube_api_base_url text,
    encrypted_cube_api_key bytea,
    encrypted_cube_api_key_iv bytea,
    encrypted_product_analytics_configurator_connection_string bytea,
    encrypted_product_analytics_configurator_connection_string_iv bytea,
    pages_multiple_versions_enabled boolean DEFAULT false NOT NULL,
    allow_merge_without_pipeline boolean DEFAULT false NOT NULL,
    duo_features_enabled boolean DEFAULT true NOT NULL,
    require_reauthentication_to_approve boolean,
    observability_alerts_enabled boolean DEFAULT true NOT NULL,
    spp_repository_pipeline_access boolean,
    max_number_of_vulnerabilities integer,
    CONSTRAINT check_1a30456322 CHECK ((char_length(pages_unique_domain) <= 63)),
    CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)),
    CONSTRAINT check_3ca5cbffe6 CHECK ((char_length(issue_branch_template) <= 255)),
    CONSTRAINT check_4b142e71f3 CHECK ((char_length(product_analytics_data_collector_host) <= 255)),
    CONSTRAINT check_67292e4b99 CHECK ((char_length(mirror_branch_regex) <= 255)),
    CONSTRAINT check_acb7fad2f9 CHECK ((char_length(product_analytics_instrumentation_key) <= 255)),
    CONSTRAINT check_b09644994b CHECK ((char_length(squash_commit_template) <= 500)),
    CONSTRAINT check_bde223416c CHECK ((show_default_award_emojis IS NOT NULL)),
    CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500)),
    CONSTRAINT check_f9df7bcee2 CHECK ((char_length(cube_api_base_url) <= 512))
);

CREATE TABLE project_states (
    id bigint NOT NULL,
    verification_started_at timestamp with time zone,
    verification_retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    project_id bigint NOT NULL,
    verification_state smallint DEFAULT 0 NOT NULL,
    verification_retry_count smallint DEFAULT 0 NOT NULL,
    verification_checksum bytea,
    verification_failure text,
    CONSTRAINT check_0d5a9e7bde CHECK ((char_length(verification_failure) <= 255))
);

CREATE SEQUENCE project_states_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_states_id_seq OWNED BY project_states.id;

CREATE TABLE project_statistics (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    commit_count bigint DEFAULT 0 NOT NULL,
    storage_size bigint DEFAULT 0 NOT NULL,
    repository_size bigint DEFAULT 0 NOT NULL,
    lfs_objects_size bigint DEFAULT 0 NOT NULL,
    build_artifacts_size bigint DEFAULT 0 NOT NULL,
    shared_runners_seconds bigint DEFAULT 0 NOT NULL,
    shared_runners_seconds_last_reset timestamp without time zone,
    packages_size bigint DEFAULT 0 NOT NULL,
    wiki_size bigint,
    snippets_size bigint,
    pipeline_artifacts_size bigint DEFAULT 0 NOT NULL,
    uploads_size bigint DEFAULT 0 NOT NULL,
    container_registry_size bigint DEFAULT 0 NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    root_namespace_id bigint
);

CREATE SEQUENCE project_statistics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_statistics_id_seq OWNED BY project_statistics.id;

CREATE TABLE project_topics (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    topic_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE project_topics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_topics_id_seq OWNED BY project_topics.id;

CREATE TABLE project_type_ci_runner_machines_687967fa8a (
    id bigint NOT NULL,
    runner_id bigint NOT NULL,
    sharding_key_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    contacted_at timestamp with time zone,
    creation_state smallint DEFAULT 0 NOT NULL,
    executor_type smallint,
    runner_type smallint NOT NULL,
    config jsonb DEFAULT '{}'::jsonb NOT NULL,
    system_xid text NOT NULL,
    platform text,
    architecture text,
    revision text,
    ip_address text,
    version text,
    CONSTRAINT check_3d8736b3af CHECK ((char_length(system_xid) <= 64)),
    CONSTRAINT check_5bad2a6944 CHECK ((char_length(revision) <= 255)),
    CONSTRAINT check_7dc4eee8a5 CHECK ((char_length(version) <= 2048)),
    CONSTRAINT check_b1e456641b CHECK ((char_length(ip_address) <= 1024)),
    CONSTRAINT check_c788f4b18a CHECK ((char_length(platform) <= 255)),
    CONSTRAINT check_f3d25ab844 CHECK ((char_length(architecture) <= 255)),
    CONSTRAINT check_sharding_key_id_nullness CHECK ((sharding_key_id IS NOT NULL))
);

CREATE TABLE project_type_ci_runners_e59bb2812d (
    id bigint NOT NULL,
    creator_id bigint,
    sharding_key_id bigint,
    created_at timestamp with time zone,
    updated_at timestamp with time zone,
    contacted_at timestamp with time zone,
    token_expires_at timestamp with time zone,
    public_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL,
    private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL,
    access_level integer DEFAULT 0 NOT NULL,
    maximum_timeout integer,
    runner_type smallint NOT NULL,
    registration_type smallint DEFAULT 0 NOT NULL,
    creation_state smallint DEFAULT 0 NOT NULL,
    active boolean DEFAULT true NOT NULL,
    run_untagged boolean DEFAULT true NOT NULL,
    locked boolean DEFAULT false NOT NULL,
    name text,
    token_encrypted text,
    token text,
    description text,
    maintainer_note text,
    allowed_plans text[] DEFAULT '{}'::text[] NOT NULL,
    allowed_plan_ids bigint[] DEFAULT '{}'::bigint[] NOT NULL,
    CONSTRAINT check_1f8618ab23 CHECK ((char_length(name) <= 256)),
    CONSTRAINT check_24b281f5bf CHECK ((char_length(maintainer_note) <= 1024)),
    CONSTRAINT check_31c16b2a99 CHECK ((char_length(token_encrypted) <= 128)),
    CONSTRAINT check_5db8ae9d30 CHECK ((char_length(description) <= 1024)),
    CONSTRAINT check_af25130d5a CHECK ((char_length(token) <= 128)),
    CONSTRAINT check_sharding_key_id_nullness CHECK ((sharding_key_id IS NOT NULL))
);

CREATE TABLE project_wiki_repositories (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE project_wiki_repositories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE project_wiki_repositories_id_seq OWNED BY project_wiki_repositories.id;

CREATE SEQUENCE projects_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE projects_id_seq OWNED BY projects.id;

CREATE TABLE projects_sync_events (
    id bigint NOT NULL,
    project_id bigint NOT NULL
);

CREATE SEQUENCE projects_sync_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE projects_sync_events_id_seq OWNED BY projects_sync_events.id;

CREATE SEQUENCE projects_visits_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE projects_visits_id_seq OWNED BY projects_visits.id;

CREATE TABLE protected_branch_merge_access_levels (
    id bigint NOT NULL,
    protected_branch_id bigint NOT NULL,
    access_level integer DEFAULT 40,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    user_id bigint,
    group_id bigint
);

CREATE SEQUENCE protected_branch_merge_access_levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_branch_merge_access_levels_id_seq OWNED BY protected_branch_merge_access_levels.id;

CREATE TABLE protected_branch_push_access_levels (
    id bigint NOT NULL,
    protected_branch_id bigint NOT NULL,
    access_level integer DEFAULT 40,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    user_id bigint,
    group_id bigint,
    deploy_key_id bigint
);

CREATE SEQUENCE protected_branch_push_access_levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_branch_push_access_levels_id_seq OWNED BY protected_branch_push_access_levels.id;

CREATE TABLE protected_branch_unprotect_access_levels (
    id bigint NOT NULL,
    protected_branch_id bigint NOT NULL,
    access_level integer DEFAULT 40,
    user_id bigint,
    group_id bigint
);

CREATE SEQUENCE protected_branch_unprotect_access_levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_branch_unprotect_access_levels_id_seq OWNED BY protected_branch_unprotect_access_levels.id;

CREATE TABLE protected_branches (
    id bigint NOT NULL,
    project_id bigint,
    name character varying NOT NULL,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    code_owner_approval_required boolean DEFAULT false NOT NULL,
    allow_force_push boolean DEFAULT false NOT NULL,
    namespace_id bigint,
    CONSTRAINT protected_branches_project_id_namespace_id_any_not_null CHECK (((project_id IS NULL) <> (namespace_id IS NULL)))
);

CREATE SEQUENCE protected_branches_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_branches_id_seq OWNED BY protected_branches.id;

CREATE TABLE protected_environment_approval_rules (
    id bigint NOT NULL,
    protected_environment_id bigint NOT NULL,
    user_id bigint,
    group_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    access_level smallint,
    required_approvals smallint NOT NULL,
    group_inheritance_type smallint DEFAULT 0 NOT NULL,
    protected_environment_project_id bigint,
    protected_environment_group_id bigint,
    CONSTRAINT chk_rails_bed75249bc CHECK ((((access_level IS NOT NULL) AND (group_id IS NULL) AND (user_id IS NULL)) OR ((user_id IS NOT NULL) AND (access_level IS NULL) AND (group_id IS NULL)) OR ((group_id IS NOT NULL) AND (user_id IS NULL) AND (access_level IS NULL)))),
    CONSTRAINT chk_rails_cfa90ae3b5 CHECK ((required_approvals > 0))
);

CREATE SEQUENCE protected_environment_approval_rules_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_environment_approval_rules_id_seq OWNED BY protected_environment_approval_rules.id;

CREATE TABLE protected_environment_deploy_access_levels (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    access_level integer,
    protected_environment_id bigint NOT NULL,
    user_id bigint,
    group_id bigint,
    group_inheritance_type smallint DEFAULT 0 NOT NULL,
    protected_environment_project_id bigint,
    protected_environment_group_id bigint,
    CONSTRAINT check_deploy_access_levels_user_group_access_level_any_not_null CHECK ((num_nonnulls(user_id, group_id, access_level) = 1))
);

CREATE SEQUENCE protected_environment_deploy_access_levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_environment_deploy_access_levels_id_seq OWNED BY protected_environment_deploy_access_levels.id;

CREATE TABLE protected_environments (
    id bigint NOT NULL,
    project_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    name character varying NOT NULL,
    group_id bigint,
    required_approval_count integer DEFAULT 0 NOT NULL,
    CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))),
    CONSTRAINT protected_environments_required_approval_count_positive CHECK ((required_approval_count >= 0))
);

CREATE SEQUENCE protected_environments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_environments_id_seq OWNED BY protected_environments.id;

CREATE TABLE protected_tag_create_access_levels (
    id bigint NOT NULL,
    protected_tag_id bigint NOT NULL,
    access_level integer DEFAULT 40,
    user_id bigint,
    group_id bigint,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    deploy_key_id bigint,
    project_id bigint
);

CREATE SEQUENCE protected_tag_create_access_levels_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_tag_create_access_levels_id_seq OWNED BY protected_tag_create_access_levels.id;

CREATE TABLE protected_tags (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    name character varying NOT NULL,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL
);

CREATE SEQUENCE protected_tags_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id;

CREATE TABLE push_event_payloads (
    commit_count bigint NOT NULL,
    action smallint NOT NULL,
    ref_type smallint NOT NULL,
    commit_from bytea,
    commit_to bytea,
    ref text,
    commit_title character varying(70),
    ref_count integer,
    event_id bigint NOT NULL
);

CREATE TABLE push_rules (
    id bigint NOT NULL,
    force_push_regex character varying,
    delete_branch_regex character varying,
    commit_message_regex character varying,
    deny_delete_tag boolean,
    project_id bigint,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    author_email_regex character varying,
    member_check boolean DEFAULT false NOT NULL,
    file_name_regex character varying,
    is_sample boolean DEFAULT false,
    max_file_size integer DEFAULT 0 NOT NULL,
    prevent_secrets boolean DEFAULT false NOT NULL,
    branch_name_regex character varying,
    reject_unsigned_commits boolean,
    commit_committer_check boolean,
    regexp_uses_re2 boolean DEFAULT true,
    commit_message_negative_regex character varying,
    reject_non_dco_commits boolean,
    commit_committer_name_check boolean DEFAULT false NOT NULL,
    organization_id bigint,
    CONSTRAINT author_email_regex_size_constraint CHECK ((char_length((author_email_regex)::text) <= 511)),
    CONSTRAINT branch_name_regex_size_constraint CHECK ((char_length((branch_name_regex)::text) <= 511)),
    CONSTRAINT commit_message_negative_regex_size_constraint CHECK ((char_length((commit_message_negative_regex)::text) <= 2047)),
    CONSTRAINT commit_message_regex_size_constraint CHECK ((char_length((commit_message_regex)::text) <= 511)),
    CONSTRAINT delete_branch_regex_size_constraint CHECK ((char_length((delete_branch_regex)::text) <= 511)),
    CONSTRAINT file_name_regex_size_constraint CHECK ((char_length((file_name_regex)::text) <= 511)),
    CONSTRAINT force_push_regex_size_constraint CHECK ((char_length((force_push_regex)::text) <= 511))
);

CREATE SEQUENCE push_rules_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE push_rules_id_seq OWNED BY push_rules.id;

CREATE TABLE raw_usage_data (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    recorded_at timestamp with time zone NOT NULL,
    sent_at timestamp with time zone,
    payload jsonb NOT NULL,
    version_usage_data_id_value bigint,
    organization_id bigint NOT NULL
);

CREATE SEQUENCE raw_usage_data_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE raw_usage_data_id_seq OWNED BY raw_usage_data.id;

CREATE TABLE redirect_routes (
    id bigint NOT NULL,
    source_id bigint NOT NULL,
    source_type character varying NOT NULL,
    path character varying NOT NULL,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL
);

CREATE SEQUENCE redirect_routes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE redirect_routes_id_seq OWNED BY redirect_routes.id;

CREATE TABLE related_epic_links (
    id bigint NOT NULL,
    source_id bigint NOT NULL,
    target_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    link_type smallint DEFAULT 0 NOT NULL,
    group_id bigint,
    issue_link_id bigint
);

CREATE SEQUENCE related_epic_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE related_epic_links_id_seq OWNED BY related_epic_links.id;

CREATE TABLE relation_import_trackers (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    relation smallint NOT NULL,
    status smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE relation_import_trackers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE relation_import_trackers_id_seq OWNED BY relation_import_trackers.id;

CREATE TABLE release_links (
    id bigint NOT NULL,
    release_id bigint NOT NULL,
    url character varying NOT NULL,
    name character varying NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    filepath character varying(128),
    link_type smallint DEFAULT 0,
    project_id bigint
);

CREATE SEQUENCE release_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE release_links_id_seq OWNED BY release_links.id;

CREATE TABLE releases (
    id bigint NOT NULL,
    tag character varying,
    description text,
    project_id bigint,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    description_html text,
    cached_markdown_version integer,
    author_id bigint,
    name character varying,
    sha character varying,
    released_at timestamp with time zone NOT NULL,
    release_published_at timestamp with time zone,
    CONSTRAINT check_6bb9ce4925 CHECK ((project_id IS NOT NULL))
);

CREATE SEQUENCE releases_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE releases_id_seq OWNED BY releases.id;

CREATE TABLE remote_development_agent_configs (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    cluster_agent_id bigint NOT NULL,
    enabled boolean NOT NULL,
    dns_zone text NOT NULL,
    network_policy_enabled boolean DEFAULT true NOT NULL,
    gitlab_workspaces_proxy_namespace text DEFAULT 'gitlab-workspaces'::text NOT NULL,
    network_policy_egress jsonb DEFAULT '[{"allow": "0.0.0.0/0", "except": ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]}]'::jsonb NOT NULL,
    default_resources_per_workspace_container jsonb DEFAULT '{}'::jsonb NOT NULL,
    max_resources_per_workspace jsonb DEFAULT '{}'::jsonb NOT NULL,
    workspaces_quota bigint DEFAULT '-1'::integer NOT NULL,
    workspaces_per_user_quota bigint DEFAULT '-1'::integer NOT NULL,
    project_id bigint,
    default_max_hours_before_termination smallint DEFAULT 24 NOT NULL,
    max_hours_before_termination_limit smallint DEFAULT 120 NOT NULL,
    CONSTRAINT check_72947a4495 CHECK ((char_length(gitlab_workspaces_proxy_namespace) <= 63)),
    CONSTRAINT check_9f5cd54d1c CHECK ((char_length(dns_zone) <= 256))
);

CREATE SEQUENCE remote_development_agent_configs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE remote_development_agent_configs_id_seq OWNED BY remote_development_agent_configs.id;

CREATE TABLE remote_development_namespace_cluster_agent_mappings (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    namespace_id bigint NOT NULL,
    cluster_agent_id bigint NOT NULL,
    creator_id bigint
);

CREATE SEQUENCE remote_development_namespace_cluster_agent_mappings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE remote_development_namespace_cluster_agent_mappings_id_seq OWNED BY remote_development_namespace_cluster_agent_mappings.id;

CREATE TABLE remote_mirrors (
    id bigint NOT NULL,
    project_id bigint,
    url character varying,
    enabled boolean DEFAULT false,
    update_status character varying,
    last_update_at timestamp without time zone,
    last_successful_update_at timestamp without time zone,
    last_error character varying,
    encrypted_credentials text,
    encrypted_credentials_iv character varying,
    encrypted_credentials_salt character varying,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    last_update_started_at timestamp without time zone,
    only_protected_branches boolean DEFAULT false NOT NULL,
    remote_name character varying,
    error_notification_sent boolean,
    keep_divergent_refs boolean,
    mirror_branch_regex text,
    CONSTRAINT check_7547191afa CHECK ((project_id IS NOT NULL)),
    CONSTRAINT check_aa6b497785 CHECK ((char_length(mirror_branch_regex) <= 255))
);

CREATE SEQUENCE remote_mirrors_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE remote_mirrors_id_seq OWNED BY remote_mirrors.id;

CREATE TABLE repository_languages (
    project_id bigint NOT NULL,
    programming_language_id bigint NOT NULL,
    share double precision NOT NULL
);

CREATE TABLE required_code_owners_sections (
    id bigint NOT NULL,
    protected_branch_id bigint NOT NULL,
    name text NOT NULL,
    CONSTRAINT check_e58d53741e CHECK ((char_length(name) <= 1024))
);

CREATE SEQUENCE required_code_owners_sections_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE required_code_owners_sections_id_seq OWNED BY required_code_owners_sections.id;

CREATE TABLE requirements (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    iid integer NOT NULL,
    issue_id bigint,
    CONSTRAINT check_requirement_issue_not_null CHECK ((issue_id IS NOT NULL))
);

CREATE SEQUENCE requirements_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE requirements_id_seq OWNED BY requirements.id;

CREATE TABLE requirements_management_test_reports (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    author_id bigint,
    state smallint NOT NULL,
    build_id bigint,
    issue_id bigint,
    uses_legacy_iid boolean DEFAULT true NOT NULL
);

CREATE SEQUENCE requirements_management_test_reports_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE requirements_management_test_reports_id_seq OWNED BY requirements_management_test_reports.id;

CREATE TABLE resource_iteration_events (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    issue_id bigint,
    merge_request_id bigint,
    iteration_id bigint,
    created_at timestamp with time zone NOT NULL,
    action smallint NOT NULL
);

CREATE SEQUENCE resource_iteration_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE resource_iteration_events_id_seq OWNED BY resource_iteration_events.id;

CREATE TABLE resource_label_events (
    id bigint NOT NULL,
    action integer NOT NULL,
    issue_id bigint,
    merge_request_id bigint,
    epic_id bigint,
    label_id bigint,
    user_id bigint,
    created_at timestamp with time zone NOT NULL,
    cached_markdown_version integer,
    reference text,
    reference_html text,
    imported_from smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE resource_label_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE resource_label_events_id_seq OWNED BY resource_label_events.id;

CREATE TABLE resource_link_events (
    id bigint NOT NULL,
    action smallint NOT NULL,
    user_id bigint NOT NULL,
    issue_id bigint NOT NULL,
    child_work_item_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    system_note_metadata_id bigint
);

CREATE SEQUENCE resource_link_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE resource_link_events_id_seq OWNED BY resource_link_events.id;

CREATE TABLE resource_milestone_events (
    id bigint NOT NULL,
    user_id bigint,
    issue_id bigint,
    merge_request_id bigint,
    milestone_id bigint,
    action smallint NOT NULL,
    state smallint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    imported_from smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE resource_milestone_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE resource_milestone_events_id_seq OWNED BY resource_milestone_events.id;

CREATE TABLE resource_state_events (
    id bigint NOT NULL,
    user_id bigint,
    issue_id bigint,
    merge_request_id bigint,
    created_at timestamp with time zone NOT NULL,
    state smallint NOT NULL,
    epic_id bigint,
    source_commit text,
    close_after_error_tracking_resolve boolean DEFAULT false NOT NULL,
    close_auto_resolve_prometheus_alert boolean DEFAULT false NOT NULL,
    source_merge_request_id bigint,
    imported_from smallint DEFAULT 0 NOT NULL,
    CONSTRAINT check_f0bcfaa3a2 CHECK ((char_length(source_commit) <= 40)),
    CONSTRAINT state_events_must_belong_to_issue_or_merge_request_or_epic CHECK ((((issue_id <> NULL::bigint) AND (merge_request_id IS NULL) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id <> NULL::bigint) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id IS NULL) AND (epic_id <> NULL::integer))))
);

CREATE SEQUENCE resource_state_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE resource_state_events_id_seq OWNED BY resource_state_events.id;

CREATE TABLE resource_weight_events (
    id bigint NOT NULL,
    user_id bigint,
    issue_id bigint NOT NULL,
    weight integer,
    created_at timestamp with time zone NOT NULL,
    previous_weight integer
);

CREATE SEQUENCE resource_weight_events_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE resource_weight_events_id_seq OWNED BY resource_weight_events.id;

CREATE TABLE reviews (
    id bigint NOT NULL,
    author_id bigint,
    merge_request_id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE reviews_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE reviews_id_seq OWNED BY reviews.id;

CREATE TABLE routes (
    id bigint NOT NULL,
    source_id bigint NOT NULL,
    source_type character varying NOT NULL,
    path character varying NOT NULL,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    name character varying,
    namespace_id bigint,
    CONSTRAINT check_af84c6c93f CHECK ((namespace_id IS NOT NULL))
);

CREATE SEQUENCE routes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE routes_id_seq OWNED BY routes.id;

CREATE TABLE saml_group_links (
    id bigint NOT NULL,
    access_level smallint NOT NULL,
    group_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    saml_group_name text NOT NULL,
    member_role_id bigint,
    CONSTRAINT check_1b3fc49d1e CHECK ((char_length(saml_group_name) <= 255))
);

CREATE SEQUENCE saml_group_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE saml_group_links_id_seq OWNED BY saml_group_links.id;

CREATE TABLE saml_providers (
    id bigint NOT NULL,
    group_id bigint NOT NULL,
    enabled boolean NOT NULL,
    certificate_fingerprint character varying NOT NULL,
    sso_url character varying NOT NULL,
    enforced_sso boolean DEFAULT false NOT NULL,
    enforced_group_managed_accounts boolean DEFAULT false NOT NULL,
    prohibited_outer_forks boolean DEFAULT true NOT NULL,
    default_membership_role smallint DEFAULT 10 NOT NULL,
    git_check_enforced boolean DEFAULT false NOT NULL,
    member_role_id bigint,
    disable_password_authentication_for_enterprise_users boolean DEFAULT false
);

CREATE SEQUENCE saml_providers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE saml_providers_id_seq OWNED BY saml_providers.id;

CREATE TABLE saved_replies (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    name text NOT NULL,
    content text NOT NULL,
    CONSTRAINT check_0cb57dc22a CHECK ((char_length(content) <= 10000)),
    CONSTRAINT check_2eb3366d7f CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE saved_replies_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE saved_replies_id_seq OWNED BY saved_replies.id;

CREATE TABLE sbom_component_versions (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    component_id bigint NOT NULL,
    version text NOT NULL,
    source_package_name text,
    organization_id bigint NOT NULL,
    CONSTRAINT check_39636b9a8a CHECK ((char_length(source_package_name) <= 255)),
    CONSTRAINT check_e71cad08d3 CHECK ((char_length(version) <= 255))
);

CREATE SEQUENCE sbom_component_versions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sbom_component_versions_id_seq OWNED BY sbom_component_versions.id;

CREATE TABLE sbom_components (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    component_type smallint NOT NULL,
    name text NOT NULL,
    purl_type smallint,
    organization_id bigint NOT NULL,
    CONSTRAINT check_91a8f6ad53 CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE sbom_components_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sbom_components_id_seq OWNED BY sbom_components.id;

CREATE TABLE sbom_occurrences (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    component_version_id bigint,
    project_id bigint NOT NULL,
    pipeline_id bigint,
    source_id bigint,
    commit_sha bytea NOT NULL,
    component_id bigint NOT NULL,
    uuid uuid NOT NULL,
    package_manager text,
    component_name text,
    input_file_path text,
    licenses jsonb DEFAULT '[]'::jsonb,
    highest_severity smallint,
    vulnerability_count integer DEFAULT 0 NOT NULL,
    source_package_id bigint,
    archived boolean DEFAULT false NOT NULL,
    traversal_ids bigint[] DEFAULT '{}'::bigint[] NOT NULL,
    ancestors jsonb DEFAULT '[]'::jsonb NOT NULL,
    reachability smallint DEFAULT 0,
    CONSTRAINT check_3f2d2c7ffc CHECK ((char_length(package_manager) <= 255)),
    CONSTRAINT check_9b29021fa8 CHECK ((char_length(component_name) <= 255)),
    CONSTRAINT check_e6b8437cfe CHECK ((char_length(input_file_path) <= 1024))
);

CREATE SEQUENCE sbom_occurrences_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sbom_occurrences_id_seq OWNED BY sbom_occurrences.id;

CREATE TABLE sbom_occurrences_vulnerabilities (
    id bigint NOT NULL,
    sbom_occurrence_id bigint NOT NULL,
    vulnerability_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint
);

CREATE SEQUENCE sbom_occurrences_vulnerabilities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sbom_occurrences_vulnerabilities_id_seq OWNED BY sbom_occurrences_vulnerabilities.id;

CREATE TABLE sbom_source_packages (
    id bigint NOT NULL,
    name text NOT NULL,
    purl_type smallint NOT NULL,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    updated_at timestamp with time zone DEFAULT now() NOT NULL,
    organization_id bigint NOT NULL,
    CONSTRAINT check_8fba79abed CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE sbom_source_packages_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sbom_source_packages_id_seq OWNED BY sbom_source_packages.id;

CREATE TABLE sbom_sources (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    source_type smallint NOT NULL,
    source jsonb DEFAULT '{}'::jsonb NOT NULL,
    organization_id bigint NOT NULL
);

CREATE SEQUENCE sbom_sources_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sbom_sources_id_seq OWNED BY sbom_sources.id;

CREATE TABLE scan_execution_policy_rules (
    id bigint NOT NULL,
    security_policy_id bigint NOT NULL,
    security_policy_management_project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    rule_index smallint NOT NULL,
    type smallint NOT NULL,
    content jsonb DEFAULT '{}'::jsonb NOT NULL
);

CREATE SEQUENCE scan_execution_policy_rules_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE scan_execution_policy_rules_id_seq OWNED BY scan_execution_policy_rules.id;

CREATE TABLE scan_result_policies (
    id bigint NOT NULL,
    security_orchestration_policy_configuration_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    orchestration_policy_idx smallint NOT NULL,
    license_states text[] DEFAULT '{}'::text[],
    match_on_inclusion boolean,
    role_approvers integer[] DEFAULT '{}'::integer[],
    age_value integer,
    age_operator smallint,
    age_interval smallint,
    vulnerability_attributes jsonb DEFAULT '{}'::jsonb,
    project_id bigint,
    rule_idx smallint,
    project_approval_settings jsonb DEFAULT '{}'::jsonb NOT NULL,
    commits smallint,
    send_bot_message jsonb DEFAULT '{}'::jsonb NOT NULL,
    fallback_behavior jsonb DEFAULT '{}'::jsonb NOT NULL,
    policy_tuning jsonb DEFAULT '{}'::jsonb NOT NULL,
    CONSTRAINT age_value_null_or_positive CHECK (((age_value IS NULL) OR (age_value >= 0))),
    CONSTRAINT check_scan_result_policies_rule_idx_positive CHECK (((rule_idx IS NULL) OR (rule_idx >= 0)))
);

CREATE SEQUENCE scan_result_policies_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE scan_result_policies_id_seq OWNED BY scan_result_policies.id;

CREATE TABLE scan_result_policy_violations (
    id bigint NOT NULL,
    scan_result_policy_id bigint,
    merge_request_id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    violation_data jsonb,
    approval_policy_rule_id bigint,
    status smallint DEFAULT 1 NOT NULL,
    CONSTRAINT chk_policy_violations_rule_id_or_policy_id_not_null CHECK (((approval_policy_rule_id IS NOT NULL) OR (scan_result_policy_id IS NOT NULL)))
);

CREATE SEQUENCE scan_result_policy_violations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE scan_result_policy_violations_id_seq OWNED BY scan_result_policy_violations.id;

CREATE TABLE schema_migrations (
    version character varying NOT NULL,
    finished_at timestamp with time zone DEFAULT now()
);

CREATE TABLE scim_identities (
    id bigint NOT NULL,
    group_id bigint,
    user_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    active boolean DEFAULT false,
    extern_uid character varying(255) NOT NULL
);

CREATE SEQUENCE scim_identities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE scim_identities_id_seq OWNED BY scim_identities.id;

CREATE TABLE scim_oauth_access_tokens (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    group_id bigint,
    token_encrypted character varying NOT NULL
);

CREATE SEQUENCE scim_oauth_access_tokens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE scim_oauth_access_tokens_id_seq OWNED BY scim_oauth_access_tokens.id;

CREATE SEQUENCE security_findings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_findings_id_seq OWNED BY security_findings.id;

CREATE TABLE security_orchestration_policy_configurations (
    id bigint NOT NULL,
    project_id bigint,
    security_policy_management_project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    configured_at timestamp with time zone,
    namespace_id bigint,
    CONSTRAINT cop_configs_project_or_namespace_existence CHECK (((project_id IS NULL) <> (namespace_id IS NULL)))
);

COMMENT ON TABLE security_orchestration_policy_configurations IS '{"owner":"group::container security","description":"Configuration used to store relationship between project and security policy repository"}';

CREATE SEQUENCE security_orchestration_policy_configurations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_orchestration_policy_configurations_id_seq OWNED BY security_orchestration_policy_configurations.id;

CREATE TABLE security_orchestration_policy_rule_schedules (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    next_run_at timestamp with time zone,
    security_orchestration_policy_configuration_id bigint NOT NULL,
    user_id bigint NOT NULL,
    policy_index integer NOT NULL,
    cron text NOT NULL,
    rule_index integer DEFAULT 0 NOT NULL,
    project_id bigint,
    namespace_id bigint,
    policy_type smallint DEFAULT 0 NOT NULL,
    CONSTRAINT check_915825a76e CHECK ((char_length(cron) <= 255))
);

COMMENT ON TABLE security_orchestration_policy_rule_schedules IS '{"owner":"group::container security","description":"Schedules used to store relationship between project and security policy repository"}';

CREATE SEQUENCE security_orchestration_policy_rule_schedules_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_orchestration_policy_rule_schedules_id_seq OWNED BY security_orchestration_policy_rule_schedules.id;

CREATE TABLE security_policies (
    id bigint NOT NULL,
    security_orchestration_policy_configuration_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    policy_index smallint NOT NULL,
    type smallint NOT NULL,
    enabled boolean DEFAULT true NOT NULL,
    name text NOT NULL,
    description text,
    checksum text NOT NULL,
    scope jsonb DEFAULT '{}'::jsonb NOT NULL,
    security_policy_management_project_id bigint NOT NULL,
    content jsonb DEFAULT '{}'::jsonb NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    CONSTRAINT check_3fa0f29e4b CHECK ((char_length(name) <= 255)),
    CONSTRAINT check_966e08b242 CHECK ((char_length(checksum) <= 255)),
    CONSTRAINT check_99c8e08928 CHECK ((char_length(description) <= 255))
);

CREATE SEQUENCE security_policies_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_policies_id_seq OWNED BY security_policies.id;

CREATE TABLE security_policy_project_links (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    security_policy_id bigint NOT NULL
);

CREATE SEQUENCE security_policy_project_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_policy_project_links_id_seq OWNED BY security_policy_project_links.id;

CREATE TABLE security_policy_requirements (
    id bigint NOT NULL,
    compliance_framework_security_policy_id bigint NOT NULL,
    compliance_requirement_id bigint NOT NULL,
    namespace_id bigint NOT NULL
);

CREATE SEQUENCE security_policy_requirements_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_policy_requirements_id_seq OWNED BY security_policy_requirements.id;

CREATE TABLE security_scans (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    build_id bigint NOT NULL,
    scan_type smallint NOT NULL,
    info jsonb DEFAULT '{}'::jsonb NOT NULL,
    project_id bigint,
    pipeline_id bigint,
    latest boolean DEFAULT true NOT NULL,
    status smallint DEFAULT 0 NOT NULL,
    findings_partition_number integer DEFAULT 1 NOT NULL
);

CREATE SEQUENCE security_scans_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_scans_id_seq OWNED BY security_scans.id;

CREATE TABLE security_training_providers (
    id bigint NOT NULL,
    name text NOT NULL,
    description text,
    url text NOT NULL,
    logo_url text,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    CONSTRAINT check_544b3dc935 CHECK ((char_length(url) <= 512)),
    CONSTRAINT check_6fe222f071 CHECK ((char_length(logo_url) <= 512)),
    CONSTRAINT check_a8ff21ced5 CHECK ((char_length(description) <= 512)),
    CONSTRAINT check_dae433eed6 CHECK ((char_length(name) <= 256))
);

CREATE SEQUENCE security_training_providers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_training_providers_id_seq OWNED BY security_training_providers.id;

CREATE TABLE security_trainings (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    provider_id bigint NOT NULL,
    is_primary boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE security_trainings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE security_trainings_id_seq OWNED BY security_trainings.id;

CREATE TABLE sent_notifications (
    project_id bigint,
    noteable_id bigint,
    noteable_type character varying,
    recipient_id bigint,
    commit_id character varying,
    reply_key character varying NOT NULL,
    in_reply_to_discussion_id character varying,
    id bigint NOT NULL,
    issue_email_participant_id bigint
);

CREATE SEQUENCE sent_notifications_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sent_notifications_id_seq OWNED BY sent_notifications.id;

CREATE TABLE sentry_issues (
    id bigint NOT NULL,
    issue_id bigint NOT NULL,
    sentry_issue_identifier bigint NOT NULL
);

CREATE SEQUENCE sentry_issues_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sentry_issues_id_seq OWNED BY sentry_issues.id;

CREATE TABLE service_access_tokens (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    encrypted_token bytea NOT NULL,
    encrypted_token_iv bytea NOT NULL,
    expires_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE service_access_tokens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE service_access_tokens_id_seq OWNED BY service_access_tokens.id;

CREATE TABLE service_desk_custom_email_credentials (
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    smtp_port integer,
    smtp_address text,
    encrypted_smtp_username bytea,
    encrypted_smtp_username_iv bytea,
    encrypted_smtp_password bytea,
    encrypted_smtp_password_iv bytea,
    smtp_authentication smallint,
    CONSTRAINT check_6dd11e956a CHECK ((char_length(smtp_address) <= 255))
);

CREATE TABLE service_desk_custom_email_verifications (
    project_id bigint NOT NULL,
    triggerer_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    triggered_at timestamp with time zone,
    state smallint DEFAULT 0 NOT NULL,
    error smallint,
    encrypted_token bytea,
    encrypted_token_iv bytea
);

CREATE TABLE service_desk_settings (
    project_id bigint NOT NULL,
    issue_template_key character varying(255),
    outgoing_name character varying(255),
    project_key character varying(255),
    file_template_project_id bigint,
    custom_email_enabled boolean DEFAULT false NOT NULL,
    custom_email text,
    service_desk_enabled boolean DEFAULT true NOT NULL,
    add_external_participants_from_cc boolean DEFAULT false NOT NULL,
    reopen_issue_on_external_participant_note boolean DEFAULT false NOT NULL,
    tickets_confidential_by_default boolean DEFAULT true NOT NULL,
    CONSTRAINT check_57a79552e1 CHECK ((char_length(custom_email) <= 255))
);

CREATE TABLE shards (
    id bigint NOT NULL,
    name character varying NOT NULL
);

CREATE SEQUENCE shards_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE shards_id_seq OWNED BY shards.id;

CREATE TABLE slack_api_scopes (
    id bigint NOT NULL,
    name text NOT NULL,
    CONSTRAINT check_738678187a CHECK ((char_length(name) <= 100))
);

CREATE SEQUENCE slack_api_scopes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE slack_api_scopes_id_seq OWNED BY slack_api_scopes.id;

CREATE TABLE slack_integrations (
    id bigint NOT NULL,
    team_id character varying NOT NULL,
    team_name character varying NOT NULL,
    alias character varying NOT NULL,
    user_id character varying NOT NULL,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    bot_user_id text,
    encrypted_bot_access_token bytea,
    encrypted_bot_access_token_iv bytea,
    integration_id bigint,
    CONSTRAINT check_bc553aea8a CHECK ((char_length(bot_user_id) <= 255)),
    CONSTRAINT check_c9ca9ae80d CHECK ((integration_id IS NOT NULL))
);

CREATE SEQUENCE slack_integrations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE slack_integrations_id_seq OWNED BY slack_integrations.id;

CREATE TABLE slack_integrations_scopes (
    id bigint NOT NULL,
    slack_api_scope_id bigint NOT NULL,
    slack_integration_id bigint NOT NULL
);

CREATE SEQUENCE slack_integrations_scopes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE slack_integrations_scopes_id_seq OWNED BY slack_integrations_scopes.id;

CREATE TABLE smartcard_identities (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    subject character varying NOT NULL,
    issuer character varying NOT NULL
);

CREATE SEQUENCE smartcard_identities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE smartcard_identities_id_seq OWNED BY smartcard_identities.id;

CREATE TABLE snippet_repositories (
    snippet_id bigint NOT NULL,
    shard_id bigint NOT NULL,
    disk_path character varying(80) NOT NULL,
    verification_retry_count smallint,
    verification_retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    verification_checksum bytea,
    verification_failure text,
    verification_state smallint DEFAULT 0 NOT NULL,
    verification_started_at timestamp with time zone,
    CONSTRAINT snippet_repositories_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255))
);

CREATE TABLE snippet_repository_storage_moves (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    snippet_id bigint NOT NULL,
    state smallint DEFAULT 1 NOT NULL,
    source_storage_name text NOT NULL,
    destination_storage_name text NOT NULL,
    error_message text,
    CONSTRAINT check_a42ab83060 CHECK ((char_length(error_message) <= 256)),
    CONSTRAINT snippet_repository_storage_moves_destination_storage_name CHECK ((char_length(destination_storage_name) <= 255)),
    CONSTRAINT snippet_repository_storage_moves_source_storage_name CHECK ((char_length(source_storage_name) <= 255))
);

CREATE SEQUENCE snippet_repository_storage_moves_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE snippet_repository_storage_moves_id_seq OWNED BY snippet_repository_storage_moves.id;

CREATE TABLE snippet_statistics (
    snippet_id bigint NOT NULL,
    repository_size bigint DEFAULT 0 NOT NULL,
    file_count bigint DEFAULT 0 NOT NULL,
    commit_count bigint DEFAULT 0 NOT NULL
);

CREATE TABLE snippet_user_mentions (
    id bigint NOT NULL,
    snippet_id bigint NOT NULL,
    mentioned_users_ids bigint[],
    mentioned_projects_ids bigint[],
    mentioned_groups_ids bigint[],
    note_id bigint
);

CREATE SEQUENCE snippet_user_mentions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE snippet_user_mentions_id_seq OWNED BY snippet_user_mentions.id;

CREATE TABLE snippets (
    id bigint NOT NULL,
    title character varying,
    content text,
    author_id bigint NOT NULL,
    project_id bigint,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    file_name character varying,
    type character varying,
    visibility_level integer DEFAULT 0 NOT NULL,
    title_html text,
    content_html text,
    cached_markdown_version integer,
    description text,
    description_html text,
    encrypted_secret_token character varying(255),
    encrypted_secret_token_iv character varying(255),
    secret boolean DEFAULT false NOT NULL,
    repository_read_only boolean DEFAULT false NOT NULL,
    imported_from smallint DEFAULT 0 NOT NULL,
    organization_id bigint,
    CONSTRAINT check_82c1d40fab CHECK ((num_nonnulls(organization_id, project_id) = 1))
);

CREATE SEQUENCE snippets_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE snippets_id_seq OWNED BY snippets.id;

CREATE TABLE software_license_policies (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    software_license_id bigint,
    classification integer DEFAULT 0 NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    scan_result_policy_id bigint,
    custom_software_license_id bigint,
    approval_policy_rule_id bigint,
    software_license_spdx_identifier text,
    CONSTRAINT check_986c4e5c59 CHECK ((char_length(software_license_spdx_identifier) <= 255)),
    CONSTRAINT check_9ba23ae4c3 CHECK ((num_nonnulls(custom_software_license_id, software_license_id) = 1))
);

CREATE SEQUENCE software_license_policies_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE software_license_policies_id_seq OWNED BY software_license_policies.id;

CREATE TABLE software_licenses (
    id bigint NOT NULL,
    name character varying NOT NULL,
    spdx_identifier character varying(255)
);

CREATE SEQUENCE software_licenses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE software_licenses_id_seq OWNED BY software_licenses.id;

CREATE TABLE spam_logs (
    id bigint NOT NULL,
    user_id bigint,
    source_ip character varying,
    user_agent character varying,
    via_api boolean,
    noteable_type character varying,
    title character varying,
    description text,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    submitted_as_ham boolean DEFAULT false NOT NULL,
    recaptcha_verified boolean DEFAULT false NOT NULL
);

CREATE SEQUENCE spam_logs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE spam_logs_id_seq OWNED BY spam_logs.id;

CREATE TABLE sprints (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    start_date date,
    due_date date,
    group_id bigint,
    iid integer NOT NULL,
    cached_markdown_version integer,
    title text,
    title_html text,
    description text,
    description_html text,
    state_enum smallint DEFAULT 1 NOT NULL,
    iterations_cadence_id bigint,
    sequence integer,
    CONSTRAINT sprints_title CHECK ((char_length(title) <= 255))
);

CREATE SEQUENCE sprints_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE sprints_id_seq OWNED BY sprints.id;

CREATE TABLE ssh_signatures (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    key_id bigint,
    verification_status smallint DEFAULT 0 NOT NULL,
    commit_sha bytea NOT NULL,
    user_id bigint,
    key_fingerprint_sha256 bytea
);

CREATE SEQUENCE ssh_signatures_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE ssh_signatures_id_seq OWNED BY ssh_signatures.id;

CREATE TABLE status_check_responses (
    id bigint NOT NULL,
    merge_request_id bigint NOT NULL,
    external_approval_rule_id bigint,
    sha bytea NOT NULL,
    external_status_check_id bigint NOT NULL,
    status smallint DEFAULT 0 NOT NULL,
    retried_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now() NOT NULL,
    project_id bigint
);

CREATE SEQUENCE status_check_responses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE status_check_responses_id_seq OWNED BY status_check_responses.id;

CREATE TABLE status_page_published_incidents (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    issue_id bigint NOT NULL
);

CREATE SEQUENCE status_page_published_incidents_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE status_page_published_incidents_id_seq OWNED BY status_page_published_incidents.id;

CREATE TABLE status_page_settings (
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    enabled boolean DEFAULT false NOT NULL,
    aws_s3_bucket_name character varying(63) NOT NULL,
    aws_region character varying(255) NOT NULL,
    aws_access_key character varying(255) NOT NULL,
    encrypted_aws_secret_key character varying(255) NOT NULL,
    encrypted_aws_secret_key_iv character varying(255) NOT NULL,
    status_page_url text,
    CONSTRAINT check_75a79cd992 CHECK ((char_length(status_page_url) <= 1024))
);

CREATE SEQUENCE status_page_settings_project_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE status_page_settings_project_id_seq OWNED BY status_page_settings.project_id;

CREATE TABLE subscription_add_on_purchases (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    subscription_add_on_id bigint NOT NULL,
    namespace_id bigint,
    quantity integer NOT NULL,
    expires_on date NOT NULL,
    purchase_xid text NOT NULL,
    last_assigned_users_refreshed_at timestamp with time zone,
    trial boolean DEFAULT false NOT NULL,
    started_at date,
    organization_id bigint NOT NULL,
    CONSTRAINT check_3313c4d200 CHECK ((char_length(purchase_xid) <= 255))
);

CREATE SEQUENCE subscription_add_on_purchases_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE subscription_add_on_purchases_id_seq OWNED BY subscription_add_on_purchases.id;

CREATE TABLE subscription_add_ons (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    name smallint NOT NULL,
    description text NOT NULL,
    CONSTRAINT check_4c39d15ada CHECK ((char_length(description) <= 512))
);

CREATE SEQUENCE subscription_add_ons_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE subscription_add_ons_id_seq OWNED BY subscription_add_ons.id;

CREATE TABLE subscription_seat_assignments (
    id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    user_id bigint NOT NULL,
    last_activity_on timestamp with time zone,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE subscription_seat_assignments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE subscription_seat_assignments_id_seq OWNED BY subscription_seat_assignments.id;

CREATE TABLE subscription_user_add_on_assignment_versions (
    id bigint NOT NULL,
    organization_id bigint NOT NULL,
    item_id bigint,
    purchase_id bigint,
    user_id bigint,
    created_at timestamp with time zone,
    item_type text NOT NULL,
    event text NOT NULL,
    namespace_path text,
    add_on_name text,
    whodunnit text,
    object jsonb,
    CONSTRAINT check_211bad6d65 CHECK ((char_length(item_type) <= 255)),
    CONSTRAINT check_34ca72be24 CHECK ((char_length(event) <= 255)),
    CONSTRAINT check_839913a25d CHECK ((char_length(namespace_path) <= 255)),
    CONSTRAINT check_9ceaa5668c CHECK ((char_length(add_on_name) <= 255)),
    CONSTRAINT check_e185bf0c82 CHECK ((char_length(whodunnit) <= 255))
);

CREATE SEQUENCE subscription_user_add_on_assignment_versions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE subscription_user_add_on_assignment_versions_id_seq OWNED BY subscription_user_add_on_assignment_versions.id;

CREATE TABLE subscription_user_add_on_assignments (
    id bigint NOT NULL,
    add_on_purchase_id bigint NOT NULL,
    user_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    organization_id bigint,
    CONSTRAINT check_7d21f9cebf CHECK ((organization_id IS NOT NULL))
);

CREATE SEQUENCE subscription_user_add_on_assignments_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE subscription_user_add_on_assignments_id_seq OWNED BY subscription_user_add_on_assignments.id;

CREATE TABLE subscriptions (
    id bigint NOT NULL,
    user_id bigint,
    subscribable_id bigint,
    subscribable_type character varying,
    subscribed boolean,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    project_id bigint
);

CREATE SEQUENCE subscriptions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE subscriptions_id_seq OWNED BY subscriptions.id;

CREATE TABLE suggestions (
    id bigint NOT NULL,
    relative_order smallint NOT NULL,
    applied boolean DEFAULT false NOT NULL,
    commit_id character varying,
    from_content text NOT NULL,
    to_content text NOT NULL,
    lines_above integer DEFAULT 0 NOT NULL,
    lines_below integer DEFAULT 0 NOT NULL,
    outdated boolean DEFAULT false NOT NULL,
    note_id bigint NOT NULL
);

CREATE SEQUENCE suggestions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE suggestions_id_seq OWNED BY suggestions.id;

CREATE TABLE system_access_instance_microsoft_applications (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    enabled boolean DEFAULT false NOT NULL,
    tenant_xid text NOT NULL,
    client_xid text NOT NULL,
    login_endpoint text DEFAULT 'https://login.microsoftonline.com'::text NOT NULL,
    graph_endpoint text DEFAULT 'https://graph.microsoft.com'::text NOT NULL,
    encrypted_client_secret bytea NOT NULL,
    encrypted_client_secret_iv bytea NOT NULL,
    CONSTRAINT check_75bf46c253 CHECK ((char_length(login_endpoint) <= 255)),
    CONSTRAINT check_80a40c5b74 CHECK ((char_length(client_xid) <= 255)),
    CONSTRAINT check_e00a5d3a61 CHECK ((char_length(graph_endpoint) <= 255)),
    CONSTRAINT check_e63bb275fa CHECK ((char_length(tenant_xid) <= 255))
);

CREATE SEQUENCE system_access_instance_microsoft_applications_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE system_access_instance_microsoft_applications_id_seq OWNED BY system_access_instance_microsoft_applications.id;

CREATE TABLE system_access_instance_microsoft_graph_access_tokens (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    system_access_instance_microsoft_application_id bigint,
    expires_in integer NOT NULL,
    encrypted_token bytea NOT NULL,
    encrypted_token_iv bytea NOT NULL
);

CREATE SEQUENCE system_access_instance_microsoft_graph_access_tokens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE system_access_instance_microsoft_graph_access_tokens_id_seq OWNED BY system_access_instance_microsoft_graph_access_tokens.id;

CREATE TABLE system_access_microsoft_applications (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    namespace_id bigint,
    enabled boolean DEFAULT false NOT NULL,
    tenant_xid text NOT NULL,
    client_xid text NOT NULL,
    login_endpoint text DEFAULT 'https://login.microsoftonline.com'::text NOT NULL,
    graph_endpoint text DEFAULT 'https://graph.microsoft.com'::text NOT NULL,
    encrypted_client_secret bytea NOT NULL,
    encrypted_client_secret_iv bytea NOT NULL,
    CONSTRAINT check_042f6b21aa CHECK ((char_length(login_endpoint) <= 255)),
    CONSTRAINT check_1e8b2d405f CHECK ((char_length(tenant_xid) <= 255)),
    CONSTRAINT check_339c3ffca8 CHECK ((char_length(graph_endpoint) <= 255)),
    CONSTRAINT check_ee72fb5459 CHECK ((char_length(client_xid) <= 255))
);

CREATE SEQUENCE system_access_microsoft_applications_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE system_access_microsoft_applications_id_seq OWNED BY system_access_microsoft_applications.id;

CREATE TABLE system_access_microsoft_graph_access_tokens (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    system_access_microsoft_application_id bigint,
    expires_in integer NOT NULL,
    encrypted_token bytea NOT NULL,
    encrypted_token_iv bytea NOT NULL
);

CREATE SEQUENCE system_access_microsoft_graph_access_tokens_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE system_access_microsoft_graph_access_tokens_id_seq OWNED BY system_access_microsoft_graph_access_tokens.id;

CREATE TABLE system_note_metadata (
    commit_count integer,
    action character varying,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    description_version_id bigint,
    note_id bigint NOT NULL,
    id bigint NOT NULL
);

CREATE SEQUENCE system_note_metadata_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE system_note_metadata_id_seq OWNED BY system_note_metadata.id;

CREATE TABLE taggings (
    tag_id bigint,
    taggable_type character varying,
    tagger_id bigint,
    tagger_type character varying,
    context character varying,
    created_at timestamp without time zone,
    id bigint NOT NULL,
    taggable_id bigint
);

CREATE SEQUENCE taggings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE taggings_id_seq OWNED BY taggings.id;

CREATE TABLE tags (
    id bigint NOT NULL,
    name character varying,
    taggings_count integer DEFAULT 0
);

CREATE SEQUENCE tags_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE tags_id_seq OWNED BY tags.id;

CREATE TABLE target_branch_rules (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    name text NOT NULL,
    target_branch text NOT NULL,
    CONSTRAINT check_3a0b12cf8c CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE target_branch_rules_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE target_branch_rules_id_seq OWNED BY target_branch_rules.id;

CREATE TABLE term_agreements (
    id bigint NOT NULL,
    term_id bigint NOT NULL,
    user_id bigint NOT NULL,
    accepted boolean DEFAULT false NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE term_agreements_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE term_agreements_id_seq OWNED BY term_agreements.id;

CREATE TABLE terraform_state_versions (
    id bigint NOT NULL,
    terraform_state_id bigint NOT NULL,
    created_by_user_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    version integer NOT NULL,
    file_store smallint NOT NULL,
    file text NOT NULL,
    verification_retry_count smallint,
    verification_retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    verification_checksum bytea,
    verification_failure text,
    ci_build_id bigint,
    verification_started_at timestamp with time zone,
    verification_state smallint DEFAULT 0 NOT NULL,
    project_id bigint,
    CONSTRAINT check_0824bb7bbd CHECK ((char_length(file) <= 255)),
    CONSTRAINT tf_state_versions_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255))
);

CREATE SEQUENCE terraform_state_versions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE terraform_state_versions_id_seq OWNED BY terraform_state_versions.id;

CREATE TABLE terraform_states (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    file_store smallint,
    file character varying(255),
    lock_xid character varying(255),
    locked_at timestamp with time zone,
    locked_by_user_id bigint,
    uuid character varying(32) NOT NULL,
    name character varying(255) NOT NULL,
    versioning_enabled boolean DEFAULT true NOT NULL,
    deleted_at timestamp with time zone,
    activerecord_lock_version integer DEFAULT 0 NOT NULL
);

CREATE SEQUENCE terraform_states_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE terraform_states_id_seq OWNED BY terraform_states.id;

CREATE TABLE timelog_categories (
    id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    billing_rate numeric(18,4) DEFAULT 0.0,
    billable boolean DEFAULT false NOT NULL,
    name text NOT NULL,
    description text,
    color text DEFAULT '#6699cc'::text NOT NULL,
    CONSTRAINT check_37ad5f23d7 CHECK ((char_length(name) <= 255)),
    CONSTRAINT check_4ba862ba3e CHECK ((char_length(color) <= 7)),
    CONSTRAINT check_c4b8aec13a CHECK ((char_length(description) <= 1024))
);

CREATE SEQUENCE timelog_categories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE timelog_categories_id_seq OWNED BY timelog_categories.id;

CREATE TABLE timelogs (
    id bigint NOT NULL,
    time_spent integer NOT NULL,
    user_id bigint,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    issue_id bigint,
    merge_request_id bigint,
    spent_at timestamp without time zone DEFAULT now(),
    project_id bigint,
    summary text,
    note_id bigint,
    timelog_category_id bigint,
    CONSTRAINT check_271d321699 CHECK ((char_length(summary) <= 255))
);

CREATE SEQUENCE timelogs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE timelogs_id_seq OWNED BY timelogs.id;

CREATE TABLE todos (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    project_id bigint,
    target_id bigint,
    target_type character varying NOT NULL,
    author_id bigint NOT NULL,
    action integer NOT NULL,
    state character varying NOT NULL,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    commit_id character varying,
    group_id bigint,
    resolved_by_action smallint,
    note_id bigint,
    snoozed_until timestamp with time zone
);

CREATE SEQUENCE todos_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE todos_id_seq OWNED BY todos.id;

CREATE TABLE topics (
    id bigint NOT NULL,
    name text NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    avatar text,
    description text,
    total_projects_count bigint DEFAULT 0 NOT NULL,
    non_private_projects_count bigint DEFAULT 0 NOT NULL,
    title text,
    slug text,
    organization_id bigint DEFAULT 1 NOT NULL,
    CONSTRAINT check_0eda72aeb0 CHECK ((char_length(slug) <= 255)),
    CONSTRAINT check_223b50f9be CHECK ((char_length(title) <= 255)),
    CONSTRAINT check_26753fb43a CHECK ((char_length(avatar) <= 255)),
    CONSTRAINT check_5d1a07c8c8 CHECK ((char_length(description) <= 1024)),
    CONSTRAINT check_7a90d4c757 CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE topics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE topics_id_seq OWNED BY topics.id;

CREATE TABLE trending_projects (
    id bigint NOT NULL,
    project_id bigint NOT NULL
);

CREATE SEQUENCE trending_projects_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE trending_projects_id_seq OWNED BY trending_projects.id;

CREATE TABLE upcoming_reconciliations (
    id bigint NOT NULL,
    namespace_id bigint,
    next_reconciliation_date date NOT NULL,
    display_alert_from date NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    organization_id bigint NOT NULL
);

CREATE SEQUENCE upcoming_reconciliations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE upcoming_reconciliations_id_seq OWNED BY upcoming_reconciliations.id;

CREATE TABLE upload_states (
    verification_started_at timestamp with time zone,
    verification_retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    upload_id bigint NOT NULL,
    verification_state smallint DEFAULT 0 NOT NULL,
    verification_retry_count smallint,
    verification_checksum bytea,
    verification_failure text,
    CONSTRAINT check_7396dc8591 CHECK ((char_length(verification_failure) <= 255))
);

CREATE SEQUENCE upload_states_upload_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE upload_states_upload_id_seq OWNED BY upload_states.upload_id;

CREATE TABLE uploads (
    id bigint NOT NULL,
    size bigint NOT NULL,
    path character varying(511) NOT NULL,
    checksum character varying(64),
    model_id bigint,
    model_type character varying,
    uploader character varying NOT NULL,
    created_at timestamp without time zone NOT NULL,
    store integer DEFAULT 1,
    mount_point character varying,
    secret character varying,
    version integer DEFAULT 1 NOT NULL,
    uploaded_by_user_id bigint,
    CONSTRAINT check_5e9547379c CHECK ((store IS NOT NULL))
);

CREATE SEQUENCE uploads_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id;

CREATE TABLE user_achievements (
    id bigint NOT NULL,
    achievement_id bigint NOT NULL,
    user_id bigint NOT NULL,
    awarded_by_user_id bigint,
    revoked_by_user_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    revoked_at timestamp with time zone,
    priority integer,
    namespace_id bigint,
    show_on_profile boolean DEFAULT true NOT NULL
);

CREATE SEQUENCE user_achievements_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_achievements_id_seq OWNED BY user_achievements.id;

CREATE TABLE user_agent_details (
    id bigint NOT NULL,
    user_agent character varying NOT NULL,
    ip_address character varying NOT NULL,
    subject_id bigint NOT NULL,
    subject_type character varying NOT NULL,
    submitted boolean DEFAULT false NOT NULL,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL
);

CREATE SEQUENCE user_agent_details_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_agent_details_id_seq OWNED BY user_agent_details.id;

CREATE TABLE user_broadcast_message_dismissals (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    broadcast_message_id bigint NOT NULL,
    expires_at timestamp with time zone,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE user_broadcast_message_dismissals_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_broadcast_message_dismissals_id_seq OWNED BY user_broadcast_message_dismissals.id;

CREATE TABLE user_callouts (
    id bigint NOT NULL,
    feature_name integer NOT NULL,
    user_id bigint NOT NULL,
    dismissed_at timestamp with time zone
);

CREATE SEQUENCE user_callouts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_callouts_id_seq OWNED BY user_callouts.id;

CREATE TABLE user_credit_card_validations (
    user_id bigint NOT NULL,
    credit_card_validated_at timestamp with time zone NOT NULL,
    last_digits_hash text,
    holder_name_hash text,
    expiration_date_hash text,
    network_hash text,
    zuora_payment_method_xid text,
    stripe_setup_intent_xid text,
    stripe_payment_method_xid text,
    stripe_card_fingerprint text,
    CONSTRAINT check_126615a57d CHECK ((char_length(stripe_payment_method_xid) <= 255)),
    CONSTRAINT check_209503e313 CHECK ((char_length(stripe_card_fingerprint) <= 255)),
    CONSTRAINT check_5d9e69ede5 CHECK ((char_length(stripe_setup_intent_xid) <= 255)),
    CONSTRAINT check_7721e1961a CHECK ((char_length(network_hash) <= 44)),
    CONSTRAINT check_83f1e2ace3 CHECK ((char_length(expiration_date_hash) <= 44)),
    CONSTRAINT check_9a15d14e37 CHECK ((char_length(zuora_payment_method_xid) <= 50)),
    CONSTRAINT check_aca7c2607c CHECK ((char_length(holder_name_hash) <= 44)),
    CONSTRAINT check_f5c35b1a6e CHECK ((char_length(last_digits_hash) <= 44))
);

CREATE TABLE user_custom_attributes (
    id bigint NOT NULL,
    created_at timestamp without time zone NOT NULL,
    updated_at timestamp without time zone NOT NULL,
    user_id bigint NOT NULL,
    key character varying NOT NULL,
    value character varying NOT NULL
);

CREATE SEQUENCE user_custom_attributes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_custom_attributes_id_seq OWNED BY user_custom_attributes.id;

CREATE TABLE user_details (
    user_id bigint NOT NULL,
    job_title character varying(200) DEFAULT ''::character varying NOT NULL,
    bio character varying(255) DEFAULT ''::character varying NOT NULL,
    webauthn_xid text,
    provisioned_by_group_id bigint,
    pronouns text,
    pronunciation text,
    registration_objective smallint,
    phone text,
    linkedin text DEFAULT ''::text NOT NULL,
    twitter text DEFAULT ''::text NOT NULL,
    skype text DEFAULT ''::text NOT NULL,
    website_url text DEFAULT ''::text NOT NULL,
    location text DEFAULT ''::text NOT NULL,
    organization text DEFAULT ''::text NOT NULL,
    password_last_changed_at timestamp with time zone DEFAULT now() NOT NULL,
    discord text DEFAULT ''::text NOT NULL,
    enterprise_group_id bigint,
    enterprise_group_associated_at timestamp with time zone,
    email_reset_offered_at timestamp with time zone,
    mastodon text DEFAULT ''::text NOT NULL,
    project_authorizations_recalculated_at timestamp with time zone DEFAULT '2010-01-01 00:00:00+00'::timestamp with time zone NOT NULL,
    onboarding_status jsonb DEFAULT '{}'::jsonb NOT NULL,
    bluesky text DEFAULT ''::text NOT NULL,
    bot_namespace_id bigint,
    CONSTRAINT check_18a53381cd CHECK ((char_length(bluesky) <= 256)),
    CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
    CONSTRAINT check_444573ee52 CHECK ((char_length(skype) <= 500)),
    CONSTRAINT check_466a25be35 CHECK ((char_length(twitter) <= 500)),
    CONSTRAINT check_4ef1de1a15 CHECK ((char_length(discord) <= 500)),
    CONSTRAINT check_7b246dad73 CHECK ((char_length(organization) <= 500)),
    CONSTRAINT check_7d6489f8f3 CHECK ((char_length(linkedin) <= 500)),
    CONSTRAINT check_7fe2044093 CHECK ((char_length(website_url) <= 500)),
    CONSTRAINT check_8a7fcf8a60 CHECK ((char_length(location) <= 500)),
    CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 50)),
    CONSTRAINT check_eeeaf8d4f0 CHECK ((char_length(pronouns) <= 50)),
    CONSTRAINT check_f1a8a05b9a CHECK ((char_length(mastodon) <= 500)),
    CONSTRAINT check_f932ed37db CHECK ((char_length(pronunciation) <= 255))
);

COMMENT ON COLUMN user_details.phone IS 'JiHu-specific column';

COMMENT ON COLUMN user_details.password_last_changed_at IS 'JiHu-specific column';

CREATE SEQUENCE user_details_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_details_user_id_seq OWNED BY user_details.user_id;

CREATE TABLE user_follow_users (
    follower_id bigint NOT NULL,
    followee_id bigint NOT NULL
);

CREATE TABLE user_group_callouts (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    group_id bigint NOT NULL,
    feature_name smallint NOT NULL,
    dismissed_at timestamp with time zone
);

CREATE SEQUENCE user_group_callouts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_group_callouts_id_seq OWNED BY user_group_callouts.id;

CREATE TABLE user_highest_roles (
    user_id bigint NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    highest_access_level integer
);

CREATE TABLE user_member_roles (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    member_role_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE user_member_roles_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_member_roles_id_seq OWNED BY user_member_roles.id;

CREATE TABLE user_namespace_callouts (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    dismissed_at timestamp with time zone,
    feature_name smallint NOT NULL
);

CREATE SEQUENCE user_namespace_callouts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_namespace_callouts_id_seq OWNED BY user_namespace_callouts.id;

CREATE TABLE user_permission_export_uploads (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    user_id bigint NOT NULL,
    file_store integer,
    status smallint DEFAULT 0 NOT NULL,
    file text,
    CONSTRAINT check_1956806648 CHECK ((char_length(file) <= 255))
);

CREATE SEQUENCE user_permission_export_uploads_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_permission_export_uploads_id_seq OWNED BY user_permission_export_uploads.id;

CREATE TABLE user_phone_number_validations (
    user_id bigint NOT NULL,
    validated_at timestamp with time zone,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    international_dial_code smallint NOT NULL,
    verification_attempts smallint DEFAULT 0 NOT NULL,
    risk_score smallint DEFAULT 0 NOT NULL,
    country text NOT NULL,
    phone_number text NOT NULL,
    telesign_reference_xid text,
    sms_sent_at timestamp with time zone,
    sms_send_count smallint DEFAULT 0 NOT NULL,
    CONSTRAINT check_193736da9f CHECK ((char_length(country) <= 3)),
    CONSTRAINT check_d2f31fc815 CHECK ((char_length(phone_number) <= 12)),
    CONSTRAINT check_d7af4d3eb5 CHECK ((char_length(telesign_reference_xid) <= 255))
);

CREATE TABLE user_preferences (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    issue_notes_filter smallint DEFAULT 0 NOT NULL,
    merge_request_notes_filter smallint DEFAULT 0 NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    epics_sort character varying,
    roadmap_epics_state integer,
    epic_notes_filter smallint DEFAULT 0 NOT NULL,
    issues_sort character varying,
    merge_requests_sort character varying,
    roadmaps_sort character varying,
    first_day_of_week integer,
    timezone character varying,
    time_display_relative boolean DEFAULT true,
    projects_sort character varying(64),
    show_whitespace_in_diffs boolean DEFAULT true NOT NULL,
    sourcegraph_enabled boolean,
    setup_for_company boolean,
    render_whitespace_in_code boolean DEFAULT false,
    tab_width smallint DEFAULT 8,
    view_diffs_file_by_file boolean DEFAULT false NOT NULL,
    gitpod_enabled boolean DEFAULT false NOT NULL,
    markdown_surround_selection boolean DEFAULT true NOT NULL,
    diffs_deletion_color text,
    diffs_addition_color text,
    markdown_automatic_lists boolean DEFAULT true NOT NULL,
    use_new_navigation boolean,
    achievements_enabled boolean DEFAULT true NOT NULL,
    pinned_nav_items jsonb DEFAULT '{}'::jsonb NOT NULL,
    pass_user_identities_to_ci_jwt boolean DEFAULT false NOT NULL,
    enabled_following boolean DEFAULT true NOT NULL,
    visibility_pipeline_id_type smallint DEFAULT 0 NOT NULL,
    project_shortcut_buttons boolean DEFAULT true NOT NULL,
    enabled_zoekt boolean DEFAULT true NOT NULL,
    keyboard_shortcuts_enabled boolean DEFAULT true NOT NULL,
    time_display_format smallint DEFAULT 0 NOT NULL,
    home_organization_id bigint,
    early_access_program_participant boolean DEFAULT false NOT NULL,
    early_access_program_tracking boolean DEFAULT false NOT NULL,
    extensions_marketplace_opt_in_status smallint DEFAULT 0 NOT NULL,
    organization_groups_projects_sort text,
    organization_groups_projects_display smallint DEFAULT 0 NOT NULL,
    dpop_enabled boolean DEFAULT false NOT NULL,
    use_work_items_view boolean DEFAULT false NOT NULL,
    text_editor_type smallint DEFAULT 0 NOT NULL,
    CONSTRAINT check_1d670edc68 CHECK ((time_display_relative IS NOT NULL)),
    CONSTRAINT check_89bf269f41 CHECK ((char_length(diffs_deletion_color) <= 7)),
    CONSTRAINT check_b1306f8875 CHECK ((char_length(organization_groups_projects_sort) <= 64)),
    CONSTRAINT check_b22446f91a CHECK ((render_whitespace_in_code IS NOT NULL)),
    CONSTRAINT check_d07ccd35f7 CHECK ((char_length(diffs_addition_color) <= 7)),
    CONSTRAINT check_d3248b1b9c CHECK ((tab_width IS NOT NULL))
);

CREATE SEQUENCE user_preferences_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_preferences_id_seq OWNED BY user_preferences.id;

CREATE TABLE user_project_callouts (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    project_id bigint NOT NULL,
    feature_name smallint NOT NULL,
    dismissed_at timestamp with time zone
);

CREATE SEQUENCE user_project_callouts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_project_callouts_id_seq OWNED BY user_project_callouts.id;

CREATE TABLE user_statuses (
    user_id bigint NOT NULL,
    cached_markdown_version integer,
    emoji character varying DEFAULT 'speech_balloon'::character varying NOT NULL,
    message character varying(100),
    message_html character varying,
    availability smallint DEFAULT 0 NOT NULL,
    clear_status_at timestamp with time zone
);

CREATE SEQUENCE user_statuses_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_statuses_user_id_seq OWNED BY user_statuses.user_id;

CREATE TABLE user_synced_attributes_metadata (
    id bigint NOT NULL,
    name_synced boolean DEFAULT false,
    email_synced boolean DEFAULT false,
    location_synced boolean DEFAULT false,
    user_id bigint NOT NULL,
    provider character varying
);

CREATE SEQUENCE user_synced_attributes_metadata_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE user_synced_attributes_metadata_id_seq OWNED BY user_synced_attributes_metadata.id;

CREATE SEQUENCE users_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE users_id_seq OWNED BY users.id;

CREATE TABLE users_ops_dashboard_projects (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    user_id bigint NOT NULL,
    project_id bigint NOT NULL
);

CREATE SEQUENCE users_ops_dashboard_projects_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE users_ops_dashboard_projects_id_seq OWNED BY users_ops_dashboard_projects.id;

CREATE TABLE users_security_dashboard_projects (
    user_id bigint NOT NULL,
    project_id bigint NOT NULL
);

CREATE TABLE users_star_projects (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    user_id bigint NOT NULL,
    created_at timestamp without time zone,
    updated_at timestamp without time zone
);

CREATE SEQUENCE users_star_projects_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE users_star_projects_id_seq OWNED BY users_star_projects.id;

CREATE TABLE users_statistics (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    without_groups_and_projects integer DEFAULT 0 NOT NULL,
    with_highest_role_guest integer DEFAULT 0 NOT NULL,
    with_highest_role_reporter integer DEFAULT 0 NOT NULL,
    with_highest_role_developer integer DEFAULT 0 NOT NULL,
    with_highest_role_maintainer integer DEFAULT 0 NOT NULL,
    with_highest_role_owner integer DEFAULT 0 NOT NULL,
    bots integer DEFAULT 0 NOT NULL,
    blocked integer DEFAULT 0 NOT NULL,
    with_highest_role_minimal_access integer DEFAULT 0 NOT NULL,
    with_highest_role_guest_with_custom_role integer DEFAULT 0 NOT NULL
);

CREATE SEQUENCE users_statistics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE users_statistics_id_seq OWNED BY users_statistics.id;

CREATE TABLE value_stream_dashboard_aggregations (
    namespace_id bigint NOT NULL,
    last_run_at timestamp with time zone,
    enabled boolean DEFAULT true NOT NULL
);

CREATE SEQUENCE value_stream_dashboard_counts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE value_stream_dashboard_counts_id_seq OWNED BY value_stream_dashboard_counts.id;

CREATE TABLE virtual_registries_packages_maven_cached_responses (
    id bigint NOT NULL,
    group_id bigint NOT NULL,
    upstream_id bigint,
    upstream_checked_at timestamp with time zone DEFAULT now() NOT NULL,
    downloaded_at timestamp with time zone DEFAULT now() NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    file_store integer DEFAULT 1 NOT NULL,
    size integer NOT NULL,
    downloads_count integer DEFAULT 1 NOT NULL,
    relative_path text NOT NULL,
    file text NOT NULL,
    object_storage_key text NOT NULL,
    upstream_etag text,
    content_type text DEFAULT 'application/octet-stream'::text NOT NULL,
    status smallint DEFAULT 0 NOT NULL,
    file_final_path text,
    file_md5 bytea,
    file_sha1 bytea NOT NULL,
    CONSTRAINT check_28c64d513d CHECK ((char_length(object_storage_key) <= 255)),
    CONSTRAINT check_30b7e853d9 CHECK ((char_length(upstream_etag) <= 255)),
    CONSTRAINT check_3f121b03fd CHECK ((char_length(file_final_path) <= 1024)),
    CONSTRAINT check_68b105cda6 CHECK ((char_length(file) <= 255)),
    CONSTRAINT check_731cd48dbf CHECK ((char_length(content_type) <= 255)),
    CONSTRAINT check_c2aad543bf CHECK ((downloads_count > 0)),
    CONSTRAINT check_d35a8e931f CHECK ((char_length(relative_path) <= 255))
);

CREATE SEQUENCE virtual_registries_packages_maven_cached_responses_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE virtual_registries_packages_maven_cached_responses_id_seq OWNED BY virtual_registries_packages_maven_cached_responses.id;

CREATE TABLE virtual_registries_packages_maven_registries (
    id bigint NOT NULL,
    group_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    cache_validity_hours smallint DEFAULT 1 NOT NULL,
    CONSTRAINT check_b3fbe8eb62 CHECK ((cache_validity_hours >= 0))
);

CREATE SEQUENCE virtual_registries_packages_maven_registries_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE virtual_registries_packages_maven_registries_id_seq OWNED BY virtual_registries_packages_maven_registries.id;

CREATE TABLE virtual_registries_packages_maven_registry_upstreams (
    id bigint NOT NULL,
    group_id bigint NOT NULL,
    registry_id bigint NOT NULL,
    upstream_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE virtual_registries_packages_maven_registry_upstreams_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE virtual_registries_packages_maven_registry_upstreams_id_seq OWNED BY virtual_registries_packages_maven_registry_upstreams.id;

CREATE TABLE virtual_registries_packages_maven_upstreams (
    id bigint NOT NULL,
    group_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    url text NOT NULL,
    encrypted_credentials bytea,
    encrypted_credentials_iv bytea,
    cache_validity_hours smallint DEFAULT 24 NOT NULL,
    CONSTRAINT check_26c0572777 CHECK ((char_length(url) <= 255)),
    CONSTRAINT check_4af2999ab8 CHECK ((octet_length(encrypted_credentials_iv) <= 1020)),
    CONSTRAINT check_a3593dca3a CHECK ((cache_validity_hours >= 0)),
    CONSTRAINT check_b9e3bfa31a CHECK ((octet_length(encrypted_credentials) <= 1020))
);

CREATE SEQUENCE virtual_registries_packages_maven_upstreams_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE virtual_registries_packages_maven_upstreams_id_seq OWNED BY virtual_registries_packages_maven_upstreams.id;

CREATE TABLE vs_code_settings (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    setting_type text NOT NULL,
    content text NOT NULL,
    uuid uuid,
    version integer DEFAULT 0,
    settings_context_hash text,
    CONSTRAINT check_2082c35541 CHECK ((version IS NOT NULL)),
    CONSTRAINT check_4680ca265d CHECK ((uuid IS NOT NULL)),
    CONSTRAINT check_5da3b2910b CHECK ((char_length(content) <= 524288)),
    CONSTRAINT check_6d5f15039b CHECK ((char_length(settings_context_hash) <= 255)),
    CONSTRAINT check_994c503fc4 CHECK ((char_length(setting_type) <= 256))
);

CREATE SEQUENCE vs_code_settings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vs_code_settings_id_seq OWNED BY vs_code_settings.id;

CREATE TABLE vulnerabilities (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    author_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    title character varying(255) NOT NULL,
    title_html text,
    description text,
    description_html text,
    state smallint DEFAULT 1 NOT NULL,
    severity smallint NOT NULL,
    severity_overridden boolean DEFAULT false,
    confidence smallint,
    confidence_overridden boolean DEFAULT false,
    resolved_by_id bigint,
    resolved_at timestamp with time zone,
    report_type smallint NOT NULL,
    cached_markdown_version integer,
    confirmed_by_id bigint,
    confirmed_at timestamp with time zone,
    dismissed_at timestamp with time zone,
    dismissed_by_id bigint,
    resolved_on_default_branch boolean DEFAULT false NOT NULL,
    present_on_default_branch boolean DEFAULT true NOT NULL,
    detected_at timestamp with time zone DEFAULT now(),
    finding_id bigint,
    cvss jsonb DEFAULT '[]'::jsonb,
    auto_resolved boolean DEFAULT false NOT NULL,
    CONSTRAINT check_4d8a873f1f CHECK ((finding_id IS NOT NULL))
);

CREATE SEQUENCE vulnerabilities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerabilities_id_seq OWNED BY vulnerabilities.id;

CREATE TABLE vulnerability_export_parts (
    id bigint NOT NULL,
    vulnerability_export_id bigint NOT NULL,
    start_id bigint NOT NULL,
    end_id bigint NOT NULL,
    organization_id bigint NOT NULL,
    file_store integer,
    file text,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    CONSTRAINT check_baded21d39 CHECK ((char_length(file) <= 255))
);

CREATE SEQUENCE vulnerability_export_parts_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_export_parts_id_seq OWNED BY vulnerability_export_parts.id;

CREATE TABLE vulnerability_exports (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    started_at timestamp with time zone,
    finished_at timestamp with time zone,
    status character varying(255) NOT NULL,
    file character varying(255),
    project_id bigint,
    author_id bigint NOT NULL,
    file_store integer,
    format smallint DEFAULT 0 NOT NULL,
    group_id bigint,
    organization_id bigint NOT NULL
);

CREATE SEQUENCE vulnerability_exports_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_exports_id_seq OWNED BY vulnerability_exports.id;

CREATE TABLE vulnerability_external_issue_links (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    author_id bigint NOT NULL,
    vulnerability_id bigint NOT NULL,
    link_type smallint DEFAULT 1 NOT NULL,
    external_type smallint DEFAULT 1 NOT NULL,
    external_project_key text NOT NULL,
    external_issue_key text NOT NULL,
    project_id bigint,
    CONSTRAINT check_3200604f5e CHECK ((char_length(external_issue_key) <= 255)),
    CONSTRAINT check_68cffd19b0 CHECK ((char_length(external_project_key) <= 255))
);

CREATE SEQUENCE vulnerability_external_issue_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_external_issue_links_id_seq OWNED BY vulnerability_external_issue_links.id;

CREATE TABLE vulnerability_feedback (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    feedback_type smallint NOT NULL,
    category smallint NOT NULL,
    project_id bigint NOT NULL,
    author_id bigint NOT NULL,
    issue_id bigint,
    project_fingerprint character varying(40) NOT NULL,
    merge_request_id bigint,
    comment_author_id bigint,
    comment text,
    comment_timestamp timestamp with time zone,
    finding_uuid uuid,
    dismissal_reason smallint,
    migrated_to_state_transition boolean DEFAULT false,
    pipeline_id bigint
);

CREATE SEQUENCE vulnerability_feedback_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id;

CREATE TABLE vulnerability_finding_evidences (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    vulnerability_occurrence_id bigint NOT NULL,
    data jsonb DEFAULT '{}'::jsonb NOT NULL,
    project_id bigint
);

CREATE SEQUENCE vulnerability_finding_evidences_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_finding_evidences_id_seq OWNED BY vulnerability_finding_evidences.id;

CREATE TABLE vulnerability_finding_links (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    vulnerability_occurrence_id bigint NOT NULL,
    name text,
    url text NOT NULL,
    project_id bigint,
    CONSTRAINT check_55f0a95439 CHECK ((char_length(name) <= 255)),
    CONSTRAINT check_b7fe886df6 CHECK ((char_length(url) <= 2048))
);

CREATE SEQUENCE vulnerability_finding_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_finding_links_id_seq OWNED BY vulnerability_finding_links.id;

CREATE TABLE vulnerability_finding_signatures (
    id bigint NOT NULL,
    finding_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    algorithm_type smallint NOT NULL,
    signature_sha bytea NOT NULL,
    project_id bigint
);

CREATE SEQUENCE vulnerability_finding_signatures_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_finding_signatures_id_seq OWNED BY vulnerability_finding_signatures.id;

CREATE TABLE vulnerability_findings_remediations (
    id bigint NOT NULL,
    vulnerability_occurrence_id bigint,
    vulnerability_remediation_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint
);

CREATE SEQUENCE vulnerability_findings_remediations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_findings_remediations_id_seq OWNED BY vulnerability_findings_remediations.id;

CREATE TABLE vulnerability_flags (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    vulnerability_occurrence_id bigint NOT NULL,
    flag_type smallint DEFAULT 0 NOT NULL,
    origin text NOT NULL,
    description text NOT NULL,
    project_id bigint,
    CONSTRAINT check_45e743349f CHECK ((char_length(description) <= 1024)),
    CONSTRAINT check_49c1d00032 CHECK ((char_length(origin) <= 255))
);

CREATE SEQUENCE vulnerability_flags_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_flags_id_seq OWNED BY vulnerability_flags.id;

CREATE TABLE vulnerability_historical_statistics (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    total integer DEFAULT 0 NOT NULL,
    critical integer DEFAULT 0 NOT NULL,
    high integer DEFAULT 0 NOT NULL,
    medium integer DEFAULT 0 NOT NULL,
    low integer DEFAULT 0 NOT NULL,
    unknown integer DEFAULT 0 NOT NULL,
    info integer DEFAULT 0 NOT NULL,
    date date NOT NULL,
    letter_grade smallint NOT NULL
);

CREATE SEQUENCE vulnerability_historical_statistics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_historical_statistics_id_seq OWNED BY vulnerability_historical_statistics.id;

CREATE TABLE vulnerability_identifiers (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    fingerprint bytea NOT NULL,
    external_type character varying NOT NULL,
    external_id character varying NOT NULL,
    name character varying NOT NULL,
    url text
);

CREATE SEQUENCE vulnerability_identifiers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_identifiers_id_seq OWNED BY vulnerability_identifiers.id;

CREATE TABLE vulnerability_issue_links (
    id bigint NOT NULL,
    vulnerability_id bigint NOT NULL,
    issue_id bigint NOT NULL,
    link_type smallint DEFAULT 1 NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint
);

CREATE SEQUENCE vulnerability_issue_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_issue_links_id_seq OWNED BY vulnerability_issue_links.id;

CREATE TABLE vulnerability_management_policy_rules (
    id bigint NOT NULL,
    security_policy_id bigint NOT NULL,
    security_policy_management_project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    rule_index smallint NOT NULL,
    type smallint NOT NULL,
    content jsonb DEFAULT '{}'::jsonb NOT NULL
);

CREATE SEQUENCE vulnerability_management_policy_rules_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_management_policy_rules_id_seq OWNED BY vulnerability_management_policy_rules.id;

CREATE TABLE vulnerability_merge_request_links (
    id bigint NOT NULL,
    vulnerability_id bigint NOT NULL,
    merge_request_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint
);

CREATE SEQUENCE vulnerability_merge_request_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_merge_request_links_id_seq OWNED BY vulnerability_merge_request_links.id;

CREATE TABLE vulnerability_namespace_historical_statistics (
    id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    traversal_ids bigint[] DEFAULT '{}'::bigint[] NOT NULL,
    total integer DEFAULT 0 NOT NULL,
    critical integer DEFAULT 0 NOT NULL,
    high integer DEFAULT 0 NOT NULL,
    medium integer DEFAULT 0 NOT NULL,
    low integer DEFAULT 0 NOT NULL,
    unknown integer DEFAULT 0 NOT NULL,
    info integer DEFAULT 0 NOT NULL,
    date date NOT NULL,
    letter_grade smallint NOT NULL,
    migrating boolean DEFAULT false NOT NULL
);

CREATE SEQUENCE vulnerability_namespace_historical_statistics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_namespace_historical_statistics_id_seq OWNED BY vulnerability_namespace_historical_statistics.id;

CREATE TABLE vulnerability_occurrence_identifiers (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    occurrence_id bigint NOT NULL,
    identifier_id bigint NOT NULL,
    project_id bigint
);

CREATE SEQUENCE vulnerability_occurrence_identifiers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_occurrence_identifiers_id_seq OWNED BY vulnerability_occurrence_identifiers.id;

CREATE TABLE vulnerability_occurrences (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    severity smallint NOT NULL,
    report_type smallint NOT NULL,
    project_id bigint NOT NULL,
    scanner_id bigint NOT NULL,
    primary_identifier_id bigint NOT NULL,
    project_fingerprint bytea NOT NULL,
    location_fingerprint bytea NOT NULL,
    name character varying NOT NULL,
    metadata_version character varying NOT NULL,
    raw_metadata text NOT NULL,
    vulnerability_id bigint,
    details jsonb DEFAULT '{}'::jsonb NOT NULL,
    description text,
    solution text,
    cve text,
    location jsonb,
    detection_method smallint DEFAULT 0 NOT NULL,
    uuid uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL,
    initial_pipeline_id bigint,
    latest_pipeline_id bigint,
    CONSTRAINT check_4a3a60f2ba CHECK ((char_length(solution) <= 7000)),
    CONSTRAINT check_ade261da6b CHECK ((char_length(description) <= 15000)),
    CONSTRAINT check_f602da68dd CHECK ((char_length(cve) <= 48400))
);

CREATE SEQUENCE vulnerability_occurrences_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_occurrences_id_seq OWNED BY vulnerability_occurrences.id;

CREATE TABLE vulnerability_reads (
    id bigint NOT NULL,
    vulnerability_id bigint NOT NULL,
    project_id bigint NOT NULL,
    scanner_id bigint NOT NULL,
    report_type smallint NOT NULL,
    severity smallint NOT NULL,
    state smallint NOT NULL,
    has_issues boolean DEFAULT false NOT NULL,
    resolved_on_default_branch boolean DEFAULT false NOT NULL,
    uuid uuid NOT NULL,
    location_image text,
    cluster_agent_id text,
    casted_cluster_agent_id bigint,
    dismissal_reason smallint,
    has_merge_request boolean DEFAULT false,
    has_remediations boolean DEFAULT false NOT NULL,
    owasp_top_10 smallint DEFAULT '-1'::integer,
    traversal_ids bigint[] DEFAULT '{}'::bigint[],
    archived boolean DEFAULT false NOT NULL,
    identifier_names text[] DEFAULT '{}'::text[] NOT NULL,
    has_vulnerability_resolution boolean DEFAULT false,
    auto_resolved boolean DEFAULT false NOT NULL,
    CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048)),
    CONSTRAINT check_4b1a1bf5ea CHECK ((has_merge_request IS NOT NULL)),
    CONSTRAINT check_a105eb825a CHECK ((char_length(cluster_agent_id) <= 10)),
    CONSTRAINT check_f5ba7c2496 CHECK ((traversal_ids IS NOT NULL))
);

CREATE SEQUENCE vulnerability_reads_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_reads_id_seq OWNED BY vulnerability_reads.id;

CREATE TABLE vulnerability_remediations (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    file_store smallint,
    summary text NOT NULL,
    file text NOT NULL,
    checksum bytea NOT NULL,
    project_id bigint NOT NULL,
    CONSTRAINT check_ac0ccabff3 CHECK ((char_length(summary) <= 200)),
    CONSTRAINT check_fe3325e3ba CHECK ((char_length(file) <= 255))
);

COMMENT ON COLUMN vulnerability_remediations.checksum IS 'Stores the SHA256 checksum of the attached diff file';

CREATE SEQUENCE vulnerability_remediations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_remediations_id_seq OWNED BY vulnerability_remediations.id;

CREATE TABLE vulnerability_representation_information (
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    vulnerability_id bigint NOT NULL,
    project_id bigint NOT NULL,
    resolved_in_commit_sha bytea
);

CREATE TABLE vulnerability_scanners (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    external_id character varying NOT NULL,
    name character varying NOT NULL,
    vendor text DEFAULT 'GitLab'::text NOT NULL
);

CREATE SEQUENCE vulnerability_scanners_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_scanners_id_seq OWNED BY vulnerability_scanners.id;

CREATE TABLE vulnerability_state_transitions (
    id bigint NOT NULL,
    vulnerability_id bigint NOT NULL,
    to_state smallint NOT NULL,
    from_state smallint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    author_id bigint,
    comment text,
    dismissal_reason smallint,
    project_id bigint,
    CONSTRAINT check_fe2eb6a0f3 CHECK ((char_length(comment) <= 50000))
);

CREATE SEQUENCE vulnerability_state_transitions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_state_transitions_id_seq OWNED BY vulnerability_state_transitions.id;

CREATE TABLE vulnerability_statistics (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    total integer DEFAULT 0 NOT NULL,
    critical integer DEFAULT 0 NOT NULL,
    high integer DEFAULT 0 NOT NULL,
    medium integer DEFAULT 0 NOT NULL,
    low integer DEFAULT 0 NOT NULL,
    unknown integer DEFAULT 0 NOT NULL,
    info integer DEFAULT 0 NOT NULL,
    letter_grade smallint NOT NULL,
    latest_pipeline_id bigint
);

CREATE SEQUENCE vulnerability_statistics_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_statistics_id_seq OWNED BY vulnerability_statistics.id;

CREATE TABLE vulnerability_user_mentions (
    id bigint NOT NULL,
    vulnerability_id bigint NOT NULL,
    mentioned_users_ids bigint[],
    mentioned_projects_ids bigint[],
    mentioned_groups_ids bigint[],
    note_id bigint,
    project_id bigint
);

CREATE SEQUENCE vulnerability_user_mentions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE vulnerability_user_mentions_id_seq OWNED BY vulnerability_user_mentions.id;

CREATE SEQUENCE web_hook_logs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE web_hook_logs_id_seq OWNED BY web_hook_logs.id;

CREATE TABLE web_hooks (
    id bigint NOT NULL,
    project_id bigint,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    type character varying DEFAULT 'ProjectHook'::character varying,
    push_events boolean DEFAULT true NOT NULL,
    issues_events boolean DEFAULT false NOT NULL,
    merge_requests_events boolean DEFAULT false NOT NULL,
    tag_push_events boolean DEFAULT false,
    group_id bigint,
    note_events boolean DEFAULT false NOT NULL,
    enable_ssl_verification boolean DEFAULT true,
    wiki_page_events boolean DEFAULT false NOT NULL,
    pipeline_events boolean DEFAULT false NOT NULL,
    confidential_issues_events boolean DEFAULT false NOT NULL,
    repository_update_events boolean DEFAULT false NOT NULL,
    job_events boolean DEFAULT false NOT NULL,
    confidential_note_events boolean,
    push_events_branch_filter text,
    encrypted_token character varying,
    encrypted_token_iv character varying,
    encrypted_url character varying,
    encrypted_url_iv character varying,
    deployment_events boolean DEFAULT false NOT NULL,
    releases_events boolean DEFAULT false NOT NULL,
    feature_flag_events boolean DEFAULT false NOT NULL,
    member_events boolean DEFAULT false NOT NULL,
    subgroup_events boolean DEFAULT false NOT NULL,
    recent_failures smallint DEFAULT 0 NOT NULL,
    backoff_count smallint DEFAULT 0 NOT NULL,
    disabled_until timestamp with time zone,
    encrypted_url_variables bytea,
    encrypted_url_variables_iv bytea,
    integration_id bigint,
    branch_filter_strategy smallint DEFAULT 0 NOT NULL,
    emoji_events boolean DEFAULT false NOT NULL,
    name text,
    description text,
    custom_webhook_template text,
    resource_access_token_events boolean DEFAULT false NOT NULL,
    encrypted_custom_headers bytea,
    encrypted_custom_headers_iv bytea,
    project_events boolean DEFAULT false NOT NULL,
    CONSTRAINT check_1e4d5cbdc5 CHECK ((char_length(name) <= 255)),
    CONSTRAINT check_23a96ad211 CHECK ((char_length(description) <= 2048)),
    CONSTRAINT check_69ef76ee0c CHECK ((char_length(custom_webhook_template) <= 4096))
);

CREATE SEQUENCE web_hooks_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE web_hooks_id_seq OWNED BY web_hooks.id;

CREATE TABLE webauthn_registrations (
    id bigint NOT NULL,
    user_id bigint NOT NULL,
    counter bigint DEFAULT 0 NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    credential_xid text NOT NULL,
    name text NOT NULL,
    public_key text NOT NULL,
    CONSTRAINT check_2f02e74321 CHECK ((char_length(name) <= 255)),
    CONSTRAINT check_f5ab2b551a CHECK ((char_length(credential_xid) <= 1364))
);

CREATE SEQUENCE webauthn_registrations_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE webauthn_registrations_id_seq OWNED BY webauthn_registrations.id;

CREATE TABLE wiki_page_meta (
    id bigint NOT NULL,
    project_id bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    title character varying(255) NOT NULL,
    namespace_id bigint,
    CONSTRAINT check_d858755109 CHECK ((num_nonnulls(namespace_id, project_id) = 1))
);

CREATE SEQUENCE wiki_page_meta_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE wiki_page_meta_id_seq OWNED BY wiki_page_meta.id;

CREATE TABLE wiki_page_meta_user_mentions (
    id bigint NOT NULL,
    wiki_page_meta_id bigint NOT NULL,
    note_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    mentioned_users_ids bigint[],
    mentioned_projects_ids bigint[],
    mentioned_groups_ids bigint[]
);

CREATE SEQUENCE wiki_page_meta_user_mentions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE wiki_page_meta_user_mentions_id_seq OWNED BY wiki_page_meta_user_mentions.id;

CREATE TABLE wiki_page_slugs (
    id bigint NOT NULL,
    canonical boolean DEFAULT false NOT NULL,
    wiki_page_meta_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    slug character varying(2048) NOT NULL,
    project_id bigint
);

CREATE SEQUENCE wiki_page_slugs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE wiki_page_slugs_id_seq OWNED BY wiki_page_slugs.id;

CREATE TABLE wiki_repository_states (
    id bigint NOT NULL,
    verification_started_at timestamp with time zone,
    verification_retry_at timestamp with time zone,
    verified_at timestamp with time zone,
    project_wiki_repository_id bigint NOT NULL,
    verification_state smallint DEFAULT 0 NOT NULL,
    verification_retry_count smallint,
    verification_checksum bytea,
    verification_failure text,
    project_id bigint,
    CONSTRAINT check_2933ff60dc CHECK ((char_length(verification_failure) <= 255))
);

CREATE SEQUENCE wiki_repository_states_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE wiki_repository_states_id_seq OWNED BY wiki_repository_states.id;

CREATE TABLE work_item_colors (
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    issue_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    color text NOT NULL,
    CONSTRAINT check_485e19ad7b CHECK ((char_length(color) <= 7))
);

CREATE TABLE work_item_dates_sources (
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    issue_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    start_date_is_fixed boolean DEFAULT false NOT NULL,
    due_date_is_fixed boolean DEFAULT false NOT NULL,
    start_date date,
    due_date date,
    start_date_sourcing_work_item_id bigint,
    start_date_sourcing_milestone_id bigint,
    due_date_sourcing_work_item_id bigint,
    due_date_sourcing_milestone_id bigint,
    start_date_fixed date,
    due_date_fixed date
);

CREATE TABLE work_item_hierarchy_restrictions (
    id bigint NOT NULL,
    parent_type_id bigint NOT NULL,
    child_type_id bigint NOT NULL,
    maximum_depth smallint,
    cross_hierarchy_enabled boolean DEFAULT false NOT NULL
);

CREATE SEQUENCE work_item_hierarchy_restrictions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE work_item_hierarchy_restrictions_id_seq OWNED BY work_item_hierarchy_restrictions.id;

CREATE TABLE work_item_parent_links (
    id bigint NOT NULL,
    work_item_id bigint NOT NULL,
    work_item_parent_id bigint NOT NULL,
    relative_position integer,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    namespace_id bigint
);

CREATE SEQUENCE work_item_parent_links_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE work_item_parent_links_id_seq OWNED BY work_item_parent_links.id;

CREATE TABLE work_item_progresses (
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    issue_id bigint NOT NULL,
    progress smallint DEFAULT 0 NOT NULL,
    start_value double precision DEFAULT 0.0 NOT NULL,
    end_value double precision DEFAULT 100.0 NOT NULL,
    current_value double precision DEFAULT 0.0 NOT NULL,
    rollup_progress boolean DEFAULT true NOT NULL,
    reminder_frequency smallint DEFAULT 0 NOT NULL,
    last_reminder_sent_at timestamp with time zone
);

CREATE TABLE work_item_related_link_restrictions (
    id bigint NOT NULL,
    source_type_id bigint NOT NULL,
    target_type_id bigint NOT NULL,
    link_type smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE work_item_related_link_restrictions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE work_item_related_link_restrictions_id_seq OWNED BY work_item_related_link_restrictions.id;

CREATE TABLE work_item_type_custom_fields (
    id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    custom_field_id bigint NOT NULL,
    work_item_type_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE SEQUENCE work_item_type_custom_fields_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE work_item_type_custom_fields_id_seq OWNED BY work_item_type_custom_fields.id;

CREATE TABLE work_item_types (
    id bigint NOT NULL,
    base_type smallint DEFAULT 0 NOT NULL,
    cached_markdown_version integer,
    name text NOT NULL,
    description text,
    description_html text,
    icon_name text,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    correct_id bigint DEFAULT 0 NOT NULL,
    old_id bigint,
    CONSTRAINT check_104d2410f6 CHECK ((char_length(name) <= 255)),
    CONSTRAINT check_fecb3a98d1 CHECK ((char_length(icon_name) <= 255))
);

CREATE SEQUENCE work_item_types_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE work_item_types_id_seq OWNED BY work_item_types.id;

CREATE TABLE work_item_weights_sources (
    work_item_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    rolled_up_weight bigint,
    rolled_up_completed_weight bigint,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);

CREATE TABLE work_item_widget_definitions (
    id bigint NOT NULL,
    work_item_type_id bigint NOT NULL,
    widget_type smallint NOT NULL,
    disabled boolean DEFAULT false,
    name text,
    widget_options jsonb,
    CONSTRAINT check_050f2e2328 CHECK ((char_length(name) <= 255))
);

CREATE SEQUENCE work_item_widget_definitions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE work_item_widget_definitions_id_seq OWNED BY work_item_widget_definitions.id;

CREATE TABLE workspace_variables (
    id bigint NOT NULL,
    workspace_id bigint NOT NULL,
    variable_type smallint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    key text NOT NULL,
    encrypted_value bytea NOT NULL,
    encrypted_value_iv bytea NOT NULL,
    project_id bigint,
    CONSTRAINT check_5545042100 CHECK ((char_length(key) <= 255))
);

CREATE SEQUENCE workspace_variables_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE workspace_variables_id_seq OWNED BY workspace_variables.id;

CREATE TABLE workspaces (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    user_id bigint NOT NULL,
    project_id bigint NOT NULL,
    cluster_agent_id bigint NOT NULL,
    desired_state_updated_at timestamp with time zone NOT NULL,
    responded_to_agent_at timestamp with time zone,
    max_hours_before_termination smallint NOT NULL,
    name text NOT NULL,
    namespace text NOT NULL,
    desired_state text NOT NULL,
    actual_state text NOT NULL,
    devfile_ref text NOT NULL,
    devfile_path text NOT NULL,
    devfile text,
    processed_devfile text,
    url text,
    deployment_resource_version text,
    personal_access_token_id bigint,
    force_include_all_resources boolean DEFAULT true NOT NULL,
    url_prefix text,
    url_query_string text,
    workspaces_agent_config_version integer NOT NULL,
    desired_config_generator_version integer DEFAULT 1,
    CONSTRAINT check_15543fb0fa CHECK ((char_length(name) <= 64)),
    CONSTRAINT check_157d5f955c CHECK ((char_length(namespace) <= 64)),
    CONSTRAINT check_2b401b0034 CHECK ((char_length(deployment_resource_version) <= 64)),
    CONSTRAINT check_35e31ca320 CHECK ((desired_config_generator_version IS NOT NULL)),
    CONSTRAINT check_77d1a2ff50 CHECK ((char_length(processed_devfile) <= 65535)),
    CONSTRAINT check_8a0ab61b6b CHECK ((char_length(url_query_string) <= 256)),
    CONSTRAINT check_8e363ee3ad CHECK ((char_length(devfile_ref) <= 256)),
    CONSTRAINT check_8e4db5ffc2 CHECK ((char_length(actual_state) <= 32)),
    CONSTRAINT check_9e42558c35 CHECK ((char_length(url) <= 1024)),
    CONSTRAINT check_b70eddcbc1 CHECK ((char_length(desired_state) <= 32)),
    CONSTRAINT check_dc58d56169 CHECK ((char_length(devfile_path) <= 2048)),
    CONSTRAINT check_eb32879a3d CHECK ((char_length(devfile) <= 65535)),
    CONSTRAINT check_ffa8cad434 CHECK ((char_length(url_prefix) <= 256))
);

CREATE TABLE workspaces_agent_config_versions (
    id bigint NOT NULL,
    created_at timestamp with time zone,
    project_id bigint NOT NULL,
    item_id bigint NOT NULL,
    event text NOT NULL,
    whodunnit text,
    item_type text NOT NULL,
    object jsonb,
    object_changes jsonb,
    CONSTRAINT check_1ad0ae8926 CHECK ((char_length(whodunnit) <= 255)),
    CONSTRAINT check_a7055791ff CHECK ((char_length(event) <= 20)),
    CONSTRAINT check_ed1b796ddc CHECK ((char_length(item_type) <= 255))
);

CREATE SEQUENCE workspaces_agent_config_versions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE workspaces_agent_config_versions_id_seq OWNED BY workspaces_agent_config_versions.id;

CREATE TABLE workspaces_agent_configs (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    cluster_agent_id bigint NOT NULL,
    workspaces_quota bigint DEFAULT '-1'::integer NOT NULL,
    workspaces_per_user_quota bigint DEFAULT '-1'::integer NOT NULL,
    project_id bigint NOT NULL,
    default_max_hours_before_termination smallint DEFAULT 24 NOT NULL,
    max_hours_before_termination_limit smallint DEFAULT 120 NOT NULL,
    enabled boolean NOT NULL,
    network_policy_enabled boolean DEFAULT true NOT NULL,
    dns_zone text NOT NULL,
    gitlab_workspaces_proxy_namespace text DEFAULT 'gitlab-workspaces'::text NOT NULL,
    network_policy_egress jsonb DEFAULT '[{"allow": "0.0.0.0/0", "except": ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]}]'::jsonb NOT NULL,
    default_resources_per_workspace_container jsonb DEFAULT '{}'::jsonb NOT NULL,
    max_resources_per_workspace jsonb DEFAULT '{}'::jsonb NOT NULL,
    allow_privilege_escalation boolean DEFAULT false NOT NULL,
    use_kubernetes_user_namespaces boolean DEFAULT false NOT NULL,
    default_runtime_class text DEFAULT ''::text NOT NULL,
    annotations jsonb DEFAULT '{}'::jsonb NOT NULL,
    labels jsonb DEFAULT '{}'::jsonb NOT NULL,
    image_pull_secrets jsonb DEFAULT '[]'::jsonb NOT NULL,
    max_active_hours_before_stop smallint DEFAULT 36 NOT NULL,
    max_stopped_hours_before_termination smallint DEFAULT 744 NOT NULL,
    CONSTRAINT check_557e75a230 CHECK ((max_stopped_hours_before_termination > 0)),
    CONSTRAINT check_58759a890a CHECK ((char_length(dns_zone) <= 256)),
    CONSTRAINT check_6d7baef494 CHECK (((max_active_hours_before_stop + max_stopped_hours_before_termination) <= 8760)),
    CONSTRAINT check_720388a28c CHECK ((char_length(default_runtime_class) <= 253)),
    CONSTRAINT check_dca877fba1 CHECK ((default_max_hours_before_termination <= 8760)),
    CONSTRAINT check_df26c047a9 CHECK ((max_active_hours_before_stop > 0)),
    CONSTRAINT check_eab6e375ad CHECK ((max_hours_before_termination_limit <= 8760)),
    CONSTRAINT check_ee2464835c CHECK ((char_length(gitlab_workspaces_proxy_namespace) <= 63))
);

CREATE SEQUENCE workspaces_agent_configs_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE workspaces_agent_configs_id_seq OWNED BY workspaces_agent_configs.id;

CREATE SEQUENCE workspaces_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE workspaces_id_seq OWNED BY workspaces.id;

CREATE TABLE x509_certificates (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    subject_key_identifier character varying(255) NOT NULL,
    subject character varying(512),
    email character varying(255) NOT NULL,
    serial_number bytea NOT NULL,
    certificate_status smallint DEFAULT 0 NOT NULL,
    x509_issuer_id bigint NOT NULL,
    emails character varying[] DEFAULT '{}'::character varying[] NOT NULL
);

CREATE SEQUENCE x509_certificates_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE x509_certificates_id_seq OWNED BY x509_certificates.id;

CREATE TABLE x509_commit_signatures (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    project_id bigint NOT NULL,
    x509_certificate_id bigint NOT NULL,
    commit_sha bytea NOT NULL,
    verification_status smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE x509_commit_signatures_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE x509_commit_signatures_id_seq OWNED BY x509_commit_signatures.id;

CREATE TABLE x509_issuers (
    id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    subject_key_identifier character varying(255) NOT NULL,
    subject character varying(255),
    crl_url character varying(255)
);

CREATE SEQUENCE x509_issuers_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE x509_issuers_id_seq OWNED BY x509_issuers.id;

CREATE TABLE xray_reports (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    lang text NOT NULL,
    payload jsonb NOT NULL,
    file_checksum bytea,
    CONSTRAINT check_6da5a3b473 CHECK ((char_length(lang) <= 255))
);

CREATE SEQUENCE xray_reports_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE xray_reports_id_seq OWNED BY xray_reports.id;

CREATE TABLE zentao_tracker_data (
    id bigint NOT NULL,
    integration_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    encrypted_url bytea,
    encrypted_url_iv bytea,
    encrypted_api_url bytea,
    encrypted_api_url_iv bytea,
    encrypted_zentao_product_xid bytea,
    encrypted_zentao_product_xid_iv bytea,
    encrypted_api_token bytea,
    encrypted_api_token_iv bytea
);

CREATE SEQUENCE zentao_tracker_data_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zentao_tracker_data_id_seq OWNED BY zentao_tracker_data.id;

CREATE TABLE zoekt_enabled_namespaces (
    id bigint NOT NULL,
    root_namespace_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    search boolean DEFAULT true NOT NULL
);

CREATE SEQUENCE zoekt_enabled_namespaces_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zoekt_enabled_namespaces_id_seq OWNED BY zoekt_enabled_namespaces.id;

CREATE TABLE zoekt_indices (
    id bigint NOT NULL,
    zoekt_enabled_namespace_id bigint,
    zoekt_node_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    state smallint DEFAULT 0 NOT NULL,
    zoekt_replica_id bigint,
    reserved_storage_bytes bigint DEFAULT '10737418240'::bigint,
    used_storage_bytes bigint DEFAULT 0 NOT NULL,
    watermark_level smallint DEFAULT 0 NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL
);

CREATE SEQUENCE zoekt_indices_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zoekt_indices_id_seq OWNED BY zoekt_indices.id;

CREATE TABLE zoekt_nodes (
    id bigint NOT NULL,
    uuid uuid NOT NULL,
    used_bytes bigint DEFAULT 0 NOT NULL,
    total_bytes bigint DEFAULT 0 NOT NULL,
    last_seen_at timestamp with time zone DEFAULT '1970-01-01 00:00:00+00'::timestamp with time zone NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    index_base_url text NOT NULL,
    search_base_url text NOT NULL,
    metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
    indexed_bytes bigint DEFAULT 0 NOT NULL,
    CONSTRAINT check_32f39efba3 CHECK ((char_length(search_base_url) <= 1024)),
    CONSTRAINT check_38c354a3c2 CHECK ((char_length(index_base_url) <= 1024))
);

CREATE SEQUENCE zoekt_nodes_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zoekt_nodes_id_seq OWNED BY zoekt_nodes.id;

CREATE TABLE zoekt_replicas (
    id bigint NOT NULL,
    zoekt_enabled_namespace_id bigint NOT NULL,
    namespace_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    state smallint DEFAULT 0 NOT NULL
);

CREATE SEQUENCE zoekt_replicas_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zoekt_replicas_id_seq OWNED BY zoekt_replicas.id;

CREATE TABLE zoekt_repositories (
    id bigint NOT NULL,
    zoekt_index_id bigint NOT NULL,
    project_id bigint,
    project_identifier bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    indexed_at timestamp with time zone,
    state smallint DEFAULT 0 NOT NULL,
    size_bytes bigint DEFAULT 0 NOT NULL,
    index_file_count integer DEFAULT 0 NOT NULL,
    retries_left smallint DEFAULT 10 NOT NULL,
    CONSTRAINT c_zoekt_repositories_on_project_id_and_project_identifier CHECK (((project_id IS NULL) OR (project_identifier = project_id))),
    CONSTRAINT c_zoekt_repositories_on_retries_left CHECK (((retries_left > 0) OR ((retries_left = 0) AND (state >= 200))))
);

CREATE SEQUENCE zoekt_repositories_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zoekt_repositories_id_seq OWNED BY zoekt_repositories.id;

CREATE SEQUENCE zoekt_tasks_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zoekt_tasks_id_seq OWNED BY zoekt_tasks.id;

CREATE TABLE zoom_meetings (
    id bigint NOT NULL,
    project_id bigint NOT NULL,
    issue_id bigint NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL,
    issue_status smallint DEFAULT 1 NOT NULL,
    url character varying(255)
);

CREATE SEQUENCE zoom_meetings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

ALTER SEQUENCE zoom_meetings_id_seq OWNED BY zoom_meetings.id;

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_00 FOR VALUES WITH (modulus 64, remainder 0);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_01 FOR VALUES WITH (modulus 64, remainder 1);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_02 FOR VALUES WITH (modulus 64, remainder 2);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_03 FOR VALUES WITH (modulus 64, remainder 3);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_04 FOR VALUES WITH (modulus 64, remainder 4);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_05 FOR VALUES WITH (modulus 64, remainder 5);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_06 FOR VALUES WITH (modulus 64, remainder 6);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_07 FOR VALUES WITH (modulus 64, remainder 7);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_08 FOR VALUES WITH (modulus 64, remainder 8);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_09 FOR VALUES WITH (modulus 64, remainder 9);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_10 FOR VALUES WITH (modulus 64, remainder 10);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_11 FOR VALUES WITH (modulus 64, remainder 11);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_12 FOR VALUES WITH (modulus 64, remainder 12);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_13 FOR VALUES WITH (modulus 64, remainder 13);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_14 FOR VALUES WITH (modulus 64, remainder 14);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_15 FOR VALUES WITH (modulus 64, remainder 15);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_16 FOR VALUES WITH (modulus 64, remainder 16);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_17 FOR VALUES WITH (modulus 64, remainder 17);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_18 FOR VALUES WITH (modulus 64, remainder 18);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_19 FOR VALUES WITH (modulus 64, remainder 19);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_20 FOR VALUES WITH (modulus 64, remainder 20);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_21 FOR VALUES WITH (modulus 64, remainder 21);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_22 FOR VALUES WITH (modulus 64, remainder 22);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_23 FOR VALUES WITH (modulus 64, remainder 23);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_24 FOR VALUES WITH (modulus 64, remainder 24);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_25 FOR VALUES WITH (modulus 64, remainder 25);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_26 FOR VALUES WITH (modulus 64, remainder 26);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_27 FOR VALUES WITH (modulus 64, remainder 27);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_28 FOR VALUES WITH (modulus 64, remainder 28);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_29 FOR VALUES WITH (modulus 64, remainder 29);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_30 FOR VALUES WITH (modulus 64, remainder 30);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_31 FOR VALUES WITH (modulus 64, remainder 31);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_32 FOR VALUES WITH (modulus 64, remainder 32);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_33 FOR VALUES WITH (modulus 64, remainder 33);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_34 FOR VALUES WITH (modulus 64, remainder 34);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_35 FOR VALUES WITH (modulus 64, remainder 35);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_36 FOR VALUES WITH (modulus 64, remainder 36);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_37 FOR VALUES WITH (modulus 64, remainder 37);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_38 FOR VALUES WITH (modulus 64, remainder 38);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_39 FOR VALUES WITH (modulus 64, remainder 39);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_40 FOR VALUES WITH (modulus 64, remainder 40);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_41 FOR VALUES WITH (modulus 64, remainder 41);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_42 FOR VALUES WITH (modulus 64, remainder 42);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_43 FOR VALUES WITH (modulus 64, remainder 43);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_44 FOR VALUES WITH (modulus 64, remainder 44);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_45 FOR VALUES WITH (modulus 64, remainder 45);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_46 FOR VALUES WITH (modulus 64, remainder 46);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_47 FOR VALUES WITH (modulus 64, remainder 47);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_48 FOR VALUES WITH (modulus 64, remainder 48);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_49 FOR VALUES WITH (modulus 64, remainder 49);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_50 FOR VALUES WITH (modulus 64, remainder 50);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_51 FOR VALUES WITH (modulus 64, remainder 51);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_52 FOR VALUES WITH (modulus 64, remainder 52);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_53 FOR VALUES WITH (modulus 64, remainder 53);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_54 FOR VALUES WITH (modulus 64, remainder 54);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_55 FOR VALUES WITH (modulus 64, remainder 55);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_56 FOR VALUES WITH (modulus 64, remainder 56);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_57 FOR VALUES WITH (modulus 64, remainder 57);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_58 FOR VALUES WITH (modulus 64, remainder 58);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_59 FOR VALUES WITH (modulus 64, remainder 59);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_60 FOR VALUES WITH (modulus 64, remainder 60);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_61 FOR VALUES WITH (modulus 64, remainder 61);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_62 FOR VALUES WITH (modulus 64, remainder 62);

ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_63 FOR VALUES WITH (modulus 64, remainder 63);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_00 FOR VALUES WITH (modulus 32, remainder 0);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_01 FOR VALUES WITH (modulus 32, remainder 1);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_02 FOR VALUES WITH (modulus 32, remainder 2);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_03 FOR VALUES WITH (modulus 32, remainder 3);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_04 FOR VALUES WITH (modulus 32, remainder 4);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_05 FOR VALUES WITH (modulus 32, remainder 5);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_06 FOR VALUES WITH (modulus 32, remainder 6);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_07 FOR VALUES WITH (modulus 32, remainder 7);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_08 FOR VALUES WITH (modulus 32, remainder 8);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_09 FOR VALUES WITH (modulus 32, remainder 9);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_10 FOR VALUES WITH (modulus 32, remainder 10);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_11 FOR VALUES WITH (modulus 32, remainder 11);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_12 FOR VALUES WITH (modulus 32, remainder 12);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_13 FOR VALUES WITH (modulus 32, remainder 13);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_14 FOR VALUES WITH (modulus 32, remainder 14);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_15 FOR VALUES WITH (modulus 32, remainder 15);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_16 FOR VALUES WITH (modulus 32, remainder 16);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_17 FOR VALUES WITH (modulus 32, remainder 17);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_18 FOR VALUES WITH (modulus 32, remainder 18);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_19 FOR VALUES WITH (modulus 32, remainder 19);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_20 FOR VALUES WITH (modulus 32, remainder 20);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_21 FOR VALUES WITH (modulus 32, remainder 21);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_22 FOR VALUES WITH (modulus 32, remainder 22);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_23 FOR VALUES WITH (modulus 32, remainder 23);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_24 FOR VALUES WITH (modulus 32, remainder 24);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_25 FOR VALUES WITH (modulus 32, remainder 25);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_26 FOR VALUES WITH (modulus 32, remainder 26);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_27 FOR VALUES WITH (modulus 32, remainder 27);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_28 FOR VALUES WITH (modulus 32, remainder 28);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_29 FOR VALUES WITH (modulus 32, remainder 29);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_30 FOR VALUES WITH (modulus 32, remainder 30);

ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_31 FOR VALUES WITH (modulus 32, remainder 31);

ALTER TABLE ONLY p_ci_builds ATTACH PARTITION ci_builds FOR VALUES IN ('100');

ALTER TABLE ONLY p_ci_builds_metadata ATTACH PARTITION ci_builds_metadata FOR VALUES IN ('100');

ALTER TABLE ONLY p_ci_job_artifacts ATTACH PARTITION ci_job_artifacts FOR VALUES IN ('100', '101');

ALTER TABLE ONLY p_ci_pipeline_variables ATTACH PARTITION ci_pipeline_variables FOR VALUES IN ('100', '101');

ALTER TABLE ONLY p_ci_pipelines ATTACH PARTITION ci_pipelines FOR VALUES IN ('100', '101', '102');

ALTER TABLE ONLY ci_runner_taggings ATTACH PARTITION ci_runner_taggings_group_type FOR VALUES IN ('2');

ALTER TABLE ONLY ci_runner_taggings ATTACH PARTITION ci_runner_taggings_instance_type FOR VALUES IN ('1');

ALTER TABLE ONLY ci_runner_taggings ATTACH PARTITION ci_runner_taggings_project_type FOR VALUES IN ('3');

ALTER TABLE ONLY p_ci_stages ATTACH PARTITION ci_stages FOR VALUES IN ('100', '101');

ALTER TABLE ONLY ci_runner_machines_687967fa8a ATTACH PARTITION group_type_ci_runner_machines_687967fa8a FOR VALUES IN ('2');

ALTER TABLE ONLY ci_runners_e59bb2812d ATTACH PARTITION group_type_ci_runners_e59bb2812d FOR VALUES IN ('2');

ALTER TABLE ONLY ci_runner_machines_687967fa8a ATTACH PARTITION instance_type_ci_runner_machines_687967fa8a FOR VALUES IN ('1');

ALTER TABLE ONLY ci_runners_e59bb2812d ATTACH PARTITION instance_type_ci_runners_e59bb2812d FOR VALUES IN ('1');

ALTER TABLE ONLY ci_runner_machines_687967fa8a ATTACH PARTITION project_type_ci_runner_machines_687967fa8a FOR VALUES IN ('3');

ALTER TABLE ONLY ci_runners_e59bb2812d ATTACH PARTITION project_type_ci_runners_e59bb2812d FOR VALUES IN ('3');

ALTER TABLE ONLY abuse_events ALTER COLUMN id SET DEFAULT nextval('abuse_events_id_seq'::regclass);

ALTER TABLE ONLY abuse_report_assignees ALTER COLUMN id SET DEFAULT nextval('abuse_report_assignees_id_seq'::regclass);

ALTER TABLE ONLY abuse_report_events ALTER COLUMN id SET DEFAULT nextval('abuse_report_events_id_seq'::regclass);

ALTER TABLE ONLY abuse_report_label_links ALTER COLUMN id SET DEFAULT nextval('abuse_report_label_links_id_seq'::regclass);

ALTER TABLE ONLY abuse_report_labels ALTER COLUMN id SET DEFAULT nextval('abuse_report_labels_id_seq'::regclass);

ALTER TABLE ONLY abuse_report_notes ALTER COLUMN id SET DEFAULT nextval('abuse_report_notes_id_seq'::regclass);

ALTER TABLE ONLY abuse_report_user_mentions ALTER COLUMN id SET DEFAULT nextval('abuse_report_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY abuse_reports ALTER COLUMN id SET DEFAULT nextval('abuse_reports_id_seq'::regclass);

ALTER TABLE ONLY abuse_trust_scores ALTER COLUMN id SET DEFAULT nextval('abuse_trust_scores_id_seq'::regclass);

ALTER TABLE ONLY achievements ALTER COLUMN id SET DEFAULT nextval('achievements_id_seq'::regclass);

ALTER TABLE ONLY activity_pub_releases_subscriptions ALTER COLUMN id SET DEFAULT nextval('activity_pub_releases_subscriptions_id_seq'::regclass);

ALTER TABLE ONLY agent_activity_events ALTER COLUMN id SET DEFAULT nextval('agent_activity_events_id_seq'::regclass);

ALTER TABLE ONLY agent_group_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_group_authorizations_id_seq'::regclass);

ALTER TABLE ONLY agent_project_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_project_authorizations_id_seq'::regclass);

ALTER TABLE ONLY agent_user_access_group_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_user_access_group_authorizations_id_seq'::regclass);

ALTER TABLE ONLY agent_user_access_project_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_user_access_project_authorizations_id_seq'::regclass);

ALTER TABLE ONLY ai_agent_version_attachments ALTER COLUMN id SET DEFAULT nextval('ai_agent_version_attachments_id_seq'::regclass);

ALTER TABLE ONLY ai_agent_versions ALTER COLUMN id SET DEFAULT nextval('ai_agent_versions_id_seq'::regclass);

ALTER TABLE ONLY ai_agents ALTER COLUMN id SET DEFAULT nextval('ai_agents_id_seq'::regclass);

ALTER TABLE ONLY ai_code_suggestion_events ALTER COLUMN id SET DEFAULT nextval('ai_code_suggestion_events_id_seq'::regclass);

ALTER TABLE ONLY ai_feature_settings ALTER COLUMN id SET DEFAULT nextval('ai_feature_settings_id_seq'::regclass);

ALTER TABLE ONLY ai_self_hosted_models ALTER COLUMN id SET DEFAULT nextval('ai_self_hosted_models_id_seq'::regclass);

ALTER TABLE ONLY ai_settings ALTER COLUMN id SET DEFAULT nextval('ai_settings_id_seq'::regclass);

ALTER TABLE ONLY ai_vectorizable_files ALTER COLUMN id SET DEFAULT nextval('ai_vectorizable_files_id_seq'::regclass);

ALTER TABLE ONLY alert_management_alert_assignees ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_assignees_id_seq'::regclass);

ALTER TABLE ONLY alert_management_alert_metric_images ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_metric_images_id_seq'::regclass);

ALTER TABLE ONLY alert_management_alert_user_mentions ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY alert_management_alerts ALTER COLUMN id SET DEFAULT nextval('alert_management_alerts_id_seq'::regclass);

ALTER TABLE ONLY alert_management_http_integrations ALTER COLUMN id SET DEFAULT nextval('alert_management_http_integrations_id_seq'::regclass);

ALTER TABLE ONLY allowed_email_domains ALTER COLUMN id SET DEFAULT nextval('allowed_email_domains_id_seq'::regclass);

ALTER TABLE ONLY analytics_cycle_analytics_group_stages ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_group_stages_id_seq'::regclass);

ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_group_value_streams_id_seq'::regclass);

ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_stage_event_hashes_id_seq'::regclass);

ALTER TABLE ONLY analytics_dashboards_pointers ALTER COLUMN id SET DEFAULT nextval('analytics_dashboards_pointers_id_seq'::regclass);

ALTER TABLE ONLY analytics_devops_adoption_segments ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segments_id_seq'::regclass);

ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_snapshots_id_seq'::regclass);

ALTER TABLE ONLY analytics_usage_trends_measurements ALTER COLUMN id SET DEFAULT nextval('analytics_usage_trends_measurements_id_seq'::regclass);

ALTER TABLE ONLY appearances ALTER COLUMN id SET DEFAULT nextval('appearances_id_seq'::regclass);

ALTER TABLE ONLY application_setting_terms ALTER COLUMN id SET DEFAULT nextval('application_setting_terms_id_seq'::regclass);

ALTER TABLE ONLY application_settings ALTER COLUMN id SET DEFAULT nextval('application_settings_id_seq'::regclass);

ALTER TABLE ONLY approval_group_rules ALTER COLUMN id SET DEFAULT nextval('approval_group_rules_id_seq'::regclass);

ALTER TABLE ONLY approval_group_rules_groups ALTER COLUMN id SET DEFAULT nextval('approval_group_rules_groups_id_seq'::regclass);

ALTER TABLE ONLY approval_group_rules_protected_branches ALTER COLUMN id SET DEFAULT nextval('approval_group_rules_protected_branches_id_seq'::regclass);

ALTER TABLE ONLY approval_group_rules_users ALTER COLUMN id SET DEFAULT nextval('approval_group_rules_users_id_seq'::regclass);

ALTER TABLE ONLY approval_merge_request_rule_sources ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rule_sources_id_seq'::regclass);

ALTER TABLE ONLY approval_merge_request_rules ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_id_seq'::regclass);

ALTER TABLE ONLY approval_merge_request_rules_approved_approvers ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_approved_approvers_id_seq'::regclass);

ALTER TABLE ONLY approval_merge_request_rules_groups ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_groups_id_seq'::regclass);

ALTER TABLE ONLY approval_merge_request_rules_users ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_users_id_seq'::regclass);

ALTER TABLE ONLY approval_policy_rule_project_links ALTER COLUMN id SET DEFAULT nextval('approval_policy_rule_project_links_id_seq'::regclass);

ALTER TABLE ONLY approval_policy_rules ALTER COLUMN id SET DEFAULT nextval('approval_policy_rules_id_seq'::regclass);

ALTER TABLE ONLY approval_project_rules ALTER COLUMN id SET DEFAULT nextval('approval_project_rules_id_seq'::regclass);

ALTER TABLE ONLY approval_project_rules_groups ALTER COLUMN id SET DEFAULT nextval('approval_project_rules_groups_id_seq'::regclass);

ALTER TABLE ONLY approval_project_rules_users ALTER COLUMN id SET DEFAULT nextval('approval_project_rules_users_id_seq'::regclass);

ALTER TABLE ONLY approvals ALTER COLUMN id SET DEFAULT nextval('approvals_id_seq'::regclass);

ALTER TABLE ONLY approver_groups ALTER COLUMN id SET DEFAULT nextval('approver_groups_id_seq'::regclass);

ALTER TABLE ONLY approvers ALTER COLUMN id SET DEFAULT nextval('approvers_id_seq'::regclass);

ALTER TABLE ONLY atlassian_identities ALTER COLUMN user_id SET DEFAULT nextval('atlassian_identities_user_id_seq'::regclass);

ALTER TABLE ONLY audit_events ALTER COLUMN id SET DEFAULT nextval('audit_events_id_seq'::regclass);

ALTER TABLE ONLY audit_events_amazon_s3_configurations ALTER COLUMN id SET DEFAULT nextval('audit_events_amazon_s3_configurations_id_seq'::regclass);

ALTER TABLE ONLY audit_events_external_audit_event_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_external_audit_event_destinations_id_seq'::regclass);

ALTER TABLE ONLY audit_events_google_cloud_logging_configurations ALTER COLUMN id SET DEFAULT nextval('audit_events_google_cloud_logging_configurations_id_seq'::regclass);

ALTER TABLE ONLY audit_events_group_external_streaming_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_group_external_streaming_destinations_id_seq'::regclass);

ALTER TABLE ONLY audit_events_group_streaming_event_type_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_group_streaming_event_type_filters_id_seq'::regclass);

ALTER TABLE ONLY audit_events_instance_amazon_s3_configurations ALTER COLUMN id SET DEFAULT nextval('audit_events_instance_amazon_s3_configurations_id_seq'::regclass);

ALTER TABLE ONLY audit_events_instance_external_audit_event_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_instance_external_audit_event_destinations_id_seq'::regclass);

ALTER TABLE ONLY audit_events_instance_external_streaming_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_instance_external_streaming_destinations_id_seq'::regclass);

ALTER TABLE ONLY audit_events_instance_google_cloud_logging_configurations ALTER COLUMN id SET DEFAULT nextval('audit_events_instance_google_cloud_logging_configuration_id_seq'::regclass);

ALTER TABLE ONLY audit_events_instance_streaming_event_type_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_instance_streaming_event_type_filters_id_seq'::regclass);

ALTER TABLE ONLY audit_events_streaming_event_type_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_event_type_filters_id_seq'::regclass);

ALTER TABLE ONLY audit_events_streaming_group_namespace_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_group_namespace_filters_id_seq'::regclass);

ALTER TABLE ONLY audit_events_streaming_headers ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_headers_id_seq'::regclass);

ALTER TABLE ONLY audit_events_streaming_http_group_namespace_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_http_group_namespace_filters_id_seq'::regclass);

ALTER TABLE ONLY audit_events_streaming_http_instance_namespace_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_http_instance_namespace_filters_id_seq'::regclass);

ALTER TABLE ONLY audit_events_streaming_instance_event_type_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_instance_event_type_filters_id_seq'::regclass);

ALTER TABLE ONLY audit_events_streaming_instance_namespace_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_instance_namespace_filters_id_seq'::regclass);

ALTER TABLE ONLY authentication_events ALTER COLUMN id SET DEFAULT nextval('authentication_events_id_seq'::regclass);

ALTER TABLE ONLY automation_rules ALTER COLUMN id SET DEFAULT nextval('automation_rules_id_seq'::regclass);

ALTER TABLE ONLY award_emoji ALTER COLUMN id SET DEFAULT nextval('award_emoji_id_seq'::regclass);

ALTER TABLE ONLY background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('background_migration_jobs_id_seq'::regclass);

ALTER TABLE ONLY badges ALTER COLUMN id SET DEFAULT nextval('badges_id_seq'::regclass);

ALTER TABLE ONLY batched_background_migration_job_transition_logs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass);

ALTER TABLE ONLY batched_background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_jobs_id_seq'::regclass);

ALTER TABLE ONLY batched_background_migrations ALTER COLUMN id SET DEFAULT nextval('batched_background_migrations_id_seq'::regclass);

ALTER TABLE ONLY board_assignees ALTER COLUMN id SET DEFAULT nextval('board_assignees_id_seq'::regclass);

ALTER TABLE ONLY board_group_recent_visits ALTER COLUMN id SET DEFAULT nextval('board_group_recent_visits_id_seq'::regclass);

ALTER TABLE ONLY board_labels ALTER COLUMN id SET DEFAULT nextval('board_labels_id_seq'::regclass);

ALTER TABLE ONLY board_project_recent_visits ALTER COLUMN id SET DEFAULT nextval('board_project_recent_visits_id_seq'::regclass);

ALTER TABLE ONLY board_user_preferences ALTER COLUMN id SET DEFAULT nextval('board_user_preferences_id_seq'::regclass);

ALTER TABLE ONLY boards ALTER COLUMN id SET DEFAULT nextval('boards_id_seq'::regclass);

ALTER TABLE ONLY boards_epic_board_labels ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_labels_id_seq'::regclass);

ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_positions_id_seq'::regclass);

ALTER TABLE ONLY boards_epic_board_recent_visits ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_recent_visits_id_seq'::regclass);

ALTER TABLE ONLY boards_epic_boards ALTER COLUMN id SET DEFAULT nextval('boards_epic_boards_id_seq'::regclass);

ALTER TABLE ONLY boards_epic_list_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_list_user_preferences_id_seq'::regclass);

ALTER TABLE ONLY boards_epic_lists ALTER COLUMN id SET DEFAULT nextval('boards_epic_lists_id_seq'::regclass);

ALTER TABLE ONLY boards_epic_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_user_preferences_id_seq'::regclass);

ALTER TABLE ONLY broadcast_messages ALTER COLUMN id SET DEFAULT nextval('broadcast_messages_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_batch_trackers ALTER COLUMN id SET DEFAULT nextval('bulk_import_batch_trackers_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_configurations ALTER COLUMN id SET DEFAULT nextval('bulk_import_configurations_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_entities ALTER COLUMN id SET DEFAULT nextval('bulk_import_entities_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_export_batches ALTER COLUMN id SET DEFAULT nextval('bulk_import_export_batches_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_export_uploads ALTER COLUMN id SET DEFAULT nextval('bulk_import_export_uploads_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_exports ALTER COLUMN id SET DEFAULT nextval('bulk_import_exports_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_failures ALTER COLUMN id SET DEFAULT nextval('bulk_import_failures_id_seq'::regclass);

ALTER TABLE ONLY bulk_import_trackers ALTER COLUMN id SET DEFAULT nextval('bulk_import_trackers_id_seq'::regclass);

ALTER TABLE ONLY bulk_imports ALTER COLUMN id SET DEFAULT nextval('bulk_imports_id_seq'::regclass);

ALTER TABLE ONLY catalog_resource_component_last_usages ALTER COLUMN id SET DEFAULT nextval('catalog_resource_component_last_usages_id_seq'::regclass);

ALTER TABLE ONLY catalog_resource_components ALTER COLUMN id SET DEFAULT nextval('catalog_resource_components_id_seq'::regclass);

ALTER TABLE ONLY catalog_resource_versions ALTER COLUMN id SET DEFAULT nextval('catalog_resource_versions_id_seq'::regclass);

ALTER TABLE ONLY catalog_resources ALTER COLUMN id SET DEFAULT nextval('catalog_resources_id_seq'::regclass);

ALTER TABLE ONLY catalog_verified_namespaces ALTER COLUMN id SET DEFAULT nextval('catalog_verified_namespaces_id_seq'::regclass);

ALTER TABLE ONLY chat_names ALTER COLUMN id SET DEFAULT nextval('chat_names_id_seq'::regclass);

ALTER TABLE ONLY chat_teams ALTER COLUMN id SET DEFAULT nextval('chat_teams_id_seq'::regclass);

ALTER TABLE ONLY ci_build_needs ALTER COLUMN id SET DEFAULT nextval('ci_build_needs_id_seq'::regclass);

ALTER TABLE ONLY ci_build_pending_states ALTER COLUMN id SET DEFAULT nextval('ci_build_pending_states_id_seq'::regclass);

ALTER TABLE ONLY ci_build_trace_chunks ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_chunks_id_seq'::regclass);

ALTER TABLE ONLY ci_builds_runner_session ALTER COLUMN id SET DEFAULT nextval('ci_builds_runner_session_id_seq'::regclass);

ALTER TABLE ONLY ci_daily_build_group_report_results ALTER COLUMN id SET DEFAULT nextval('ci_daily_build_group_report_results_id_seq'::regclass);

ALTER TABLE ONLY ci_deleted_objects ALTER COLUMN id SET DEFAULT nextval('ci_deleted_objects_id_seq'::regclass);

ALTER TABLE ONLY ci_freeze_periods ALTER COLUMN id SET DEFAULT nextval('ci_freeze_periods_id_seq'::regclass);

ALTER TABLE ONLY ci_group_variables ALTER COLUMN id SET DEFAULT nextval('ci_group_variables_id_seq'::regclass);

ALTER TABLE ONLY ci_instance_variables ALTER COLUMN id SET DEFAULT nextval('ci_instance_variables_id_seq'::regclass);

ALTER TABLE ONLY ci_job_token_authorizations ALTER COLUMN id SET DEFAULT nextval('ci_job_token_authorizations_id_seq'::regclass);

ALTER TABLE ONLY ci_job_token_group_scope_links ALTER COLUMN id SET DEFAULT nextval('ci_job_token_group_scope_links_id_seq'::regclass);

ALTER TABLE ONLY ci_job_token_project_scope_links ALTER COLUMN id SET DEFAULT nextval('ci_job_token_project_scope_links_id_seq'::regclass);

ALTER TABLE ONLY ci_job_variables ALTER COLUMN id SET DEFAULT nextval('ci_job_variables_id_seq'::regclass);

ALTER TABLE ONLY ci_minutes_additional_packs ALTER COLUMN id SET DEFAULT nextval('ci_minutes_additional_packs_id_seq'::regclass);

ALTER TABLE ONLY ci_namespace_mirrors ALTER COLUMN id SET DEFAULT nextval('ci_namespace_mirrors_id_seq'::regclass);

ALTER TABLE ONLY ci_namespace_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_namespace_monthly_usages_id_seq'::regclass);

ALTER TABLE ONLY ci_pending_builds ALTER COLUMN id SET DEFAULT nextval('ci_pending_builds_id_seq'::regclass);

ALTER TABLE ONLY ci_pipeline_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_artifacts_id_seq'::regclass);

ALTER TABLE ONLY ci_pipeline_chat_data ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_chat_data_id_seq'::regclass);

ALTER TABLE ONLY ci_pipeline_messages ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_messages_id_seq'::regclass);

ALTER TABLE ONLY ci_pipeline_schedule_variables ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_schedule_variables_id_seq'::regclass);

ALTER TABLE ONLY ci_pipeline_schedules ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_schedules_id_seq'::regclass);

ALTER TABLE ONLY ci_project_mirrors ALTER COLUMN id SET DEFAULT nextval('ci_project_mirrors_id_seq'::regclass);

ALTER TABLE ONLY ci_project_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_project_monthly_usages_id_seq'::regclass);

ALTER TABLE ONLY ci_refs ALTER COLUMN id SET DEFAULT nextval('ci_refs_id_seq'::regclass);

ALTER TABLE ONLY ci_resource_groups ALTER COLUMN id SET DEFAULT nextval('ci_resource_groups_id_seq'::regclass);

ALTER TABLE ONLY ci_resources ALTER COLUMN id SET DEFAULT nextval('ci_resources_id_seq'::regclass);

ALTER TABLE ONLY ci_runner_machines ALTER COLUMN id SET DEFAULT nextval('ci_runner_machines_id_seq'::regclass);

ALTER TABLE ONLY ci_runner_namespaces ALTER COLUMN id SET DEFAULT nextval('ci_runner_namespaces_id_seq'::regclass);

ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runner_projects_id_seq'::regclass);

ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_seq'::regclass);

ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_id_seq'::regclass);

ALTER TABLE ONLY ci_secure_file_states ALTER COLUMN ci_secure_file_id SET DEFAULT nextval('ci_secure_file_states_ci_secure_file_id_seq'::regclass);

ALTER TABLE ONLY ci_secure_files ALTER COLUMN id SET DEFAULT nextval('ci_secure_files_id_seq'::regclass);

ALTER TABLE ONLY ci_sources_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_sources_pipelines_id_seq'::regclass);

ALTER TABLE ONLY ci_sources_projects ALTER COLUMN id SET DEFAULT nextval('ci_sources_projects_id_seq'::regclass);

ALTER TABLE ONLY ci_subscriptions_projects ALTER COLUMN id SET DEFAULT nextval('ci_subscriptions_projects_id_seq'::regclass);

ALTER TABLE ONLY ci_trigger_requests ALTER COLUMN id SET DEFAULT nextval('ci_trigger_requests_id_seq'::regclass);

ALTER TABLE ONLY ci_triggers ALTER COLUMN id SET DEFAULT nextval('ci_triggers_id_seq'::regclass);

ALTER TABLE ONLY ci_unit_test_failures ALTER COLUMN id SET DEFAULT nextval('ci_unit_test_failures_id_seq'::regclass);

ALTER TABLE ONLY ci_unit_tests ALTER COLUMN id SET DEFAULT nextval('ci_unit_tests_id_seq'::regclass);

ALTER TABLE ONLY ci_variables ALTER COLUMN id SET DEFAULT nextval('ci_variables_id_seq'::regclass);

ALTER TABLE ONLY cloud_connector_access ALTER COLUMN id SET DEFAULT nextval('cloud_connector_access_id_seq'::regclass);

ALTER TABLE ONLY cluster_agent_tokens ALTER COLUMN id SET DEFAULT nextval('cluster_agent_tokens_id_seq'::regclass);

ALTER TABLE ONLY cluster_agent_url_configurations ALTER COLUMN id SET DEFAULT nextval('cluster_agent_url_configurations_id_seq'::regclass);

ALTER TABLE ONLY cluster_agents ALTER COLUMN id SET DEFAULT nextval('cluster_agents_id_seq'::regclass);

ALTER TABLE ONLY cluster_enabled_grants ALTER COLUMN id SET DEFAULT nextval('cluster_enabled_grants_id_seq'::regclass);

ALTER TABLE ONLY cluster_groups ALTER COLUMN id SET DEFAULT nextval('cluster_groups_id_seq'::regclass);

ALTER TABLE ONLY cluster_platforms_kubernetes ALTER COLUMN id SET DEFAULT nextval('cluster_platforms_kubernetes_id_seq'::regclass);

ALTER TABLE ONLY cluster_projects ALTER COLUMN id SET DEFAULT nextval('cluster_projects_id_seq'::regclass);

ALTER TABLE ONLY cluster_providers_aws ALTER COLUMN id SET DEFAULT nextval('cluster_providers_aws_id_seq'::regclass);

ALTER TABLE ONLY cluster_providers_gcp ALTER COLUMN id SET DEFAULT nextval('cluster_providers_gcp_id_seq'::regclass);

ALTER TABLE ONLY clusters ALTER COLUMN id SET DEFAULT nextval('clusters_id_seq'::regclass);

ALTER TABLE ONLY clusters_kubernetes_namespaces ALTER COLUMN id SET DEFAULT nextval('clusters_kubernetes_namespaces_id_seq'::regclass);

ALTER TABLE ONLY commit_user_mentions ALTER COLUMN id SET DEFAULT nextval('commit_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY compliance_framework_security_policies ALTER COLUMN id SET DEFAULT nextval('compliance_framework_security_policies_id_seq'::regclass);

ALTER TABLE ONLY compliance_management_frameworks ALTER COLUMN id SET DEFAULT nextval('compliance_management_frameworks_id_seq'::regclass);

ALTER TABLE ONLY compliance_requirements ALTER COLUMN id SET DEFAULT nextval('compliance_requirements_id_seq'::regclass);

ALTER TABLE ONLY container_registry_protection_rules ALTER COLUMN id SET DEFAULT nextval('container_registry_protection_rules_id_seq'::regclass);

ALTER TABLE ONLY container_repositories ALTER COLUMN id SET DEFAULT nextval('container_repositories_id_seq'::regclass);

ALTER TABLE ONLY content_blocked_states ALTER COLUMN id SET DEFAULT nextval('content_blocked_states_id_seq'::regclass);

ALTER TABLE ONLY conversational_development_index_metrics ALTER COLUMN id SET DEFAULT nextval('conversational_development_index_metrics_id_seq'::regclass);

ALTER TABLE ONLY country_access_logs ALTER COLUMN id SET DEFAULT nextval('country_access_logs_id_seq'::regclass);

ALTER TABLE ONLY coverage_fuzzing_corpuses ALTER COLUMN id SET DEFAULT nextval('coverage_fuzzing_corpuses_id_seq'::regclass);

ALTER TABLE ONLY csv_issue_imports ALTER COLUMN id SET DEFAULT nextval('csv_issue_imports_id_seq'::regclass);

ALTER TABLE ONLY custom_emoji ALTER COLUMN id SET DEFAULT nextval('custom_emoji_id_seq'::regclass);

ALTER TABLE ONLY custom_field_select_options ALTER COLUMN id SET DEFAULT nextval('custom_field_select_options_id_seq'::regclass);

ALTER TABLE ONLY custom_fields ALTER COLUMN id SET DEFAULT nextval('custom_fields_id_seq'::regclass);

ALTER TABLE ONLY custom_software_licenses ALTER COLUMN id SET DEFAULT nextval('custom_software_licenses_id_seq'::regclass);

ALTER TABLE ONLY customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('customer_relations_contacts_id_seq'::regclass);

ALTER TABLE ONLY customer_relations_organizations ALTER COLUMN id SET DEFAULT nextval('customer_relations_organizations_id_seq'::regclass);

ALTER TABLE ONLY dast_pre_scan_verification_steps ALTER COLUMN id SET DEFAULT nextval('dast_pre_scan_verification_steps_id_seq'::regclass);

ALTER TABLE ONLY dast_pre_scan_verifications ALTER COLUMN id SET DEFAULT nextval('dast_pre_scan_verifications_id_seq'::regclass);

ALTER TABLE ONLY dast_profile_schedules ALTER COLUMN id SET DEFAULT nextval('dast_profile_schedules_id_seq'::regclass);

ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profiles_id_seq'::regclass);

ALTER TABLE ONLY dast_profiles_tags ALTER COLUMN id SET DEFAULT nextval('dast_profiles_tags_id_seq'::regclass);

ALTER TABLE ONLY dast_scanner_profiles ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_id_seq'::regclass);

ALTER TABLE ONLY dast_site_profile_secret_variables ALTER COLUMN id SET DEFAULT nextval('dast_site_profile_secret_variables_id_seq'::regclass);

ALTER TABLE ONLY dast_site_profiles ALTER COLUMN id SET DEFAULT nextval('dast_site_profiles_id_seq'::regclass);

ALTER TABLE ONLY dast_site_tokens ALTER COLUMN id SET DEFAULT nextval('dast_site_tokens_id_seq'::regclass);

ALTER TABLE ONLY dast_site_validations ALTER COLUMN id SET DEFAULT nextval('dast_site_validations_id_seq'::regclass);

ALTER TABLE ONLY dast_sites ALTER COLUMN id SET DEFAULT nextval('dast_sites_id_seq'::regclass);

ALTER TABLE ONLY dependency_list_export_parts ALTER COLUMN id SET DEFAULT nextval('dependency_list_export_parts_id_seq'::regclass);

ALTER TABLE ONLY dependency_list_exports ALTER COLUMN id SET DEFAULT nextval('dependency_list_exports_id_seq'::regclass);

ALTER TABLE ONLY dependency_proxy_blobs ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_blobs_id_seq'::regclass);

ALTER TABLE ONLY dependency_proxy_group_settings ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_group_settings_id_seq'::regclass);

ALTER TABLE ONLY dependency_proxy_manifests ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_manifests_id_seq'::regclass);

ALTER TABLE ONLY deploy_keys_projects ALTER COLUMN id SET DEFAULT nextval('deploy_keys_projects_id_seq'::regclass);

ALTER TABLE ONLY deploy_tokens ALTER COLUMN id SET DEFAULT nextval('deploy_tokens_id_seq'::regclass);

ALTER TABLE ONLY deployment_approvals ALTER COLUMN id SET DEFAULT nextval('deployment_approvals_id_seq'::regclass);

ALTER TABLE ONLY deployments ALTER COLUMN id SET DEFAULT nextval('deployments_id_seq'::regclass);

ALTER TABLE ONLY description_versions ALTER COLUMN id SET DEFAULT nextval('description_versions_id_seq'::regclass);

ALTER TABLE ONLY design_management_designs ALTER COLUMN id SET DEFAULT nextval('design_management_designs_id_seq'::regclass);

ALTER TABLE ONLY design_management_designs_versions ALTER COLUMN id SET DEFAULT nextval('design_management_designs_versions_id_seq'::regclass);

ALTER TABLE ONLY design_management_repositories ALTER COLUMN id SET DEFAULT nextval('design_management_repositories_id_seq'::regclass);

ALTER TABLE ONLY design_management_versions ALTER COLUMN id SET DEFAULT nextval('design_management_versions_id_seq'::regclass);

ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('design_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY detached_partitions ALTER COLUMN id SET DEFAULT nextval('detached_partitions_id_seq'::regclass);

ALTER TABLE ONLY diff_note_positions ALTER COLUMN id SET DEFAULT nextval('diff_note_positions_id_seq'::regclass);

ALTER TABLE ONLY dingtalk_tracker_data ALTER COLUMN id SET DEFAULT nextval('dingtalk_tracker_data_id_seq'::regclass);

ALTER TABLE ONLY dora_configurations ALTER COLUMN id SET DEFAULT nextval('dora_configurations_id_seq'::regclass);

ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_daily_metrics_id_seq'::regclass);

ALTER TABLE ONLY dora_performance_scores ALTER COLUMN id SET DEFAULT nextval('dora_performance_scores_id_seq'::regclass);

ALTER TABLE ONLY draft_notes ALTER COLUMN id SET DEFAULT nextval('draft_notes_id_seq'::regclass);

ALTER TABLE ONLY duo_workflows_checkpoints ALTER COLUMN id SET DEFAULT nextval('duo_workflows_checkpoints_id_seq'::regclass);

ALTER TABLE ONLY duo_workflows_events ALTER COLUMN id SET DEFAULT nextval('duo_workflows_events_id_seq'::regclass);

ALTER TABLE ONLY duo_workflows_workflows ALTER COLUMN id SET DEFAULT nextval('duo_workflows_workflows_id_seq'::regclass);

ALTER TABLE ONLY early_access_program_tracking_events ALTER COLUMN id SET DEFAULT nextval('early_access_program_tracking_events_id_seq'::regclass);

ALTER TABLE ONLY elastic_index_settings ALTER COLUMN id SET DEFAULT nextval('elastic_index_settings_id_seq'::regclass);

ALTER TABLE ONLY elastic_reindexing_slices ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_slices_id_seq'::regclass);

ALTER TABLE ONLY elastic_reindexing_subtasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_subtasks_id_seq'::regclass);

ALTER TABLE ONLY elastic_reindexing_tasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_tasks_id_seq'::regclass);

ALTER TABLE ONLY emails ALTER COLUMN id SET DEFAULT nextval('emails_id_seq'::regclass);

ALTER TABLE ONLY environments ALTER COLUMN id SET DEFAULT nextval('environments_id_seq'::regclass);

ALTER TABLE ONLY epic_issues ALTER COLUMN id SET DEFAULT nextval('epic_issues_id_seq'::regclass);

ALTER TABLE ONLY epic_metrics ALTER COLUMN id SET DEFAULT nextval('epic_metrics_id_seq'::regclass);

ALTER TABLE ONLY epic_user_mentions ALTER COLUMN id SET DEFAULT nextval('epic_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY epics ALTER COLUMN id SET DEFAULT nextval('epics_id_seq'::regclass);

ALTER TABLE ONLY error_tracking_client_keys ALTER COLUMN id SET DEFAULT nextval('error_tracking_client_keys_id_seq'::regclass);

ALTER TABLE ONLY error_tracking_error_events ALTER COLUMN id SET DEFAULT nextval('error_tracking_error_events_id_seq'::regclass);

ALTER TABLE ONLY error_tracking_errors ALTER COLUMN id SET DEFAULT nextval('error_tracking_errors_id_seq'::regclass);

ALTER TABLE ONLY events ALTER COLUMN id SET DEFAULT nextval('events_id_seq'::regclass);

ALTER TABLE ONLY evidences ALTER COLUMN id SET DEFAULT nextval('evidences_id_seq'::regclass);

ALTER TABLE ONLY external_approval_rules ALTER COLUMN id SET DEFAULT nextval('external_approval_rules_id_seq'::regclass);

ALTER TABLE ONLY external_pull_requests ALTER COLUMN id SET DEFAULT nextval('external_pull_requests_id_seq'::regclass);

ALTER TABLE ONLY external_status_checks ALTER COLUMN id SET DEFAULT nextval('external_status_checks_id_seq'::regclass);

ALTER TABLE ONLY external_status_checks_protected_branches ALTER COLUMN id SET DEFAULT nextval('external_status_checks_protected_branches_id_seq'::regclass);

ALTER TABLE ONLY feature_gates ALTER COLUMN id SET DEFAULT nextval('feature_gates_id_seq'::regclass);

ALTER TABLE ONLY features ALTER COLUMN id SET DEFAULT nextval('features_id_seq'::regclass);

ALTER TABLE ONLY fork_network_members ALTER COLUMN id SET DEFAULT nextval('fork_network_members_id_seq'::regclass);

ALTER TABLE ONLY fork_networks ALTER COLUMN id SET DEFAULT nextval('fork_networks_id_seq'::regclass);

ALTER TABLE ONLY geo_cache_invalidation_events ALTER COLUMN id SET DEFAULT nextval('geo_cache_invalidation_events_id_seq'::regclass);

ALTER TABLE ONLY geo_event_log ALTER COLUMN id SET DEFAULT nextval('geo_event_log_id_seq'::regclass);

ALTER TABLE ONLY geo_events ALTER COLUMN id SET DEFAULT nextval('geo_events_id_seq'::regclass);

ALTER TABLE ONLY geo_node_namespace_links ALTER COLUMN id SET DEFAULT nextval('geo_node_namespace_links_id_seq'::regclass);

ALTER TABLE ONLY geo_node_statuses ALTER COLUMN id SET DEFAULT nextval('geo_node_statuses_id_seq'::regclass);

ALTER TABLE ONLY geo_nodes ALTER COLUMN id SET DEFAULT nextval('geo_nodes_id_seq'::regclass);

ALTER TABLE ONLY ghost_user_migrations ALTER COLUMN id SET DEFAULT nextval('ghost_user_migrations_id_seq'::regclass);

ALTER TABLE ONLY gitlab_subscription_histories ALTER COLUMN id SET DEFAULT nextval('gitlab_subscription_histories_id_seq'::regclass);

ALTER TABLE ONLY gitlab_subscriptions ALTER COLUMN id SET DEFAULT nextval('gitlab_subscriptions_id_seq'::regclass);

ALTER TABLE ONLY gpg_key_subkeys ALTER COLUMN id SET DEFAULT nextval('gpg_key_subkeys_id_seq'::regclass);

ALTER TABLE ONLY gpg_keys ALTER COLUMN id SET DEFAULT nextval('gpg_keys_id_seq'::regclass);

ALTER TABLE ONLY gpg_signatures ALTER COLUMN id SET DEFAULT nextval('gpg_signatures_id_seq'::regclass);

ALTER TABLE ONLY grafana_integrations ALTER COLUMN id SET DEFAULT nextval('grafana_integrations_id_seq'::regclass);

ALTER TABLE ONLY group_crm_settings ALTER COLUMN group_id SET DEFAULT nextval('group_crm_settings_group_id_seq'::regclass);

ALTER TABLE ONLY group_custom_attributes ALTER COLUMN id SET DEFAULT nextval('group_custom_attributes_id_seq'::regclass);

ALTER TABLE ONLY group_deploy_keys ALTER COLUMN id SET DEFAULT nextval('group_deploy_keys_id_seq'::regclass);

ALTER TABLE ONLY group_deploy_keys_groups ALTER COLUMN id SET DEFAULT nextval('group_deploy_keys_groups_id_seq'::regclass);

ALTER TABLE ONLY group_deploy_tokens ALTER COLUMN id SET DEFAULT nextval('group_deploy_tokens_id_seq'::regclass);

ALTER TABLE ONLY group_group_links ALTER COLUMN id SET DEFAULT nextval('group_group_links_id_seq'::regclass);

ALTER TABLE ONLY group_import_states ALTER COLUMN group_id SET DEFAULT nextval('group_import_states_group_id_seq'::regclass);

ALTER TABLE ONLY group_repository_storage_moves ALTER COLUMN id SET DEFAULT nextval('group_repository_storage_moves_id_seq'::regclass);

ALTER TABLE ONLY group_saved_replies ALTER COLUMN id SET DEFAULT nextval('group_saved_replies_id_seq'::regclass);

ALTER TABLE ONLY group_scim_auth_access_tokens ALTER COLUMN id SET DEFAULT nextval('group_scim_auth_access_tokens_id_seq'::regclass);

ALTER TABLE ONLY group_scim_identities ALTER COLUMN id SET DEFAULT nextval('group_scim_identities_id_seq'::regclass);

ALTER TABLE ONLY group_security_exclusions ALTER COLUMN id SET DEFAULT nextval('group_security_exclusions_id_seq'::regclass);

ALTER TABLE ONLY group_ssh_certificates ALTER COLUMN id SET DEFAULT nextval('group_ssh_certificates_id_seq'::regclass);

ALTER TABLE ONLY group_wiki_repository_states ALTER COLUMN id SET DEFAULT nextval('group_wiki_repository_states_id_seq'::regclass);

ALTER TABLE ONLY groups_visits ALTER COLUMN id SET DEFAULT nextval('groups_visits_id_seq'::regclass);

ALTER TABLE ONLY historical_data ALTER COLUMN id SET DEFAULT nextval('historical_data_id_seq'::regclass);

ALTER TABLE ONLY identities ALTER COLUMN id SET DEFAULT nextval('identities_id_seq'::regclass);

ALTER TABLE ONLY import_export_uploads ALTER COLUMN id SET DEFAULT nextval('import_export_uploads_id_seq'::regclass);

ALTER TABLE ONLY import_failures ALTER COLUMN id SET DEFAULT nextval('import_failures_id_seq'::regclass);

ALTER TABLE ONLY import_placeholder_memberships ALTER COLUMN id SET DEFAULT nextval('import_placeholder_memberships_id_seq'::regclass);

ALTER TABLE ONLY import_source_user_placeholder_references ALTER COLUMN id SET DEFAULT nextval('import_source_user_placeholder_references_id_seq'::regclass);

ALTER TABLE ONLY import_source_users ALTER COLUMN id SET DEFAULT nextval('import_source_users_id_seq'::regclass);

ALTER TABLE ONLY incident_management_escalation_policies ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_policies_id_seq'::regclass);

ALTER TABLE ONLY incident_management_escalation_rules ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_rules_id_seq'::regclass);

ALTER TABLE ONLY incident_management_issuable_escalation_statuses ALTER COLUMN id SET DEFAULT nextval('incident_management_issuable_escalation_statuses_id_seq'::regclass);

ALTER TABLE ONLY incident_management_oncall_participants ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_participants_id_seq'::regclass);

ALTER TABLE ONLY incident_management_oncall_rotations ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_rotations_id_seq'::regclass);

ALTER TABLE ONLY incident_management_oncall_schedules ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_schedules_id_seq'::regclass);

ALTER TABLE ONLY incident_management_oncall_shifts ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_shifts_id_seq'::regclass);

ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass);

ALTER TABLE ONLY incident_management_pending_issue_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass);

ALTER TABLE ONLY incident_management_timeline_event_tag_links ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_event_tag_links_id_seq'::regclass);

ALTER TABLE ONLY incident_management_timeline_event_tags ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_event_tags_id_seq'::regclass);

ALTER TABLE ONLY incident_management_timeline_events ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_events_id_seq'::regclass);

ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statuses_id_seq'::regclass);

ALTER TABLE ONLY insights ALTER COLUMN id SET DEFAULT nextval('insights_id_seq'::regclass);

ALTER TABLE ONLY instance_audit_events_streaming_headers ALTER COLUMN id SET DEFAULT nextval('instance_audit_events_streaming_headers_id_seq'::regclass);

ALTER TABLE ONLY instance_integrations ALTER COLUMN id SET DEFAULT nextval('instance_integrations_id_seq'::regclass);

ALTER TABLE ONLY integrations ALTER COLUMN id SET DEFAULT nextval('integrations_id_seq'::regclass);

ALTER TABLE ONLY internal_ids ALTER COLUMN id SET DEFAULT nextval('internal_ids_id_seq'::regclass);

ALTER TABLE ONLY ip_restrictions ALTER COLUMN id SET DEFAULT nextval('ip_restrictions_id_seq'::regclass);

ALTER TABLE ONLY issuable_metric_images ALTER COLUMN id SET DEFAULT nextval('issuable_metric_images_id_seq'::regclass);

ALTER TABLE ONLY issuable_resource_links ALTER COLUMN id SET DEFAULT nextval('issuable_resource_links_id_seq'::regclass);

ALTER TABLE ONLY issuable_severities ALTER COLUMN id SET DEFAULT nextval('issuable_severities_id_seq'::regclass);

ALTER TABLE ONLY issuable_slas ALTER COLUMN id SET DEFAULT nextval('issuable_slas_id_seq'::regclass);

ALTER TABLE ONLY issue_assignment_events ALTER COLUMN id SET DEFAULT nextval('issue_assignment_events_id_seq'::regclass);

ALTER TABLE ONLY issue_customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('issue_customer_relations_contacts_id_seq'::regclass);

ALTER TABLE ONLY issue_email_participants ALTER COLUMN id SET DEFAULT nextval('issue_email_participants_id_seq'::regclass);

ALTER TABLE ONLY issue_emails ALTER COLUMN id SET DEFAULT nextval('issue_emails_id_seq'::regclass);

ALTER TABLE ONLY issue_links ALTER COLUMN id SET DEFAULT nextval('issue_links_id_seq'::regclass);

ALTER TABLE ONLY issue_metrics ALTER COLUMN id SET DEFAULT nextval('issue_metrics_id_seq'::regclass);

ALTER TABLE ONLY issue_tracker_data ALTER COLUMN id SET DEFAULT nextval('issue_tracker_data_id_seq'::regclass);

ALTER TABLE ONLY issue_user_mentions ALTER COLUMN id SET DEFAULT nextval('issue_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass);

ALTER TABLE ONLY iterations_cadences ALTER COLUMN id SET DEFAULT nextval('iterations_cadences_id_seq'::regclass);

ALTER TABLE ONLY jira_connect_installations ALTER COLUMN id SET DEFAULT nextval('jira_connect_installations_id_seq'::regclass);

ALTER TABLE ONLY jira_connect_subscriptions ALTER COLUMN id SET DEFAULT nextval('jira_connect_subscriptions_id_seq'::regclass);

ALTER TABLE ONLY jira_imports ALTER COLUMN id SET DEFAULT nextval('jira_imports_id_seq'::regclass);

ALTER TABLE ONLY jira_tracker_data ALTER COLUMN id SET DEFAULT nextval('jira_tracker_data_id_seq'::regclass);

ALTER TABLE ONLY keys ALTER COLUMN id SET DEFAULT nextval('keys_id_seq'::regclass);

ALTER TABLE ONLY label_links ALTER COLUMN id SET DEFAULT nextval('label_links_id_seq'::regclass);

ALTER TABLE ONLY label_priorities ALTER COLUMN id SET DEFAULT nextval('label_priorities_id_seq'::regclass);

ALTER TABLE ONLY labels ALTER COLUMN id SET DEFAULT nextval('labels_id_seq'::regclass);

ALTER TABLE ONLY ldap_group_links ALTER COLUMN id SET DEFAULT nextval('ldap_group_links_id_seq'::regclass);

ALTER TABLE ONLY lfs_file_locks ALTER COLUMN id SET DEFAULT nextval('lfs_file_locks_id_seq'::regclass);

ALTER TABLE ONLY lfs_object_states ALTER COLUMN lfs_object_id SET DEFAULT nextval('lfs_object_states_lfs_object_id_seq'::regclass);

ALTER TABLE ONLY lfs_objects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_id_seq'::regclass);

ALTER TABLE ONLY lfs_objects_projects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_projects_id_seq'::regclass);

ALTER TABLE ONLY licenses ALTER COLUMN id SET DEFAULT nextval('licenses_id_seq'::regclass);

ALTER TABLE ONLY list_user_preferences ALTER COLUMN id SET DEFAULT nextval('list_user_preferences_id_seq'::regclass);

ALTER TABLE ONLY lists ALTER COLUMN id SET DEFAULT nextval('lists_id_seq'::regclass);

ALTER TABLE ONLY loose_foreign_keys_deleted_records ALTER COLUMN id SET DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass);

ALTER TABLE ONLY member_approvals ALTER COLUMN id SET DEFAULT nextval('member_approvals_id_seq'::regclass);

ALTER TABLE ONLY member_roles ALTER COLUMN id SET DEFAULT nextval('member_roles_id_seq'::regclass);

ALTER TABLE ONLY members ALTER COLUMN id SET DEFAULT nextval('members_id_seq'::regclass);

ALTER TABLE ONLY members_deletion_schedules ALTER COLUMN id SET DEFAULT nextval('members_deletion_schedules_id_seq'::regclass);

ALTER TABLE ONLY merge_request_assignees ALTER COLUMN id SET DEFAULT nextval('merge_request_assignees_id_seq'::regclass);

ALTER TABLE ONLY merge_request_assignment_events ALTER COLUMN id SET DEFAULT nextval('merge_request_assignment_events_id_seq'::regclass);

ALTER TABLE ONLY merge_request_blocks ALTER COLUMN id SET DEFAULT nextval('merge_request_blocks_id_seq'::regclass);

ALTER TABLE ONLY merge_request_cleanup_schedules ALTER COLUMN merge_request_id SET DEFAULT nextval('merge_request_cleanup_schedules_merge_request_id_seq'::regclass);

ALTER TABLE ONLY merge_request_context_commits ALTER COLUMN id SET DEFAULT nextval('merge_request_context_commits_id_seq'::regclass);

ALTER TABLE ONLY merge_request_diff_commit_users ALTER COLUMN id SET DEFAULT nextval('merge_request_diff_commit_users_id_seq'::regclass);

ALTER TABLE ONLY merge_request_diff_details ALTER COLUMN merge_request_diff_id SET DEFAULT nextval('merge_request_diff_details_merge_request_diff_id_seq'::regclass);

ALTER TABLE ONLY merge_request_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass);

ALTER TABLE ONLY merge_request_merge_schedules ALTER COLUMN id SET DEFAULT nextval('merge_request_merge_schedules_id_seq'::regclass);

ALTER TABLE ONLY merge_request_metrics ALTER COLUMN id SET DEFAULT nextval('merge_request_metrics_id_seq'::regclass);

ALTER TABLE ONLY merge_request_predictions ALTER COLUMN merge_request_id SET DEFAULT nextval('merge_request_predictions_merge_request_id_seq'::regclass);

ALTER TABLE ONLY merge_request_requested_changes ALTER COLUMN id SET DEFAULT nextval('merge_request_requested_changes_id_seq'::regclass);

ALTER TABLE ONLY merge_request_reviewers ALTER COLUMN id SET DEFAULT nextval('merge_request_reviewers_id_seq'::regclass);

ALTER TABLE ONLY merge_request_user_mentions ALTER COLUMN id SET DEFAULT nextval('merge_request_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY merge_requests ALTER COLUMN id SET DEFAULT nextval('merge_requests_id_seq'::regclass);

ALTER TABLE ONLY merge_requests_closing_issues ALTER COLUMN id SET DEFAULT nextval('merge_requests_closing_issues_id_seq'::regclass);

ALTER TABLE ONLY merge_requests_compliance_violations ALTER COLUMN id SET DEFAULT nextval('merge_requests_compliance_violations_id_seq'::regclass);

ALTER TABLE ONLY merge_trains ALTER COLUMN id SET DEFAULT nextval('merge_trains_id_seq'::regclass);

ALTER TABLE ONLY metrics_dashboard_annotations ALTER COLUMN id SET DEFAULT nextval('metrics_dashboard_annotations_id_seq'::regclass);

ALTER TABLE ONLY metrics_users_starred_dashboards ALTER COLUMN id SET DEFAULT nextval('metrics_users_starred_dashboards_id_seq'::regclass);

ALTER TABLE ONLY milestones ALTER COLUMN id SET DEFAULT nextval('milestones_id_seq'::regclass);

ALTER TABLE ONLY ml_candidate_metadata ALTER COLUMN id SET DEFAULT nextval('ml_candidate_metadata_id_seq'::regclass);

ALTER TABLE ONLY ml_candidate_metrics ALTER COLUMN id SET DEFAULT nextval('ml_candidate_metrics_id_seq'::regclass);

ALTER TABLE ONLY ml_candidate_params ALTER COLUMN id SET DEFAULT nextval('ml_candidate_params_id_seq'::regclass);

ALTER TABLE ONLY ml_candidates ALTER COLUMN id SET DEFAULT nextval('ml_candidates_id_seq'::regclass);

ALTER TABLE ONLY ml_experiment_metadata ALTER COLUMN id SET DEFAULT nextval('ml_experiment_metadata_id_seq'::regclass);

ALTER TABLE ONLY ml_experiments ALTER COLUMN id SET DEFAULT nextval('ml_experiments_id_seq'::regclass);

ALTER TABLE ONLY ml_model_metadata ALTER COLUMN id SET DEFAULT nextval('ml_model_metadata_id_seq'::regclass);

ALTER TABLE ONLY ml_model_version_metadata ALTER COLUMN id SET DEFAULT nextval('ml_model_version_metadata_id_seq'::regclass);

ALTER TABLE ONLY ml_model_versions ALTER COLUMN id SET DEFAULT nextval('ml_model_versions_id_seq'::regclass);

ALTER TABLE ONLY ml_models ALTER COLUMN id SET DEFAULT nextval('ml_models_id_seq'::regclass);

ALTER TABLE ONLY namespace_admin_notes ALTER COLUMN id SET DEFAULT nextval('namespace_admin_notes_id_seq'::regclass);

ALTER TABLE ONLY namespace_bans ALTER COLUMN id SET DEFAULT nextval('namespace_bans_id_seq'::regclass);

ALTER TABLE ONLY namespace_commit_emails ALTER COLUMN id SET DEFAULT nextval('namespace_commit_emails_id_seq'::regclass);

ALTER TABLE ONLY namespace_import_users ALTER COLUMN id SET DEFAULT nextval('namespace_import_users_id_seq'::regclass);

ALTER TABLE ONLY namespace_statistics ALTER COLUMN id SET DEFAULT nextval('namespace_statistics_id_seq'::regclass);

ALTER TABLE ONLY namespaces ALTER COLUMN id SET DEFAULT nextval('namespaces_id_seq'::regclass);

ALTER TABLE ONLY namespaces_storage_limit_exclusions ALTER COLUMN id SET DEFAULT nextval('namespaces_storage_limit_exclusions_id_seq'::regclass);

ALTER TABLE ONLY namespaces_sync_events ALTER COLUMN id SET DEFAULT nextval('namespaces_sync_events_id_seq'::regclass);

ALTER TABLE ONLY note_diff_files ALTER COLUMN id SET DEFAULT nextval('note_diff_files_id_seq'::regclass);

ALTER TABLE ONLY note_metadata ALTER COLUMN note_id SET DEFAULT nextval('note_metadata_note_id_seq'::regclass);

ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass);

ALTER TABLE ONLY notification_settings ALTER COLUMN id SET DEFAULT nextval('notification_settings_id_seq'::regclass);

ALTER TABLE ONLY oauth_access_grants ALTER COLUMN id SET DEFAULT nextval('oauth_access_grants_id_seq'::regclass);

ALTER TABLE ONLY oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_access_tokens_id_seq'::regclass);

ALTER TABLE ONLY oauth_applications ALTER COLUMN id SET DEFAULT nextval('oauth_applications_id_seq'::regclass);

ALTER TABLE ONLY oauth_device_grants ALTER COLUMN id SET DEFAULT nextval('oauth_device_grants_id_seq'::regclass);

ALTER TABLE ONLY oauth_openid_requests ALTER COLUMN id SET DEFAULT nextval('oauth_openid_requests_id_seq'::regclass);

ALTER TABLE ONLY observability_logs_issues_connections ALTER COLUMN id SET DEFAULT nextval('observability_logs_issues_connections_id_seq'::regclass);

ALTER TABLE ONLY observability_metrics_issues_connections ALTER COLUMN id SET DEFAULT nextval('observability_metrics_issues_connections_id_seq'::regclass);

ALTER TABLE ONLY observability_traces_issues_connections ALTER COLUMN id SET DEFAULT nextval('observability_traces_issues_connections_id_seq'::regclass);

ALTER TABLE ONLY onboarding_progresses ALTER COLUMN id SET DEFAULT nextval('onboarding_progresses_id_seq'::regclass);

ALTER TABLE ONLY operations_feature_flag_scopes ALTER COLUMN id SET DEFAULT nextval('operations_feature_flag_scopes_id_seq'::regclass);

ALTER TABLE ONLY operations_feature_flags ALTER COLUMN id SET DEFAULT nextval('operations_feature_flags_id_seq'::regclass);

ALTER TABLE ONLY operations_feature_flags_clients ALTER COLUMN id SET DEFAULT nextval('operations_feature_flags_clients_id_seq'::regclass);

ALTER TABLE ONLY operations_feature_flags_issues ALTER COLUMN id SET DEFAULT nextval('operations_feature_flags_issues_id_seq'::regclass);

ALTER TABLE ONLY operations_scopes ALTER COLUMN id SET DEFAULT nextval('operations_scopes_id_seq'::regclass);

ALTER TABLE ONLY operations_strategies ALTER COLUMN id SET DEFAULT nextval('operations_strategies_id_seq'::regclass);

ALTER TABLE ONLY operations_strategies_user_lists ALTER COLUMN id SET DEFAULT nextval('operations_strategies_user_lists_id_seq'::regclass);

ALTER TABLE ONLY operations_user_lists ALTER COLUMN id SET DEFAULT nextval('operations_user_lists_id_seq'::regclass);

ALTER TABLE ONLY organization_users ALTER COLUMN id SET DEFAULT nextval('organization_users_id_seq'::regclass);

ALTER TABLE ONLY organizations ALTER COLUMN id SET DEFAULT nextval('organizations_id_seq'::regclass);

ALTER TABLE ONLY p_batched_git_ref_updates_deletions ALTER COLUMN id SET DEFAULT nextval('p_batched_git_ref_updates_deletions_id_seq'::regclass);

ALTER TABLE ONLY p_catalog_resource_component_usages ALTER COLUMN id SET DEFAULT nextval('p_catalog_resource_component_usages_id_seq'::regclass);

ALTER TABLE ONLY p_catalog_resource_sync_events ALTER COLUMN id SET DEFAULT nextval('p_catalog_resource_sync_events_id_seq'::regclass);

ALTER TABLE ONLY p_ci_builds_metadata ALTER COLUMN id SET DEFAULT nextval('ci_builds_metadata_id_seq'::regclass);

ALTER TABLE ONLY packages_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_build_infos_id_seq'::regclass);

ALTER TABLE ONLY packages_conan_file_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_file_metadata_id_seq'::regclass);

ALTER TABLE ONLY packages_conan_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_metadata_id_seq'::regclass);

ALTER TABLE ONLY packages_conan_package_references ALTER COLUMN id SET DEFAULT nextval('packages_conan_package_references_id_seq'::regclass);

ALTER TABLE ONLY packages_conan_package_revisions ALTER COLUMN id SET DEFAULT nextval('packages_conan_package_revisions_id_seq'::regclass);

ALTER TABLE ONLY packages_conan_recipe_revisions ALTER COLUMN id SET DEFAULT nextval('packages_conan_recipe_revisions_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_group_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_architectures_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_group_component_files ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_component_files_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_group_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_components_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_group_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distribution_keys_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_group_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distributions_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_project_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_architectures_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_project_component_files ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_component_files_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_project_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_components_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_project_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distribution_keys_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_project_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distributions_id_seq'::regclass);

ALTER TABLE ONLY packages_debian_publications ALTER COLUMN id SET DEFAULT nextval('packages_debian_publications_id_seq'::regclass);

ALTER TABLE ONLY packages_dependencies ALTER COLUMN id SET DEFAULT nextval('packages_dependencies_id_seq'::regclass);

ALTER TABLE ONLY packages_dependency_links ALTER COLUMN id SET DEFAULT nextval('packages_dependency_links_id_seq'::regclass);

ALTER TABLE ONLY packages_maven_metadata ALTER COLUMN id SET DEFAULT nextval('packages_maven_metadata_id_seq'::regclass);

ALTER TABLE ONLY packages_npm_metadata_caches ALTER COLUMN id SET DEFAULT nextval('packages_npm_metadata_caches_id_seq'::regclass);

ALTER TABLE ONLY packages_nuget_symbols ALTER COLUMN id SET DEFAULT nextval('packages_nuget_symbols_id_seq'::regclass);

ALTER TABLE ONLY packages_package_file_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_package_file_build_infos_id_seq'::regclass);

ALTER TABLE ONLY packages_package_files ALTER COLUMN id SET DEFAULT nextval('packages_package_files_id_seq'::regclass);

ALTER TABLE ONLY packages_packages ALTER COLUMN id SET DEFAULT nextval('packages_packages_id_seq'::regclass);

ALTER TABLE ONLY packages_protection_rules ALTER COLUMN id SET DEFAULT nextval('packages_protection_rules_id_seq'::regclass);

ALTER TABLE ONLY packages_rpm_repository_files ALTER COLUMN id SET DEFAULT nextval('packages_rpm_repository_files_id_seq'::regclass);

ALTER TABLE ONLY packages_tags ALTER COLUMN id SET DEFAULT nextval('packages_tags_id_seq'::regclass);

ALTER TABLE ONLY pages_deployment_states ALTER COLUMN pages_deployment_id SET DEFAULT nextval('pages_deployment_states_pages_deployment_id_seq'::regclass);

ALTER TABLE ONLY pages_deployments ALTER COLUMN id SET DEFAULT nextval('pages_deployments_id_seq'::regclass);

ALTER TABLE ONLY pages_domain_acme_orders ALTER COLUMN id SET DEFAULT nextval('pages_domain_acme_orders_id_seq'::regclass);

ALTER TABLE ONLY pages_domains ALTER COLUMN id SET DEFAULT nextval('pages_domains_id_seq'::regclass);

ALTER TABLE ONLY path_locks ALTER COLUMN id SET DEFAULT nextval('path_locks_id_seq'::regclass);

ALTER TABLE ONLY personal_access_tokens ALTER COLUMN id SET DEFAULT nextval('personal_access_tokens_id_seq'::regclass);

ALTER TABLE ONLY plan_limits ALTER COLUMN id SET DEFAULT nextval('plan_limits_id_seq'::regclass);

ALTER TABLE ONLY plans ALTER COLUMN id SET DEFAULT nextval('plans_id_seq'::regclass);

ALTER TABLE ONLY pm_advisories ALTER COLUMN id SET DEFAULT nextval('pm_advisories_id_seq'::regclass);

ALTER TABLE ONLY pm_affected_packages ALTER COLUMN id SET DEFAULT nextval('pm_affected_packages_id_seq'::regclass);

ALTER TABLE ONLY pm_checkpoints ALTER COLUMN id SET DEFAULT nextval('pm_checkpoints_id_seq'::regclass);

ALTER TABLE ONLY pm_cve_enrichment ALTER COLUMN id SET DEFAULT nextval('pm_cve_enrichment_id_seq'::regclass);

ALTER TABLE ONLY pm_licenses ALTER COLUMN id SET DEFAULT nextval('pm_licenses_id_seq'::regclass);

ALTER TABLE ONLY pm_package_version_licenses ALTER COLUMN id SET DEFAULT nextval('pm_package_version_licenses_id_seq'::regclass);

ALTER TABLE ONLY pm_package_versions ALTER COLUMN id SET DEFAULT nextval('pm_package_versions_id_seq'::regclass);

ALTER TABLE ONLY pm_packages ALTER COLUMN id SET DEFAULT nextval('pm_packages_id_seq'::regclass);

ALTER TABLE ONLY pool_repositories ALTER COLUMN id SET DEFAULT nextval('pool_repositories_id_seq'::regclass);

ALTER TABLE ONLY postgres_async_foreign_key_validations ALTER COLUMN id SET DEFAULT nextval('postgres_async_foreign_key_validations_id_seq'::regclass);

ALTER TABLE ONLY postgres_async_indexes ALTER COLUMN id SET DEFAULT nextval('postgres_async_indexes_id_seq'::regclass);

ALTER TABLE ONLY postgres_reindex_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_actions_id_seq'::regclass);

ALTER TABLE ONLY postgres_reindex_queued_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_queued_actions_id_seq'::regclass);

ALTER TABLE ONLY programming_languages ALTER COLUMN id SET DEFAULT nextval('programming_languages_id_seq'::regclass);

ALTER TABLE ONLY project_aliases ALTER COLUMN id SET DEFAULT nextval('project_aliases_id_seq'::regclass);

ALTER TABLE ONLY project_auto_devops ALTER COLUMN id SET DEFAULT nextval('project_auto_devops_id_seq'::regclass);

ALTER TABLE ONLY project_build_artifacts_size_refreshes ALTER COLUMN id SET DEFAULT nextval('project_build_artifacts_size_refreshes_id_seq'::regclass);

ALTER TABLE ONLY project_ci_cd_settings ALTER COLUMN id SET DEFAULT nextval('project_ci_cd_settings_id_seq'::regclass);

ALTER TABLE ONLY project_ci_feature_usages ALTER COLUMN id SET DEFAULT nextval('project_ci_feature_usages_id_seq'::regclass);

ALTER TABLE ONLY project_compliance_framework_settings ALTER COLUMN project_id SET DEFAULT nextval('project_compliance_framework_settings_project_id_seq'::regclass);

ALTER TABLE ONLY project_compliance_framework_settings ALTER COLUMN id SET DEFAULT nextval('project_compliance_framework_settings_id_seq'::regclass);

ALTER TABLE ONLY project_compliance_standards_adherence ALTER COLUMN id SET DEFAULT nextval('project_compliance_standards_adherence_id_seq'::regclass);

ALTER TABLE ONLY project_custom_attributes ALTER COLUMN id SET DEFAULT nextval('project_custom_attributes_id_seq'::regclass);

ALTER TABLE ONLY project_daily_statistics ALTER COLUMN id SET DEFAULT nextval('project_daily_statistics_id_seq'::regclass);

ALTER TABLE ONLY project_data_transfers ALTER COLUMN id SET DEFAULT nextval('project_data_transfers_id_seq'::regclass);

ALTER TABLE ONLY project_deploy_tokens ALTER COLUMN id SET DEFAULT nextval('project_deploy_tokens_id_seq'::regclass);

ALTER TABLE ONLY project_export_jobs ALTER COLUMN id SET DEFAULT nextval('project_export_jobs_id_seq'::regclass);

ALTER TABLE ONLY project_features ALTER COLUMN id SET DEFAULT nextval('project_features_id_seq'::regclass);

ALTER TABLE ONLY project_group_links ALTER COLUMN id SET DEFAULT nextval('project_group_links_id_seq'::regclass);

ALTER TABLE ONLY project_import_data ALTER COLUMN id SET DEFAULT nextval('project_import_data_id_seq'::regclass);

ALTER TABLE ONLY project_incident_management_settings ALTER COLUMN project_id SET DEFAULT nextval('project_incident_management_settings_project_id_seq'::regclass);

ALTER TABLE ONLY project_mirror_data ALTER COLUMN id SET DEFAULT nextval('project_mirror_data_id_seq'::regclass);

ALTER TABLE ONLY project_relation_export_uploads ALTER COLUMN id SET DEFAULT nextval('project_relation_export_uploads_id_seq'::regclass);

ALTER TABLE ONLY project_relation_exports ALTER COLUMN id SET DEFAULT nextval('project_relation_exports_id_seq'::regclass);

ALTER TABLE ONLY project_repositories ALTER COLUMN id SET DEFAULT nextval('project_repositories_id_seq'::regclass);

ALTER TABLE ONLY project_repository_storage_moves ALTER COLUMN id SET DEFAULT nextval('project_repository_storage_moves_id_seq'::regclass);

ALTER TABLE ONLY project_saved_replies ALTER COLUMN id SET DEFAULT nextval('project_saved_replies_id_seq'::regclass);

ALTER TABLE ONLY project_secrets_managers ALTER COLUMN id SET DEFAULT nextval('project_secrets_managers_id_seq'::regclass);

ALTER TABLE ONLY project_security_exclusions ALTER COLUMN id SET DEFAULT nextval('project_security_exclusions_id_seq'::regclass);

ALTER TABLE ONLY project_security_settings ALTER COLUMN project_id SET DEFAULT nextval('project_security_settings_project_id_seq'::regclass);

ALTER TABLE ONLY project_states ALTER COLUMN id SET DEFAULT nextval('project_states_id_seq'::regclass);

ALTER TABLE ONLY project_statistics ALTER COLUMN id SET DEFAULT nextval('project_statistics_id_seq'::regclass);

ALTER TABLE ONLY project_topics ALTER COLUMN id SET DEFAULT nextval('project_topics_id_seq'::regclass);

ALTER TABLE ONLY project_wiki_repositories ALTER COLUMN id SET DEFAULT nextval('project_wiki_repositories_id_seq'::regclass);

ALTER TABLE ONLY projects ALTER COLUMN id SET DEFAULT nextval('projects_id_seq'::regclass);

ALTER TABLE ONLY projects_sync_events ALTER COLUMN id SET DEFAULT nextval('projects_sync_events_id_seq'::regclass);

ALTER TABLE ONLY projects_visits ALTER COLUMN id SET DEFAULT nextval('projects_visits_id_seq'::regclass);

ALTER TABLE ONLY protected_branch_merge_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_merge_access_levels_id_seq'::regclass);

ALTER TABLE ONLY protected_branch_push_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_push_access_levels_id_seq'::regclass);

ALTER TABLE ONLY protected_branch_unprotect_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_unprotect_access_levels_id_seq'::regclass);

ALTER TABLE ONLY protected_branches ALTER COLUMN id SET DEFAULT nextval('protected_branches_id_seq'::regclass);

ALTER TABLE ONLY protected_environment_approval_rules ALTER COLUMN id SET DEFAULT nextval('protected_environment_approval_rules_id_seq'::regclass);

ALTER TABLE ONLY protected_environment_deploy_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_environment_deploy_access_levels_id_seq'::regclass);

ALTER TABLE ONLY protected_environments ALTER COLUMN id SET DEFAULT nextval('protected_environments_id_seq'::regclass);

ALTER TABLE ONLY protected_tag_create_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_tag_create_access_levels_id_seq'::regclass);

ALTER TABLE ONLY protected_tags ALTER COLUMN id SET DEFAULT nextval('protected_tags_id_seq'::regclass);

ALTER TABLE ONLY push_rules ALTER COLUMN id SET DEFAULT nextval('push_rules_id_seq'::regclass);

ALTER TABLE ONLY raw_usage_data ALTER COLUMN id SET DEFAULT nextval('raw_usage_data_id_seq'::regclass);

ALTER TABLE ONLY redirect_routes ALTER COLUMN id SET DEFAULT nextval('redirect_routes_id_seq'::regclass);

ALTER TABLE ONLY related_epic_links ALTER COLUMN id SET DEFAULT nextval('related_epic_links_id_seq'::regclass);

ALTER TABLE ONLY relation_import_trackers ALTER COLUMN id SET DEFAULT nextval('relation_import_trackers_id_seq'::regclass);

ALTER TABLE ONLY release_links ALTER COLUMN id SET DEFAULT nextval('release_links_id_seq'::regclass);

ALTER TABLE ONLY releases ALTER COLUMN id SET DEFAULT nextval('releases_id_seq'::regclass);

ALTER TABLE ONLY remote_development_agent_configs ALTER COLUMN id SET DEFAULT nextval('remote_development_agent_configs_id_seq'::regclass);

ALTER TABLE ONLY remote_development_namespace_cluster_agent_mappings ALTER COLUMN id SET DEFAULT nextval('remote_development_namespace_cluster_agent_mappings_id_seq'::regclass);

ALTER TABLE ONLY remote_mirrors ALTER COLUMN id SET DEFAULT nextval('remote_mirrors_id_seq'::regclass);

ALTER TABLE ONLY required_code_owners_sections ALTER COLUMN id SET DEFAULT nextval('required_code_owners_sections_id_seq'::regclass);

ALTER TABLE ONLY requirements ALTER COLUMN id SET DEFAULT nextval('requirements_id_seq'::regclass);

ALTER TABLE ONLY requirements_management_test_reports ALTER COLUMN id SET DEFAULT nextval('requirements_management_test_reports_id_seq'::regclass);

ALTER TABLE ONLY resource_iteration_events ALTER COLUMN id SET DEFAULT nextval('resource_iteration_events_id_seq'::regclass);

ALTER TABLE ONLY resource_label_events ALTER COLUMN id SET DEFAULT nextval('resource_label_events_id_seq'::regclass);

ALTER TABLE ONLY resource_link_events ALTER COLUMN id SET DEFAULT nextval('resource_link_events_id_seq'::regclass);

ALTER TABLE ONLY resource_milestone_events ALTER COLUMN id SET DEFAULT nextval('resource_milestone_events_id_seq'::regclass);

ALTER TABLE ONLY resource_state_events ALTER COLUMN id SET DEFAULT nextval('resource_state_events_id_seq'::regclass);

ALTER TABLE ONLY resource_weight_events ALTER COLUMN id SET DEFAULT nextval('resource_weight_events_id_seq'::regclass);

ALTER TABLE ONLY reviews ALTER COLUMN id SET DEFAULT nextval('reviews_id_seq'::regclass);

ALTER TABLE ONLY routes ALTER COLUMN id SET DEFAULT nextval('routes_id_seq'::regclass);

ALTER TABLE ONLY saml_group_links ALTER COLUMN id SET DEFAULT nextval('saml_group_links_id_seq'::regclass);

ALTER TABLE ONLY saml_providers ALTER COLUMN id SET DEFAULT nextval('saml_providers_id_seq'::regclass);

ALTER TABLE ONLY saved_replies ALTER COLUMN id SET DEFAULT nextval('saved_replies_id_seq'::regclass);

ALTER TABLE ONLY sbom_component_versions ALTER COLUMN id SET DEFAULT nextval('sbom_component_versions_id_seq'::regclass);

ALTER TABLE ONLY sbom_components ALTER COLUMN id SET DEFAULT nextval('sbom_components_id_seq'::regclass);

ALTER TABLE ONLY sbom_occurrences ALTER COLUMN id SET DEFAULT nextval('sbom_occurrences_id_seq'::regclass);

ALTER TABLE ONLY sbom_occurrences_vulnerabilities ALTER COLUMN id SET DEFAULT nextval('sbom_occurrences_vulnerabilities_id_seq'::regclass);

ALTER TABLE ONLY sbom_source_packages ALTER COLUMN id SET DEFAULT nextval('sbom_source_packages_id_seq'::regclass);

ALTER TABLE ONLY sbom_sources ALTER COLUMN id SET DEFAULT nextval('sbom_sources_id_seq'::regclass);

ALTER TABLE ONLY scan_execution_policy_rules ALTER COLUMN id SET DEFAULT nextval('scan_execution_policy_rules_id_seq'::regclass);

ALTER TABLE ONLY scan_result_policies ALTER COLUMN id SET DEFAULT nextval('scan_result_policies_id_seq'::regclass);

ALTER TABLE ONLY scan_result_policy_violations ALTER COLUMN id SET DEFAULT nextval('scan_result_policy_violations_id_seq'::regclass);

ALTER TABLE ONLY scim_identities ALTER COLUMN id SET DEFAULT nextval('scim_identities_id_seq'::regclass);

ALTER TABLE ONLY scim_oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('scim_oauth_access_tokens_id_seq'::regclass);

ALTER TABLE ONLY security_findings ALTER COLUMN id SET DEFAULT nextval('security_findings_id_seq'::regclass);

ALTER TABLE ONLY security_orchestration_policy_configurations ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_configurations_id_seq'::regclass);

ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_rule_schedules_id_seq'::regclass);

ALTER TABLE ONLY security_policies ALTER COLUMN id SET DEFAULT nextval('security_policies_id_seq'::regclass);

ALTER TABLE ONLY security_policy_project_links ALTER COLUMN id SET DEFAULT nextval('security_policy_project_links_id_seq'::regclass);

ALTER TABLE ONLY security_policy_requirements ALTER COLUMN id SET DEFAULT nextval('security_policy_requirements_id_seq'::regclass);

ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_id_seq'::regclass);

ALTER TABLE ONLY security_training_providers ALTER COLUMN id SET DEFAULT nextval('security_training_providers_id_seq'::regclass);

ALTER TABLE ONLY security_trainings ALTER COLUMN id SET DEFAULT nextval('security_trainings_id_seq'::regclass);

ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_notifications_id_seq'::regclass);

ALTER TABLE ONLY sentry_issues ALTER COLUMN id SET DEFAULT nextval('sentry_issues_id_seq'::regclass);

ALTER TABLE ONLY service_access_tokens ALTER COLUMN id SET DEFAULT nextval('service_access_tokens_id_seq'::regclass);

ALTER TABLE ONLY shards ALTER COLUMN id SET DEFAULT nextval('shards_id_seq'::regclass);

ALTER TABLE ONLY slack_api_scopes ALTER COLUMN id SET DEFAULT nextval('slack_api_scopes_id_seq'::regclass);

ALTER TABLE ONLY slack_integrations ALTER COLUMN id SET DEFAULT nextval('slack_integrations_id_seq'::regclass);

ALTER TABLE ONLY slack_integrations_scopes ALTER COLUMN id SET DEFAULT nextval('slack_integrations_scopes_id_seq'::regclass);

ALTER TABLE ONLY smartcard_identities ALTER COLUMN id SET DEFAULT nextval('smartcard_identities_id_seq'::regclass);

ALTER TABLE ONLY snippet_repository_storage_moves ALTER COLUMN id SET DEFAULT nextval('snippet_repository_storage_moves_id_seq'::regclass);

ALTER TABLE ONLY snippet_user_mentions ALTER COLUMN id SET DEFAULT nextval('snippet_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY snippets ALTER COLUMN id SET DEFAULT nextval('snippets_id_seq'::regclass);

ALTER TABLE ONLY software_license_policies ALTER COLUMN id SET DEFAULT nextval('software_license_policies_id_seq'::regclass);

ALTER TABLE ONLY software_licenses ALTER COLUMN id SET DEFAULT nextval('software_licenses_id_seq'::regclass);

ALTER TABLE ONLY spam_logs ALTER COLUMN id SET DEFAULT nextval('spam_logs_id_seq'::regclass);

ALTER TABLE ONLY sprints ALTER COLUMN id SET DEFAULT nextval('sprints_id_seq'::regclass);

ALTER TABLE ONLY ssh_signatures ALTER COLUMN id SET DEFAULT nextval('ssh_signatures_id_seq'::regclass);

ALTER TABLE ONLY status_check_responses ALTER COLUMN id SET DEFAULT nextval('status_check_responses_id_seq'::regclass);

ALTER TABLE ONLY status_page_published_incidents ALTER COLUMN id SET DEFAULT nextval('status_page_published_incidents_id_seq'::regclass);

ALTER TABLE ONLY status_page_settings ALTER COLUMN project_id SET DEFAULT nextval('status_page_settings_project_id_seq'::regclass);

ALTER TABLE ONLY subscription_add_on_purchases ALTER COLUMN id SET DEFAULT nextval('subscription_add_on_purchases_id_seq'::regclass);

ALTER TABLE ONLY subscription_add_ons ALTER COLUMN id SET DEFAULT nextval('subscription_add_ons_id_seq'::regclass);

ALTER TABLE ONLY subscription_seat_assignments ALTER COLUMN id SET DEFAULT nextval('subscription_seat_assignments_id_seq'::regclass);

ALTER TABLE ONLY subscription_user_add_on_assignment_versions ALTER COLUMN id SET DEFAULT nextval('subscription_user_add_on_assignment_versions_id_seq'::regclass);

ALTER TABLE ONLY subscription_user_add_on_assignments ALTER COLUMN id SET DEFAULT nextval('subscription_user_add_on_assignments_id_seq'::regclass);

ALTER TABLE ONLY subscriptions ALTER COLUMN id SET DEFAULT nextval('subscriptions_id_seq'::regclass);

ALTER TABLE ONLY suggestions ALTER COLUMN id SET DEFAULT nextval('suggestions_id_seq'::regclass);

ALTER TABLE ONLY system_access_instance_microsoft_applications ALTER COLUMN id SET DEFAULT nextval('system_access_instance_microsoft_applications_id_seq'::regclass);

ALTER TABLE ONLY system_access_instance_microsoft_graph_access_tokens ALTER COLUMN id SET DEFAULT nextval('system_access_instance_microsoft_graph_access_tokens_id_seq'::regclass);

ALTER TABLE ONLY system_access_microsoft_applications ALTER COLUMN id SET DEFAULT nextval('system_access_microsoft_applications_id_seq'::regclass);

ALTER TABLE ONLY system_access_microsoft_graph_access_tokens ALTER COLUMN id SET DEFAULT nextval('system_access_microsoft_graph_access_tokens_id_seq'::regclass);

ALTER TABLE ONLY system_note_metadata ALTER COLUMN id SET DEFAULT nextval('system_note_metadata_id_seq'::regclass);

ALTER TABLE ONLY taggings ALTER COLUMN id SET DEFAULT nextval('taggings_id_seq'::regclass);

ALTER TABLE ONLY tags ALTER COLUMN id SET DEFAULT nextval('tags_id_seq'::regclass);

ALTER TABLE ONLY target_branch_rules ALTER COLUMN id SET DEFAULT nextval('target_branch_rules_id_seq'::regclass);

ALTER TABLE ONLY term_agreements ALTER COLUMN id SET DEFAULT nextval('term_agreements_id_seq'::regclass);

ALTER TABLE ONLY terraform_state_versions ALTER COLUMN id SET DEFAULT nextval('terraform_state_versions_id_seq'::regclass);

ALTER TABLE ONLY terraform_states ALTER COLUMN id SET DEFAULT nextval('terraform_states_id_seq'::regclass);

ALTER TABLE ONLY timelog_categories ALTER COLUMN id SET DEFAULT nextval('timelog_categories_id_seq'::regclass);

ALTER TABLE ONLY timelogs ALTER COLUMN id SET DEFAULT nextval('timelogs_id_seq'::regclass);

ALTER TABLE ONLY todos ALTER COLUMN id SET DEFAULT nextval('todos_id_seq'::regclass);

ALTER TABLE ONLY topics ALTER COLUMN id SET DEFAULT nextval('topics_id_seq'::regclass);

ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending_projects_id_seq'::regclass);

ALTER TABLE ONLY upcoming_reconciliations ALTER COLUMN id SET DEFAULT nextval('upcoming_reconciliations_id_seq'::regclass);

ALTER TABLE ONLY upload_states ALTER COLUMN upload_id SET DEFAULT nextval('upload_states_upload_id_seq'::regclass);

ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass);

ALTER TABLE ONLY user_achievements ALTER COLUMN id SET DEFAULT nextval('user_achievements_id_seq'::regclass);

ALTER TABLE ONLY user_agent_details ALTER COLUMN id SET DEFAULT nextval('user_agent_details_id_seq'::regclass);

ALTER TABLE ONLY user_broadcast_message_dismissals ALTER COLUMN id SET DEFAULT nextval('user_broadcast_message_dismissals_id_seq'::regclass);

ALTER TABLE ONLY user_callouts ALTER COLUMN id SET DEFAULT nextval('user_callouts_id_seq'::regclass);

ALTER TABLE ONLY user_custom_attributes ALTER COLUMN id SET DEFAULT nextval('user_custom_attributes_id_seq'::regclass);

ALTER TABLE ONLY user_details ALTER COLUMN user_id SET DEFAULT nextval('user_details_user_id_seq'::regclass);

ALTER TABLE ONLY user_group_callouts ALTER COLUMN id SET DEFAULT nextval('user_group_callouts_id_seq'::regclass);

ALTER TABLE ONLY user_member_roles ALTER COLUMN id SET DEFAULT nextval('user_member_roles_id_seq'::regclass);

ALTER TABLE ONLY user_namespace_callouts ALTER COLUMN id SET DEFAULT nextval('user_namespace_callouts_id_seq'::regclass);

ALTER TABLE ONLY user_permission_export_uploads ALTER COLUMN id SET DEFAULT nextval('user_permission_export_uploads_id_seq'::regclass);

ALTER TABLE ONLY user_preferences ALTER COLUMN id SET DEFAULT nextval('user_preferences_id_seq'::regclass);

ALTER TABLE ONLY user_project_callouts ALTER COLUMN id SET DEFAULT nextval('user_project_callouts_id_seq'::regclass);

ALTER TABLE ONLY user_statuses ALTER COLUMN user_id SET DEFAULT nextval('user_statuses_user_id_seq'::regclass);

ALTER TABLE ONLY user_synced_attributes_metadata ALTER COLUMN id SET DEFAULT nextval('user_synced_attributes_metadata_id_seq'::regclass);

ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);

ALTER TABLE ONLY users_ops_dashboard_projects ALTER COLUMN id SET DEFAULT nextval('users_ops_dashboard_projects_id_seq'::regclass);

ALTER TABLE ONLY users_star_projects ALTER COLUMN id SET DEFAULT nextval('users_star_projects_id_seq'::regclass);

ALTER TABLE ONLY users_statistics ALTER COLUMN id SET DEFAULT nextval('users_statistics_id_seq'::regclass);

ALTER TABLE ONLY value_stream_dashboard_counts ALTER COLUMN id SET DEFAULT nextval('value_stream_dashboard_counts_id_seq'::regclass);

ALTER TABLE ONLY virtual_registries_packages_maven_cached_responses ALTER COLUMN id SET DEFAULT nextval('virtual_registries_packages_maven_cached_responses_id_seq'::regclass);

ALTER TABLE ONLY virtual_registries_packages_maven_registries ALTER COLUMN id SET DEFAULT nextval('virtual_registries_packages_maven_registries_id_seq'::regclass);

ALTER TABLE ONLY virtual_registries_packages_maven_registry_upstreams ALTER COLUMN id SET DEFAULT nextval('virtual_registries_packages_maven_registry_upstreams_id_seq'::regclass);

ALTER TABLE ONLY virtual_registries_packages_maven_upstreams ALTER COLUMN id SET DEFAULT nextval('virtual_registries_packages_maven_upstreams_id_seq'::regclass);

ALTER TABLE ONLY vs_code_settings ALTER COLUMN id SET DEFAULT nextval('vs_code_settings_id_seq'::regclass);

ALTER TABLE ONLY vulnerabilities ALTER COLUMN id SET DEFAULT nextval('vulnerabilities_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_export_parts ALTER COLUMN id SET DEFAULT nextval('vulnerability_export_parts_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_exports ALTER COLUMN id SET DEFAULT nextval('vulnerability_exports_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_external_issue_links_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_finding_signatures ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_signatures_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_findings_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_findings_remediations_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_flags ALTER COLUMN id SET DEFAULT nextval('vulnerability_flags_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_historical_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_historical_statistics_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_identifiers ALTER COLUMN id SET DEFAULT nextval('vulnerability_identifiers_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_issue_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_issue_links_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_management_policy_rules ALTER COLUMN id SET DEFAULT nextval('vulnerability_management_policy_rules_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_merge_request_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_merge_request_links_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_namespace_historical_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_namespace_historical_statistics_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_occurrence_identifiers ALTER COLUMN id SET DEFAULT nextval('vulnerability_occurrence_identifiers_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_occurrences ALTER COLUMN id SET DEFAULT nextval('vulnerability_occurrences_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_reads ALTER COLUMN id SET DEFAULT nextval('vulnerability_reads_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_remediations_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_scanners ALTER COLUMN id SET DEFAULT nextval('vulnerability_scanners_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_state_transitions ALTER COLUMN id SET DEFAULT nextval('vulnerability_state_transitions_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_statistics_id_seq'::regclass);

ALTER TABLE ONLY vulnerability_user_mentions ALTER COLUMN id SET DEFAULT nextval('vulnerability_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY web_hook_logs ALTER COLUMN id SET DEFAULT nextval('web_hook_logs_id_seq'::regclass);

ALTER TABLE ONLY web_hooks ALTER COLUMN id SET DEFAULT nextval('web_hooks_id_seq'::regclass);

ALTER TABLE ONLY webauthn_registrations ALTER COLUMN id SET DEFAULT nextval('webauthn_registrations_id_seq'::regclass);

ALTER TABLE ONLY wiki_page_meta ALTER COLUMN id SET DEFAULT nextval('wiki_page_meta_id_seq'::regclass);

ALTER TABLE ONLY wiki_page_meta_user_mentions ALTER COLUMN id SET DEFAULT nextval('wiki_page_meta_user_mentions_id_seq'::regclass);

ALTER TABLE ONLY wiki_page_slugs ALTER COLUMN id SET DEFAULT nextval('wiki_page_slugs_id_seq'::regclass);

ALTER TABLE ONLY wiki_repository_states ALTER COLUMN id SET DEFAULT nextval('wiki_repository_states_id_seq'::regclass);

ALTER TABLE ONLY work_item_hierarchy_restrictions ALTER COLUMN id SET DEFAULT nextval('work_item_hierarchy_restrictions_id_seq'::regclass);

ALTER TABLE ONLY work_item_parent_links ALTER COLUMN id SET DEFAULT nextval('work_item_parent_links_id_seq'::regclass);

ALTER TABLE ONLY work_item_related_link_restrictions ALTER COLUMN id SET DEFAULT nextval('work_item_related_link_restrictions_id_seq'::regclass);

ALTER TABLE ONLY work_item_type_custom_fields ALTER COLUMN id SET DEFAULT nextval('work_item_type_custom_fields_id_seq'::regclass);

ALTER TABLE ONLY work_item_widget_definitions ALTER COLUMN id SET DEFAULT nextval('work_item_widget_definitions_id_seq'::regclass);

ALTER TABLE ONLY workspace_variables ALTER COLUMN id SET DEFAULT nextval('workspace_variables_id_seq'::regclass);

ALTER TABLE ONLY workspaces ALTER COLUMN id SET DEFAULT nextval('workspaces_id_seq'::regclass);

ALTER TABLE ONLY workspaces_agent_config_versions ALTER COLUMN id SET DEFAULT nextval('workspaces_agent_config_versions_id_seq'::regclass);

ALTER TABLE ONLY workspaces_agent_configs ALTER COLUMN id SET DEFAULT nextval('workspaces_agent_configs_id_seq'::regclass);

ALTER TABLE ONLY x509_certificates ALTER COLUMN id SET DEFAULT nextval('x509_certificates_id_seq'::regclass);

ALTER TABLE ONLY x509_commit_signatures ALTER COLUMN id SET DEFAULT nextval('x509_commit_signatures_id_seq'::regclass);

ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_id_seq'::regclass);

ALTER TABLE ONLY xray_reports ALTER COLUMN id SET DEFAULT nextval('xray_reports_id_seq'::regclass);

ALTER TABLE ONLY zentao_tracker_data ALTER COLUMN id SET DEFAULT nextval('zentao_tracker_data_id_seq'::regclass);

ALTER TABLE ONLY zoekt_enabled_namespaces ALTER COLUMN id SET DEFAULT nextval('zoekt_enabled_namespaces_id_seq'::regclass);

ALTER TABLE ONLY zoekt_indices ALTER COLUMN id SET DEFAULT nextval('zoekt_indices_id_seq'::regclass);

ALTER TABLE ONLY zoekt_nodes ALTER COLUMN id SET DEFAULT nextval('zoekt_nodes_id_seq'::regclass);

ALTER TABLE ONLY zoekt_replicas ALTER COLUMN id SET DEFAULT nextval('zoekt_replicas_id_seq'::regclass);

ALTER TABLE ONLY zoekt_repositories ALTER COLUMN id SET DEFAULT nextval('zoekt_repositories_id_seq'::regclass);

ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass);

ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_00_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_01_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_02_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_03_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_04_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_05_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_06_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_07_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_08_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_09_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_10_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_11_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_12_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_13_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_14_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_15_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_16_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_17_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_18_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_19_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_20_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_21_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_22_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_23_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_24_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_25_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_26_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_27_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_28_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_29_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_30_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31
    ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_31_pkey PRIMARY KEY (stage_event_hash_id, issue_id);

ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_00_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_01_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_02_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_03_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_04_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_05_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_06_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_07_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_08_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_09_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_10_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_11_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_12_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_13_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_14_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_15_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_16_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_17_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_18_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_19_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_20_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_21_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_22_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_23_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_24_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_25_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_26_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_27_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_28_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_29_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_30_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31
    ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_31_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);

ALTER TABLE ONLY issue_search_data
    ADD CONSTRAINT issue_search_data_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_00
    ADD CONSTRAINT issue_search_data_00_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_01
    ADD CONSTRAINT issue_search_data_01_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_02
    ADD CONSTRAINT issue_search_data_02_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_03
    ADD CONSTRAINT issue_search_data_03_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_04
    ADD CONSTRAINT issue_search_data_04_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_05
    ADD CONSTRAINT issue_search_data_05_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_06
    ADD CONSTRAINT issue_search_data_06_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_07
    ADD CONSTRAINT issue_search_data_07_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_08
    ADD CONSTRAINT issue_search_data_08_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_09
    ADD CONSTRAINT issue_search_data_09_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_10
    ADD CONSTRAINT issue_search_data_10_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_11
    ADD CONSTRAINT issue_search_data_11_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_12
    ADD CONSTRAINT issue_search_data_12_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_13
    ADD CONSTRAINT issue_search_data_13_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_14
    ADD CONSTRAINT issue_search_data_14_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_15
    ADD CONSTRAINT issue_search_data_15_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_16
    ADD CONSTRAINT issue_search_data_16_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_17
    ADD CONSTRAINT issue_search_data_17_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_18
    ADD CONSTRAINT issue_search_data_18_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_19
    ADD CONSTRAINT issue_search_data_19_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_20
    ADD CONSTRAINT issue_search_data_20_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_21
    ADD CONSTRAINT issue_search_data_21_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_22
    ADD CONSTRAINT issue_search_data_22_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_23
    ADD CONSTRAINT issue_search_data_23_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_24
    ADD CONSTRAINT issue_search_data_24_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_25
    ADD CONSTRAINT issue_search_data_25_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_26
    ADD CONSTRAINT issue_search_data_26_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_27
    ADD CONSTRAINT issue_search_data_27_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_28
    ADD CONSTRAINT issue_search_data_28_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_29
    ADD CONSTRAINT issue_search_data_29_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_30
    ADD CONSTRAINT issue_search_data_30_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_31
    ADD CONSTRAINT issue_search_data_31_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_32
    ADD CONSTRAINT issue_search_data_32_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_33
    ADD CONSTRAINT issue_search_data_33_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_34
    ADD CONSTRAINT issue_search_data_34_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_35
    ADD CONSTRAINT issue_search_data_35_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_36
    ADD CONSTRAINT issue_search_data_36_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_37
    ADD CONSTRAINT issue_search_data_37_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_38
    ADD CONSTRAINT issue_search_data_38_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_39
    ADD CONSTRAINT issue_search_data_39_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_40
    ADD CONSTRAINT issue_search_data_40_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_41
    ADD CONSTRAINT issue_search_data_41_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_42
    ADD CONSTRAINT issue_search_data_42_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_43
    ADD CONSTRAINT issue_search_data_43_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_44
    ADD CONSTRAINT issue_search_data_44_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_45
    ADD CONSTRAINT issue_search_data_45_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_46
    ADD CONSTRAINT issue_search_data_46_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_47
    ADD CONSTRAINT issue_search_data_47_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_48
    ADD CONSTRAINT issue_search_data_48_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_49
    ADD CONSTRAINT issue_search_data_49_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_50
    ADD CONSTRAINT issue_search_data_50_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_51
    ADD CONSTRAINT issue_search_data_51_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_52
    ADD CONSTRAINT issue_search_data_52_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_53
    ADD CONSTRAINT issue_search_data_53_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_54
    ADD CONSTRAINT issue_search_data_54_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_55
    ADD CONSTRAINT issue_search_data_55_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_56
    ADD CONSTRAINT issue_search_data_56_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_57
    ADD CONSTRAINT issue_search_data_57_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_58
    ADD CONSTRAINT issue_search_data_58_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_59
    ADD CONSTRAINT issue_search_data_59_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_60
    ADD CONSTRAINT issue_search_data_60_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_61
    ADD CONSTRAINT issue_search_data_61_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_62
    ADD CONSTRAINT issue_search_data_62_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_63
    ADD CONSTRAINT issue_search_data_63_pkey PRIMARY KEY (project_id, issue_id);

ALTER TABLE ONLY namespace_descendants
    ADD CONSTRAINT namespace_descendants_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_00
    ADD CONSTRAINT namespace_descendants_00_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_01
    ADD CONSTRAINT namespace_descendants_01_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_02
    ADD CONSTRAINT namespace_descendants_02_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_03
    ADD CONSTRAINT namespace_descendants_03_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_04
    ADD CONSTRAINT namespace_descendants_04_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_05
    ADD CONSTRAINT namespace_descendants_05_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_06
    ADD CONSTRAINT namespace_descendants_06_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_07
    ADD CONSTRAINT namespace_descendants_07_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_08
    ADD CONSTRAINT namespace_descendants_08_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_09
    ADD CONSTRAINT namespace_descendants_09_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_10
    ADD CONSTRAINT namespace_descendants_10_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_11
    ADD CONSTRAINT namespace_descendants_11_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_12
    ADD CONSTRAINT namespace_descendants_12_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_13
    ADD CONSTRAINT namespace_descendants_13_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_14
    ADD CONSTRAINT namespace_descendants_14_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_15
    ADD CONSTRAINT namespace_descendants_15_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_16
    ADD CONSTRAINT namespace_descendants_16_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_17
    ADD CONSTRAINT namespace_descendants_17_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_18
    ADD CONSTRAINT namespace_descendants_18_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_19
    ADD CONSTRAINT namespace_descendants_19_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_20
    ADD CONSTRAINT namespace_descendants_20_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_21
    ADD CONSTRAINT namespace_descendants_21_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_22
    ADD CONSTRAINT namespace_descendants_22_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_23
    ADD CONSTRAINT namespace_descendants_23_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_24
    ADD CONSTRAINT namespace_descendants_24_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_25
    ADD CONSTRAINT namespace_descendants_25_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_26
    ADD CONSTRAINT namespace_descendants_26_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_27
    ADD CONSTRAINT namespace_descendants_27_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_28
    ADD CONSTRAINT namespace_descendants_28_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_29
    ADD CONSTRAINT namespace_descendants_29_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_30
    ADD CONSTRAINT namespace_descendants_30_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_31
    ADD CONSTRAINT namespace_descendants_31_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY abuse_events
    ADD CONSTRAINT abuse_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_report_assignees
    ADD CONSTRAINT abuse_report_assignees_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_report_events
    ADD CONSTRAINT abuse_report_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_report_label_links
    ADD CONSTRAINT abuse_report_label_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_report_labels
    ADD CONSTRAINT abuse_report_labels_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_report_notes
    ADD CONSTRAINT abuse_report_notes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_report_user_mentions
    ADD CONSTRAINT abuse_report_user_mentions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_reports
    ADD CONSTRAINT abuse_reports_pkey PRIMARY KEY (id);

ALTER TABLE ONLY abuse_trust_scores
    ADD CONSTRAINT abuse_trust_scores_pkey PRIMARY KEY (id);

ALTER TABLE ONLY achievements
    ADD CONSTRAINT achievements_pkey PRIMARY KEY (id);

ALTER TABLE ONLY activity_pub_releases_subscriptions
    ADD CONSTRAINT activity_pub_releases_subscriptions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY agent_activity_events
    ADD CONSTRAINT agent_activity_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY agent_group_authorizations
    ADD CONSTRAINT agent_group_authorizations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY agent_project_authorizations
    ADD CONSTRAINT agent_project_authorizations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY agent_user_access_group_authorizations
    ADD CONSTRAINT agent_user_access_group_authorizations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY agent_user_access_project_authorizations
    ADD CONSTRAINT agent_user_access_project_authorizations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ai_agent_version_attachments
    ADD CONSTRAINT ai_agent_version_attachments_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ai_agent_versions
    ADD CONSTRAINT ai_agent_versions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ai_agents
    ADD CONSTRAINT ai_agents_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ai_code_suggestion_events
    ADD CONSTRAINT ai_code_suggestion_events_pkey PRIMARY KEY (id, "timestamp");

ALTER TABLE ONLY ai_feature_settings
    ADD CONSTRAINT ai_feature_settings_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ai_self_hosted_models
    ADD CONSTRAINT ai_self_hosted_models_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ai_settings
    ADD CONSTRAINT ai_settings_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ai_testing_terms_acceptances
    ADD CONSTRAINT ai_testing_terms_acceptances_pkey PRIMARY KEY (user_id);

ALTER TABLE ONLY ai_vectorizable_files
    ADD CONSTRAINT ai_vectorizable_files_pkey PRIMARY KEY (id);

ALTER TABLE ONLY alert_management_alert_assignees
    ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id);

ALTER TABLE ONLY alert_management_alert_metric_images
    ADD CONSTRAINT alert_management_alert_metric_images_pkey PRIMARY KEY (id);

ALTER TABLE ONLY alert_management_alert_user_mentions
    ADD CONSTRAINT alert_management_alert_user_mentions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY alert_management_alerts
    ADD CONSTRAINT alert_management_alerts_pkey PRIMARY KEY (id);

ALTER TABLE ONLY alert_management_http_integrations
    ADD CONSTRAINT alert_management_http_integrations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY allowed_email_domains
    ADD CONSTRAINT allowed_email_domains_pkey PRIMARY KEY (id);

ALTER TABLE ONLY analytics_cycle_analytics_aggregations
    ADD CONSTRAINT analytics_cycle_analytics_aggregations_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY analytics_cycle_analytics_group_stages
    ADD CONSTRAINT analytics_cycle_analytics_group_stages_pkey PRIMARY KEY (id);

ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams
    ADD CONSTRAINT analytics_cycle_analytics_group_value_streams_pkey PRIMARY KEY (id);

ALTER TABLE ONLY analytics_cycle_analytics_stage_aggregations
    ADD CONSTRAINT analytics_cycle_analytics_stage_aggregations_pkey PRIMARY KEY (stage_id);

ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes
    ADD CONSTRAINT analytics_cycle_analytics_stage_event_hashes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY analytics_cycle_analytics_value_stream_settings
    ADD CONSTRAINT analytics_cycle_analytics_value_stream_settings_pkey PRIMARY KEY (value_stream_id);

ALTER TABLE ONLY analytics_dashboards_pointers
    ADD CONSTRAINT analytics_dashboards_pointers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY analytics_devops_adoption_segments
    ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id);

ALTER TABLE ONLY analytics_devops_adoption_snapshots
    ADD CONSTRAINT analytics_devops_adoption_snapshots_pkey PRIMARY KEY (id);

ALTER TABLE ONLY analytics_language_trend_repository_languages
    ADD CONSTRAINT analytics_language_trend_repository_languages_pkey PRIMARY KEY (programming_language_id, project_id, snapshot_date);

ALTER TABLE ONLY analytics_usage_trends_measurements
    ADD CONSTRAINT analytics_usage_trends_measurements_pkey PRIMARY KEY (id);

ALTER TABLE ONLY appearances
    ADD CONSTRAINT appearances_pkey PRIMARY KEY (id);

ALTER TABLE ONLY application_setting_terms
    ADD CONSTRAINT application_setting_terms_pkey PRIMARY KEY (id);

ALTER TABLE ONLY application_settings
    ADD CONSTRAINT application_settings_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_group_rules_groups
    ADD CONSTRAINT approval_group_rules_groups_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_group_rules
    ADD CONSTRAINT approval_group_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_group_rules_protected_branches
    ADD CONSTRAINT approval_group_rules_protected_branches_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_group_rules_users
    ADD CONSTRAINT approval_group_rules_users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_merge_request_rule_sources
    ADD CONSTRAINT approval_merge_request_rule_sources_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_merge_request_rules_approved_approvers
    ADD CONSTRAINT approval_merge_request_rules_approved_approvers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_merge_request_rules_groups
    ADD CONSTRAINT approval_merge_request_rules_groups_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_merge_request_rules
    ADD CONSTRAINT approval_merge_request_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_merge_request_rules_users
    ADD CONSTRAINT approval_merge_request_rules_users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_policy_rule_project_links
    ADD CONSTRAINT approval_policy_rule_project_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_policy_rules
    ADD CONSTRAINT approval_policy_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_project_rules_groups
    ADD CONSTRAINT approval_project_rules_groups_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_project_rules
    ADD CONSTRAINT approval_project_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approval_project_rules_protected_branches
    ADD CONSTRAINT approval_project_rules_protected_branches_pkey PRIMARY KEY (approval_project_rule_id, protected_branch_id);

ALTER TABLE ONLY approval_project_rules_users
    ADD CONSTRAINT approval_project_rules_users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approvals
    ADD CONSTRAINT approvals_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approver_groups
    ADD CONSTRAINT approver_groups_pkey PRIMARY KEY (id);

ALTER TABLE ONLY approvers
    ADD CONSTRAINT approvers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ar_internal_metadata
    ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);

ALTER TABLE ONLY atlassian_identities
    ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id);

ALTER TABLE ONLY audit_events_amazon_s3_configurations
    ADD CONSTRAINT audit_events_amazon_s3_configurations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_external_audit_event_destinations
    ADD CONSTRAINT audit_events_external_audit_event_destinations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_google_cloud_logging_configurations
    ADD CONSTRAINT audit_events_google_cloud_logging_configurations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_group_external_streaming_destinations
    ADD CONSTRAINT audit_events_group_external_streaming_destinations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_group_streaming_event_type_filters
    ADD CONSTRAINT audit_events_group_streaming_event_type_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_instance_amazon_s3_configurations
    ADD CONSTRAINT audit_events_instance_amazon_s3_configurations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_instance_external_audit_event_destinations
    ADD CONSTRAINT audit_events_instance_external_audit_event_destinations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_instance_external_streaming_destinations
    ADD CONSTRAINT audit_events_instance_external_streaming_destinations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_instance_google_cloud_logging_configurations
    ADD CONSTRAINT audit_events_instance_google_cloud_logging_configurations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_instance_streaming_event_type_filters
    ADD CONSTRAINT audit_events_instance_streaming_event_type_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events
    ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at);

ALTER TABLE ONLY audit_events_streaming_event_type_filters
    ADD CONSTRAINT audit_events_streaming_event_type_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_streaming_group_namespace_filters
    ADD CONSTRAINT audit_events_streaming_group_namespace_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_streaming_headers
    ADD CONSTRAINT audit_events_streaming_headers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_streaming_http_group_namespace_filters
    ADD CONSTRAINT audit_events_streaming_http_group_namespace_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_streaming_http_instance_namespace_filters
    ADD CONSTRAINT audit_events_streaming_http_instance_namespace_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_streaming_instance_event_type_filters
    ADD CONSTRAINT audit_events_streaming_instance_event_type_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY audit_events_streaming_instance_namespace_filters
    ADD CONSTRAINT audit_events_streaming_instance_namespace_filters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY authentication_events
    ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY automation_rules
    ADD CONSTRAINT automation_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY award_emoji
    ADD CONSTRAINT award_emoji_pkey PRIMARY KEY (id);

ALTER TABLE ONLY aws_roles
    ADD CONSTRAINT aws_roles_pkey PRIMARY KEY (user_id);

ALTER TABLE ONLY background_migration_jobs
    ADD CONSTRAINT background_migration_jobs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY badges
    ADD CONSTRAINT badges_pkey PRIMARY KEY (id);

ALTER TABLE ONLY banned_users
    ADD CONSTRAINT banned_users_pkey PRIMARY KEY (user_id);

ALTER TABLE ONLY batched_background_migration_job_transition_logs
    ADD CONSTRAINT batched_background_migration_job_transition_logs_pkey PRIMARY KEY (id, created_at);

ALTER TABLE ONLY batched_background_migration_jobs
    ADD CONSTRAINT batched_background_migration_jobs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY batched_background_migrations
    ADD CONSTRAINT batched_background_migrations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY board_assignees
    ADD CONSTRAINT board_assignees_pkey PRIMARY KEY (id);

ALTER TABLE ONLY board_group_recent_visits
    ADD CONSTRAINT board_group_recent_visits_pkey PRIMARY KEY (id);

ALTER TABLE ONLY board_labels
    ADD CONSTRAINT board_labels_pkey PRIMARY KEY (id);

ALTER TABLE ONLY board_project_recent_visits
    ADD CONSTRAINT board_project_recent_visits_pkey PRIMARY KEY (id);

ALTER TABLE ONLY board_user_preferences
    ADD CONSTRAINT board_user_preferences_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards_epic_board_labels
    ADD CONSTRAINT boards_epic_board_labels_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards_epic_board_positions
    ADD CONSTRAINT boards_epic_board_positions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards_epic_board_recent_visits
    ADD CONSTRAINT boards_epic_board_recent_visits_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards_epic_boards
    ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards_epic_list_user_preferences
    ADD CONSTRAINT boards_epic_list_user_preferences_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards_epic_lists
    ADD CONSTRAINT boards_epic_lists_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards_epic_user_preferences
    ADD CONSTRAINT boards_epic_user_preferences_pkey PRIMARY KEY (id);

ALTER TABLE ONLY boards
    ADD CONSTRAINT boards_pkey PRIMARY KEY (id);

ALTER TABLE ONLY broadcast_messages
    ADD CONSTRAINT broadcast_messages_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_batch_trackers
    ADD CONSTRAINT bulk_import_batch_trackers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_configurations
    ADD CONSTRAINT bulk_import_configurations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_entities
    ADD CONSTRAINT bulk_import_entities_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_export_batches
    ADD CONSTRAINT bulk_import_export_batches_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_export_uploads
    ADD CONSTRAINT bulk_import_export_uploads_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_exports
    ADD CONSTRAINT bulk_import_exports_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_failures
    ADD CONSTRAINT bulk_import_failures_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_import_trackers
    ADD CONSTRAINT bulk_import_trackers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY bulk_imports
    ADD CONSTRAINT bulk_imports_pkey PRIMARY KEY (id);

ALTER TABLE ONLY catalog_resource_component_last_usages
    ADD CONSTRAINT catalog_resource_component_last_usages_pkey PRIMARY KEY (id);

ALTER TABLE ONLY catalog_resource_components
    ADD CONSTRAINT catalog_resource_components_pkey PRIMARY KEY (id);

ALTER TABLE ONLY catalog_resource_versions
    ADD CONSTRAINT catalog_resource_versions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY catalog_resources
    ADD CONSTRAINT catalog_resources_pkey PRIMARY KEY (id);

ALTER TABLE ONLY catalog_verified_namespaces
    ADD CONSTRAINT catalog_verified_namespaces_pkey PRIMARY KEY (id);

ALTER TABLE ONLY chat_names
    ADD CONSTRAINT chat_names_pkey PRIMARY KEY (id);

ALTER TABLE ONLY chat_teams
    ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id);

ALTER TABLE workspaces
    ADD CONSTRAINT check_2a89035b04 CHECK ((personal_access_token_id IS NOT NULL)) NOT VALID;

ALTER TABLE security_scans
    ADD CONSTRAINT check_2d56d882f6 CHECK ((project_id IS NOT NULL)) NOT VALID;

ALTER TABLE vulnerability_scanners
    ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;

ALTER TABLE p_ci_pipeline_variables
    ADD CONSTRAINT check_6e932dbabf CHECK ((project_id IS NOT NULL)) NOT VALID;

ALTER TABLE sprints
    ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID;

ALTER TABLE group_import_states
    ADD CONSTRAINT check_cda75c7c3f CHECK ((user_id IS NOT NULL)) NOT VALID;

ALTER TABLE packages_packages
    ADD CONSTRAINT check_d6301aedeb CHECK ((char_length(status_message) <= 255)) NOT VALID;

ALTER TABLE sprints
    ADD CONSTRAINT check_df3816aed7 CHECK ((due_date IS NOT NULL)) NOT VALID;

ALTER TABLE web_hook_logs
    ADD CONSTRAINT check_df72cb58f5 CHECK ((char_length(url_hash) <= 44)) NOT VALID;

ALTER TABLE events
    ADD CONSTRAINT check_events_sharding_key_is_not_null CHECK (((group_id IS NOT NULL) OR (project_id IS NOT NULL) OR (personal_namespace_id IS NOT NULL))) NOT VALID;

ALTER TABLE projects
    ADD CONSTRAINT check_fa75869cb1 CHECK ((project_namespace_id IS NOT NULL)) NOT VALID;

ALTER TABLE ONLY ci_build_needs
    ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_build_pending_states
    ADD CONSTRAINT ci_build_pending_states_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_build_report_results
    ADD CONSTRAINT ci_build_report_results_pkey PRIMARY KEY (build_id);

ALTER TABLE ONLY ci_build_trace_chunks
    ADD CONSTRAINT ci_build_trace_chunks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY p_ci_builds_metadata
    ADD CONSTRAINT p_ci_builds_metadata_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_builds_metadata
    ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY p_ci_builds
    ADD CONSTRAINT p_ci_builds_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_builds
    ADD CONSTRAINT ci_builds_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_builds_runner_session
    ADD CONSTRAINT ci_builds_runner_session_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_cost_settings
    ADD CONSTRAINT ci_cost_settings_pkey PRIMARY KEY (runner_id);

ALTER TABLE ONLY ci_daily_build_group_report_results
    ADD CONSTRAINT ci_daily_build_group_report_results_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_deleted_objects
    ADD CONSTRAINT ci_deleted_objects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_freeze_periods
    ADD CONSTRAINT ci_freeze_periods_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_group_variables
    ADD CONSTRAINT ci_group_variables_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_instance_variables
    ADD CONSTRAINT ci_instance_variables_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_job_artifact_states
    ADD CONSTRAINT ci_job_artifact_states_pkey PRIMARY KEY (job_artifact_id);

ALTER TABLE ONLY p_ci_job_artifacts
    ADD CONSTRAINT p_ci_job_artifacts_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_job_artifacts
    ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_job_token_authorizations
    ADD CONSTRAINT ci_job_token_authorizations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_job_token_group_scope_links
    ADD CONSTRAINT ci_job_token_group_scope_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_job_token_project_scope_links
    ADD CONSTRAINT ci_job_token_project_scope_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_job_variables
    ADD CONSTRAINT ci_job_variables_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_minutes_additional_packs
    ADD CONSTRAINT ci_minutes_additional_packs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_namespace_mirrors
    ADD CONSTRAINT ci_namespace_mirrors_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_namespace_monthly_usages
    ADD CONSTRAINT ci_namespace_monthly_usages_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_partitions
    ADD CONSTRAINT ci_partitions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_pending_builds
    ADD CONSTRAINT ci_pending_builds_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_pipeline_artifacts
    ADD CONSTRAINT ci_pipeline_artifacts_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_pipeline_chat_data
    ADD CONSTRAINT ci_pipeline_chat_data_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_pipeline_messages
    ADD CONSTRAINT ci_pipeline_messages_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_pipeline_metadata
    ADD CONSTRAINT ci_pipeline_metadata_pkey PRIMARY KEY (pipeline_id);

ALTER TABLE ONLY ci_pipeline_schedule_variables
    ADD CONSTRAINT ci_pipeline_schedule_variables_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_pipeline_schedules
    ADD CONSTRAINT ci_pipeline_schedules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY p_ci_pipeline_variables
    ADD CONSTRAINT p_ci_pipeline_variables_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_pipeline_variables
    ADD CONSTRAINT ci_pipeline_variables_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY p_ci_pipelines
    ADD CONSTRAINT p_ci_pipelines_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_pipelines
    ADD CONSTRAINT ci_pipelines_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_project_mirrors
    ADD CONSTRAINT ci_project_mirrors_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_project_monthly_usages
    ADD CONSTRAINT ci_project_monthly_usages_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_refs
    ADD CONSTRAINT ci_refs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_resource_groups
    ADD CONSTRAINT ci_resource_groups_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_resources
    ADD CONSTRAINT ci_resources_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_runner_machines_687967fa8a
    ADD CONSTRAINT ci_runner_machines_687967fa8a_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY ci_runner_machines
    ADD CONSTRAINT ci_runner_machines_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_runner_namespaces
    ADD CONSTRAINT ci_runner_namespaces_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_runner_projects
    ADD CONSTRAINT ci_runner_projects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_runner_taggings
    ADD CONSTRAINT ci_runner_taggings_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY ci_runner_taggings_group_type
    ADD CONSTRAINT ci_runner_taggings_group_type_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY ci_runner_taggings_instance_type
    ADD CONSTRAINT ci_runner_taggings_instance_type_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY ci_runner_taggings_project_type
    ADD CONSTRAINT ci_runner_taggings_project_type_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY ci_runner_versions
    ADD CONSTRAINT ci_runner_versions_pkey PRIMARY KEY (version);

ALTER TABLE ONLY ci_runners_e59bb2812d
    ADD CONSTRAINT ci_runners_e59bb2812d_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY ci_runners
    ADD CONSTRAINT ci_runners_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_running_builds
    ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_secure_file_states
    ADD CONSTRAINT ci_secure_file_states_pkey PRIMARY KEY (ci_secure_file_id);

ALTER TABLE ONLY ci_secure_files
    ADD CONSTRAINT ci_secure_files_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_sources_pipelines
    ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_sources_projects
    ADD CONSTRAINT ci_sources_projects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY p_ci_stages
    ADD CONSTRAINT p_ci_stages_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_stages
    ADD CONSTRAINT ci_stages_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY ci_subscriptions_projects
    ADD CONSTRAINT ci_subscriptions_projects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_trigger_requests
    ADD CONSTRAINT ci_trigger_requests_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_triggers
    ADD CONSTRAINT ci_triggers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_unit_test_failures
    ADD CONSTRAINT ci_unit_test_failures_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_unit_tests
    ADD CONSTRAINT ci_unit_tests_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ci_variables
    ADD CONSTRAINT ci_variables_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cloud_connector_access
    ADD CONSTRAINT cloud_connector_access_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_agent_tokens
    ADD CONSTRAINT cluster_agent_tokens_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_agent_url_configurations
    ADD CONSTRAINT cluster_agent_url_configurations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_agents
    ADD CONSTRAINT cluster_agents_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_enabled_grants
    ADD CONSTRAINT cluster_enabled_grants_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_groups
    ADD CONSTRAINT cluster_groups_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_platforms_kubernetes
    ADD CONSTRAINT cluster_platforms_kubernetes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_projects
    ADD CONSTRAINT cluster_projects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_providers_aws
    ADD CONSTRAINT cluster_providers_aws_pkey PRIMARY KEY (id);

ALTER TABLE ONLY cluster_providers_gcp
    ADD CONSTRAINT cluster_providers_gcp_pkey PRIMARY KEY (id);

ALTER TABLE ONLY clusters_integration_prometheus
    ADD CONSTRAINT clusters_integration_prometheus_pkey PRIMARY KEY (cluster_id);

ALTER TABLE ONLY clusters_kubernetes_namespaces
    ADD CONSTRAINT clusters_kubernetes_namespaces_pkey PRIMARY KEY (id);

ALTER TABLE ONLY clusters
    ADD CONSTRAINT clusters_pkey PRIMARY KEY (id);

ALTER TABLE ONLY commit_user_mentions
    ADD CONSTRAINT commit_user_mentions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY compliance_framework_security_policies
    ADD CONSTRAINT compliance_framework_security_policies_pkey PRIMARY KEY (id);

ALTER TABLE ONLY compliance_management_frameworks
    ADD CONSTRAINT compliance_management_frameworks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY compliance_requirements
    ADD CONSTRAINT compliance_requirements_pkey PRIMARY KEY (id);

ALTER TABLE ONLY container_expiration_policies
    ADD CONSTRAINT container_expiration_policies_pkey PRIMARY KEY (project_id);

ALTER TABLE ONLY container_registry_data_repair_details
    ADD CONSTRAINT container_registry_data_repair_details_pkey PRIMARY KEY (project_id);

ALTER TABLE ONLY container_registry_protection_rules
    ADD CONSTRAINT container_registry_protection_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY container_repositories
    ADD CONSTRAINT container_repositories_pkey PRIMARY KEY (id);

ALTER TABLE ONLY container_repository_states
    ADD CONSTRAINT container_repository_states_pkey PRIMARY KEY (container_repository_id);

ALTER TABLE ONLY content_blocked_states
    ADD CONSTRAINT content_blocked_states_pkey PRIMARY KEY (id);

ALTER TABLE ONLY conversational_development_index_metrics
    ADD CONSTRAINT conversational_development_index_metrics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY country_access_logs
    ADD CONSTRAINT country_access_logs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY coverage_fuzzing_corpuses
    ADD CONSTRAINT coverage_fuzzing_corpuses_pkey PRIMARY KEY (id);

ALTER TABLE ONLY csv_issue_imports
    ADD CONSTRAINT csv_issue_imports_pkey PRIMARY KEY (id);

ALTER TABLE ONLY custom_emoji
    ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id);

ALTER TABLE ONLY custom_field_select_options
    ADD CONSTRAINT custom_field_select_options_pkey PRIMARY KEY (id);

ALTER TABLE ONLY custom_fields
    ADD CONSTRAINT custom_fields_pkey PRIMARY KEY (id);

ALTER TABLE ONLY custom_software_licenses
    ADD CONSTRAINT custom_software_licenses_pkey PRIMARY KEY (id);

ALTER TABLE ONLY customer_relations_contacts
    ADD CONSTRAINT customer_relations_contacts_pkey PRIMARY KEY (id);

ALTER TABLE ONLY customer_relations_organizations
    ADD CONSTRAINT customer_relations_organizations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_pre_scan_verification_steps
    ADD CONSTRAINT dast_pre_scan_verification_steps_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_pre_scan_verifications
    ADD CONSTRAINT dast_pre_scan_verifications_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_profile_schedules
    ADD CONSTRAINT dast_profile_schedules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_profiles_pipelines
    ADD CONSTRAINT dast_profiles_pipelines_pkey PRIMARY KEY (dast_profile_id, ci_pipeline_id);

ALTER TABLE ONLY dast_profiles
    ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_profiles_tags
    ADD CONSTRAINT dast_profiles_tags_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_scanner_profiles_builds
    ADD CONSTRAINT dast_scanner_profiles_builds_pkey PRIMARY KEY (dast_scanner_profile_id, ci_build_id);

ALTER TABLE ONLY dast_scanner_profiles
    ADD CONSTRAINT dast_scanner_profiles_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_site_profile_secret_variables
    ADD CONSTRAINT dast_site_profile_secret_variables_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_site_profiles_builds
    ADD CONSTRAINT dast_site_profiles_builds_pkey PRIMARY KEY (dast_site_profile_id, ci_build_id);

ALTER TABLE ONLY dast_site_profiles
    ADD CONSTRAINT dast_site_profiles_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_site_tokens
    ADD CONSTRAINT dast_site_tokens_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_site_validations
    ADD CONSTRAINT dast_site_validations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dast_sites
    ADD CONSTRAINT dast_sites_pkey PRIMARY KEY (id);

ALTER TABLE namespace_settings
    ADD CONSTRAINT default_branch_protection_defaults_size_constraint CHECK ((octet_length((default_branch_protection_defaults)::text) <= 1024)) NOT VALID;

ALTER TABLE application_settings
    ADD CONSTRAINT default_branch_protection_defaults_size_constraint CHECK ((octet_length((default_branch_protection_defaults)::text) <= 1024)) NOT VALID;

ALTER TABLE ONLY dependency_list_export_parts
    ADD CONSTRAINT dependency_list_export_parts_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dependency_list_exports
    ADD CONSTRAINT dependency_list_exports_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dependency_proxy_blob_states
    ADD CONSTRAINT dependency_proxy_blob_states_pkey PRIMARY KEY (dependency_proxy_blob_id);

ALTER TABLE ONLY dependency_proxy_blobs
    ADD CONSTRAINT dependency_proxy_blobs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dependency_proxy_group_settings
    ADD CONSTRAINT dependency_proxy_group_settings_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dependency_proxy_image_ttl_group_policies
    ADD CONSTRAINT dependency_proxy_image_ttl_group_policies_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY dependency_proxy_manifest_states
    ADD CONSTRAINT dependency_proxy_manifest_states_pkey PRIMARY KEY (dependency_proxy_manifest_id);

ALTER TABLE ONLY dependency_proxy_manifests
    ADD CONSTRAINT dependency_proxy_manifests_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dependency_proxy_packages_settings
    ADD CONSTRAINT dependency_proxy_packages_settings_pkey PRIMARY KEY (project_id);

ALTER TABLE ONLY deploy_keys_projects
    ADD CONSTRAINT deploy_keys_projects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY deploy_tokens
    ADD CONSTRAINT deploy_tokens_pkey PRIMARY KEY (id);

ALTER TABLE ONLY deployment_approvals
    ADD CONSTRAINT deployment_approvals_pkey PRIMARY KEY (id);

ALTER TABLE ONLY deployment_clusters
    ADD CONSTRAINT deployment_clusters_pkey PRIMARY KEY (deployment_id);

ALTER TABLE ONLY deployment_merge_requests
    ADD CONSTRAINT deployment_merge_requests_pkey PRIMARY KEY (deployment_id, merge_request_id);

ALTER TABLE ONLY deployments
    ADD CONSTRAINT deployments_pkey PRIMARY KEY (id);

ALTER TABLE ONLY description_versions
    ADD CONSTRAINT description_versions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY design_management_designs
    ADD CONSTRAINT design_management_designs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY design_management_designs_versions
    ADD CONSTRAINT design_management_designs_versions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY design_management_repositories
    ADD CONSTRAINT design_management_repositories_pkey PRIMARY KEY (id);

ALTER TABLE ONLY design_management_repository_states
    ADD CONSTRAINT design_management_repository_states_pkey PRIMARY KEY (design_management_repository_id);

ALTER TABLE ONLY design_management_versions
    ADD CONSTRAINT design_management_versions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY design_user_mentions
    ADD CONSTRAINT design_user_mentions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY detached_partitions
    ADD CONSTRAINT detached_partitions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY diff_note_positions
    ADD CONSTRAINT diff_note_positions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dingtalk_tracker_data
    ADD CONSTRAINT dingtalk_tracker_data_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dora_configurations
    ADD CONSTRAINT dora_configurations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dora_daily_metrics
    ADD CONSTRAINT dora_daily_metrics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dora_performance_scores
    ADD CONSTRAINT dora_performance_scores_pkey PRIMARY KEY (id);

ALTER TABLE ONLY draft_notes
    ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY duo_workflows_checkpoints
    ADD CONSTRAINT duo_workflows_checkpoints_pkey PRIMARY KEY (id);

ALTER TABLE ONLY duo_workflows_events
    ADD CONSTRAINT duo_workflows_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY duo_workflows_workflows
    ADD CONSTRAINT duo_workflows_workflows_pkey PRIMARY KEY (id);

ALTER TABLE ONLY early_access_program_tracking_events
    ADD CONSTRAINT early_access_program_tracking_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY elastic_group_index_statuses
    ADD CONSTRAINT elastic_group_index_statuses_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY elastic_index_settings
    ADD CONSTRAINT elastic_index_settings_pkey PRIMARY KEY (id);

ALTER TABLE ONLY elastic_reindexing_slices
    ADD CONSTRAINT elastic_reindexing_slices_pkey PRIMARY KEY (id);

ALTER TABLE ONLY elastic_reindexing_subtasks
    ADD CONSTRAINT elastic_reindexing_subtasks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY elastic_reindexing_tasks
    ADD CONSTRAINT elastic_reindexing_tasks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY elasticsearch_indexed_namespaces
    ADD CONSTRAINT elasticsearch_indexed_namespaces_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY elasticsearch_indexed_projects
    ADD CONSTRAINT elasticsearch_indexed_projects_pkey PRIMARY KEY (project_id);

ALTER TABLE ONLY emails
    ADD CONSTRAINT emails_pkey PRIMARY KEY (id);

ALTER TABLE ONLY environments
    ADD CONSTRAINT environments_pkey PRIMARY KEY (id);

ALTER TABLE ONLY epic_issues
    ADD CONSTRAINT epic_issues_pkey PRIMARY KEY (id);

ALTER TABLE ONLY epic_metrics
    ADD CONSTRAINT epic_metrics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY epic_user_mentions
    ADD CONSTRAINT epic_user_mentions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY epics
    ADD CONSTRAINT epics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY error_tracking_client_keys
    ADD CONSTRAINT error_tracking_client_keys_pkey PRIMARY KEY (id);

ALTER TABLE ONLY error_tracking_error_events
    ADD CONSTRAINT error_tracking_error_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY error_tracking_errors
    ADD CONSTRAINT error_tracking_errors_pkey PRIMARY KEY (id);

ALTER TABLE ONLY events
    ADD CONSTRAINT events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY evidences
    ADD CONSTRAINT evidences_pkey PRIMARY KEY (id);

ALTER TABLE ONLY external_approval_rules
    ADD CONSTRAINT external_approval_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY external_pull_requests
    ADD CONSTRAINT external_pull_requests_pkey PRIMARY KEY (id);

ALTER TABLE ONLY external_status_checks
    ADD CONSTRAINT external_status_checks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY external_status_checks_protected_branches
    ADD CONSTRAINT external_status_checks_protected_branches_pkey PRIMARY KEY (id);

ALTER TABLE ONLY feature_gates
    ADD CONSTRAINT feature_gates_pkey PRIMARY KEY (id);

ALTER TABLE ONLY features
    ADD CONSTRAINT features_pkey PRIMARY KEY (id);

ALTER TABLE ONLY fork_network_members
    ADD CONSTRAINT fork_network_members_pkey PRIMARY KEY (id);

ALTER TABLE ONLY fork_networks
    ADD CONSTRAINT fork_networks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY geo_cache_invalidation_events
    ADD CONSTRAINT geo_cache_invalidation_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY geo_event_log
    ADD CONSTRAINT geo_event_log_pkey PRIMARY KEY (id);

ALTER TABLE ONLY geo_events
    ADD CONSTRAINT geo_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY geo_node_namespace_links
    ADD CONSTRAINT geo_node_namespace_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY geo_node_statuses
    ADD CONSTRAINT geo_node_statuses_pkey PRIMARY KEY (id);

ALTER TABLE ONLY geo_nodes
    ADD CONSTRAINT geo_nodes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ghost_user_migrations
    ADD CONSTRAINT ghost_user_migrations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY gitlab_subscription_histories
    ADD CONSTRAINT gitlab_subscription_histories_pkey PRIMARY KEY (id);

ALTER TABLE ONLY gitlab_subscriptions
    ADD CONSTRAINT gitlab_subscriptions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY gpg_key_subkeys
    ADD CONSTRAINT gpg_key_subkeys_pkey PRIMARY KEY (id);

ALTER TABLE ONLY gpg_keys
    ADD CONSTRAINT gpg_keys_pkey PRIMARY KEY (id);

ALTER TABLE ONLY gpg_signatures
    ADD CONSTRAINT gpg_signatures_pkey PRIMARY KEY (id);

ALTER TABLE ONLY grafana_integrations
    ADD CONSTRAINT grafana_integrations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_audit_events
    ADD CONSTRAINT group_audit_events_pkey PRIMARY KEY (id, created_at);

ALTER TABLE ONLY group_crm_settings
    ADD CONSTRAINT group_crm_settings_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY group_custom_attributes
    ADD CONSTRAINT group_custom_attributes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_deletion_schedules
    ADD CONSTRAINT group_deletion_schedules_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY group_deploy_keys_groups
    ADD CONSTRAINT group_deploy_keys_groups_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_deploy_keys
    ADD CONSTRAINT group_deploy_keys_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_deploy_tokens
    ADD CONSTRAINT group_deploy_tokens_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_features
    ADD CONSTRAINT group_features_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY group_group_links
    ADD CONSTRAINT group_group_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_import_states
    ADD CONSTRAINT group_import_states_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY group_merge_request_approval_settings
    ADD CONSTRAINT group_merge_request_approval_settings_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY group_repository_storage_moves
    ADD CONSTRAINT group_repository_storage_moves_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_saved_replies
    ADD CONSTRAINT group_saved_replies_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_scim_auth_access_tokens
    ADD CONSTRAINT group_scim_auth_access_tokens_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_scim_identities
    ADD CONSTRAINT group_scim_identities_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_security_exclusions
    ADD CONSTRAINT group_security_exclusions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_ssh_certificates
    ADD CONSTRAINT group_ssh_certificates_pkey PRIMARY KEY (id);

ALTER TABLE ONLY group_type_ci_runner_machines_687967fa8a
    ADD CONSTRAINT group_type_ci_runner_machines_687967fa8a_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY group_type_ci_runners_e59bb2812d
    ADD CONSTRAINT group_type_ci_runners_e59bb2812d_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY group_wiki_repositories
    ADD CONSTRAINT group_wiki_repositories_pkey PRIMARY KEY (group_id);

ALTER TABLE ONLY group_wiki_repository_states
    ADD CONSTRAINT group_wiki_repository_states_pkey PRIMARY KEY (id);

ALTER TABLE ONLY groups_visits
    ADD CONSTRAINT groups_visits_pkey PRIMARY KEY (id, visited_at);

ALTER TABLE ONLY historical_data
    ADD CONSTRAINT historical_data_pkey PRIMARY KEY (id);

ALTER TABLE ONLY identities
    ADD CONSTRAINT identities_pkey PRIMARY KEY (id);

ALTER TABLE ONLY import_export_uploads
    ADD CONSTRAINT import_export_uploads_pkey PRIMARY KEY (id);

ALTER TABLE ONLY import_failures
    ADD CONSTRAINT import_failures_pkey PRIMARY KEY (id);

ALTER TABLE ONLY import_placeholder_memberships
    ADD CONSTRAINT import_placeholder_memberships_pkey PRIMARY KEY (id);

ALTER TABLE ONLY import_source_user_placeholder_references
    ADD CONSTRAINT import_source_user_placeholder_references_pkey PRIMARY KEY (id);

ALTER TABLE ONLY import_source_users
    ADD CONSTRAINT import_source_users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_oncall_shifts
    ADD CONSTRAINT inc_mgmnt_no_overlapping_oncall_shifts EXCLUDE USING gist (rotation_id WITH =, tstzrange(starts_at, ends_at, '[)'::text) WITH &&);

ALTER TABLE ONLY incident_management_escalation_policies
    ADD CONSTRAINT incident_management_escalation_policies_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_escalation_rules
    ADD CONSTRAINT incident_management_escalation_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_issuable_escalation_statuses
    ADD CONSTRAINT incident_management_issuable_escalation_statuses_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_oncall_participants
    ADD CONSTRAINT incident_management_oncall_participants_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_oncall_rotations
    ADD CONSTRAINT incident_management_oncall_rotations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_oncall_schedules
    ADD CONSTRAINT incident_management_oncall_schedules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_oncall_shifts
    ADD CONSTRAINT incident_management_oncall_shifts_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_pending_alert_escalations
    ADD CONSTRAINT incident_management_pending_alert_escalations_pkey PRIMARY KEY (id, process_at);

ALTER TABLE ONLY incident_management_pending_issue_escalations
    ADD CONSTRAINT incident_management_pending_issue_escalations_pkey PRIMARY KEY (id, process_at);

ALTER TABLE ONLY incident_management_timeline_event_tag_links
    ADD CONSTRAINT incident_management_timeline_event_tag_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_timeline_event_tags
    ADD CONSTRAINT incident_management_timeline_event_tags_pkey PRIMARY KEY (id);

ALTER TABLE ONLY incident_management_timeline_events
    ADD CONSTRAINT incident_management_timeline_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY index_statuses
    ADD CONSTRAINT index_statuses_pkey PRIMARY KEY (id);

ALTER TABLE ONLY insights
    ADD CONSTRAINT insights_pkey PRIMARY KEY (id);

ALTER TABLE ONLY instance_audit_events
    ADD CONSTRAINT instance_audit_events_pkey PRIMARY KEY (id, created_at);

ALTER TABLE ONLY instance_audit_events_streaming_headers
    ADD CONSTRAINT instance_audit_events_streaming_headers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY instance_integrations
    ADD CONSTRAINT instance_integrations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY instance_type_ci_runner_machines_687967fa8a
    ADD CONSTRAINT instance_type_ci_runner_machines_687967fa8a_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY instance_type_ci_runners_e59bb2812d
    ADD CONSTRAINT instance_type_ci_runners_e59bb2812d_pkey PRIMARY KEY (id, runner_type);

ALTER TABLE ONLY integrations
    ADD CONSTRAINT integrations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY internal_ids
    ADD CONSTRAINT internal_ids_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ip_restrictions
    ADD CONSTRAINT ip_restrictions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issuable_metric_images
    ADD CONSTRAINT issuable_metric_images_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issuable_resource_links
    ADD CONSTRAINT issuable_resource_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issuable_severities
    ADD CONSTRAINT issuable_severities_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issuable_slas
    ADD CONSTRAINT issuable_slas_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_assignees
    ADD CONSTRAINT issue_assignees_pkey PRIMARY KEY (issue_id, user_id);

ALTER TABLE ONLY issue_assignment_events
    ADD CONSTRAINT issue_assignment_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_customer_relations_contacts
    ADD CONSTRAINT issue_customer_relations_contacts_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_email_participants
    ADD CONSTRAINT issue_email_participants_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_emails
    ADD CONSTRAINT issue_emails_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_links
    ADD CONSTRAINT issue_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_metrics
    ADD CONSTRAINT issue_metrics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_tracker_data
    ADD CONSTRAINT issue_tracker_data_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issue_user_mentions
    ADD CONSTRAINT issue_user_mentions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY issues
    ADD CONSTRAINT issues_pkey PRIMARY KEY (id);

ALTER TABLE ONLY sprints
    ADD CONSTRAINT iteration_start_and_due_date_iterations_cadence_id_constraint EXCLUDE USING gist (iterations_cadence_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((group_id IS NOT NULL)) DEFERRABLE INITIALLY DEFERRED;

ALTER TABLE ONLY iterations_cadences
    ADD CONSTRAINT iterations_cadences_pkey PRIMARY KEY (id);

ALTER TABLE ONLY jira_connect_installations
    ADD CONSTRAINT jira_connect_installations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY jira_connect_subscriptions
    ADD CONSTRAINT jira_connect_subscriptions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY jira_imports
    ADD CONSTRAINT jira_imports_pkey PRIMARY KEY (id);

ALTER TABLE ONLY jira_tracker_data
    ADD CONSTRAINT jira_tracker_data_pkey PRIMARY KEY (id);

ALTER TABLE ONLY keys
    ADD CONSTRAINT keys_pkey PRIMARY KEY (id);

ALTER TABLE ONLY label_links
    ADD CONSTRAINT label_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY label_priorities
    ADD CONSTRAINT label_priorities_pkey PRIMARY KEY (id);

ALTER TABLE ONLY labels
    ADD CONSTRAINT labels_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ldap_group_links
    ADD CONSTRAINT ldap_group_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY lfs_file_locks
    ADD CONSTRAINT lfs_file_locks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY lfs_object_states
    ADD CONSTRAINT lfs_object_states_pkey PRIMARY KEY (lfs_object_id);

ALTER TABLE ONLY lfs_objects
    ADD CONSTRAINT lfs_objects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY lfs_objects_projects
    ADD CONSTRAINT lfs_objects_projects_pkey PRIMARY KEY (id);

ALTER TABLE ONLY licenses
    ADD CONSTRAINT licenses_pkey PRIMARY KEY (id);

ALTER TABLE ONLY list_user_preferences
    ADD CONSTRAINT list_user_preferences_pkey PRIMARY KEY (id);

ALTER TABLE ONLY lists
    ADD CONSTRAINT lists_pkey PRIMARY KEY (id);

ALTER TABLE ONLY loose_foreign_keys_deleted_records
    ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (partition, id);

ALTER TABLE ONLY member_approvals
    ADD CONSTRAINT member_approvals_pkey PRIMARY KEY (id);

ALTER TABLE ONLY member_roles
    ADD CONSTRAINT member_roles_pkey PRIMARY KEY (id);

ALTER TABLE ONLY members_deletion_schedules
    ADD CONSTRAINT members_deletion_schedules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY members
    ADD CONSTRAINT members_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_assignees
    ADD CONSTRAINT merge_request_assignees_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_assignment_events
    ADD CONSTRAINT merge_request_assignment_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_blocks
    ADD CONSTRAINT merge_request_blocks_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_cleanup_schedules
    ADD CONSTRAINT merge_request_cleanup_schedules_pkey PRIMARY KEY (merge_request_id);

ALTER TABLE ONLY merge_request_context_commit_diff_files
    ADD CONSTRAINT merge_request_context_commit_diff_files_pkey PRIMARY KEY (merge_request_context_commit_id, relative_order);

ALTER TABLE ONLY merge_request_context_commits
    ADD CONSTRAINT merge_request_context_commits_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_diff_commit_users
    ADD CONSTRAINT merge_request_diff_commit_users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_diff_commits_b5377a7a34
    ADD CONSTRAINT merge_request_diff_commits_b5377a7a34_pkey PRIMARY KEY (merge_request_diff_id, relative_order);

ALTER TABLE ONLY merge_request_diff_commits
    ADD CONSTRAINT merge_request_diff_commits_pkey PRIMARY KEY (merge_request_diff_id, relative_order);

ALTER TABLE ONLY merge_request_diff_details
    ADD CONSTRAINT merge_request_diff_details_pkey PRIMARY KEY (merge_request_diff_id);

ALTER TABLE ONLY merge_request_diff_files_99208b8fac
    ADD CONSTRAINT merge_request_diff_files_99208b8fac_pkey PRIMARY KEY (merge_request_diff_id, relative_order);

ALTER TABLE ONLY merge_request_diff_files
    ADD CONSTRAINT merge_request_diff_files_pkey PRIMARY KEY (merge_request_diff_id, relative_order);

ALTER TABLE ONLY merge_request_diffs
    ADD CONSTRAINT merge_request_diffs_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_merge_schedules
    ADD CONSTRAINT merge_request_merge_schedules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_metrics
    ADD CONSTRAINT merge_request_metrics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_predictions
    ADD CONSTRAINT merge_request_predictions_pkey PRIMARY KEY (merge_request_id);

ALTER TABLE ONLY merge_request_requested_changes
    ADD CONSTRAINT merge_request_requested_changes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_reviewers
    ADD CONSTRAINT merge_request_reviewers_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_request_user_mentions
    ADD CONSTRAINT merge_request_user_mentions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_requests_closing_issues
    ADD CONSTRAINT merge_requests_closing_issues_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_requests_compliance_violations
    ADD CONSTRAINT merge_requests_compliance_violations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_requests
    ADD CONSTRAINT merge_requests_pkey PRIMARY KEY (id);

ALTER TABLE ONLY merge_trains
    ADD CONSTRAINT merge_trains_pkey PRIMARY KEY (id);

ALTER TABLE ONLY metrics_dashboard_annotations
    ADD CONSTRAINT metrics_dashboard_annotations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY metrics_users_starred_dashboards
    ADD CONSTRAINT metrics_users_starred_dashboards_pkey PRIMARY KEY (id);

ALTER TABLE ONLY milestone_releases
    ADD CONSTRAINT milestone_releases_pkey PRIMARY KEY (milestone_id, release_id);

ALTER TABLE ONLY milestones
    ADD CONSTRAINT milestones_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_candidate_metadata
    ADD CONSTRAINT ml_candidate_metadata_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_candidate_metrics
    ADD CONSTRAINT ml_candidate_metrics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_candidate_params
    ADD CONSTRAINT ml_candidate_params_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_candidates
    ADD CONSTRAINT ml_candidates_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_experiment_metadata
    ADD CONSTRAINT ml_experiment_metadata_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_experiments
    ADD CONSTRAINT ml_experiments_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_model_metadata
    ADD CONSTRAINT ml_model_metadata_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_model_version_metadata
    ADD CONSTRAINT ml_model_version_metadata_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_model_versions
    ADD CONSTRAINT ml_model_versions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY ml_models
    ADD CONSTRAINT ml_models_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespace_admin_notes
    ADD CONSTRAINT namespace_admin_notes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespace_aggregation_schedules
    ADD CONSTRAINT namespace_aggregation_schedules_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_bans
    ADD CONSTRAINT namespace_bans_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespace_ci_cd_settings
    ADD CONSTRAINT namespace_ci_cd_settings_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_commit_emails
    ADD CONSTRAINT namespace_commit_emails_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespace_details
    ADD CONSTRAINT namespace_details_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_import_users
    ADD CONSTRAINT namespace_import_users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespace_ldap_settings
    ADD CONSTRAINT namespace_ldap_settings_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_limits
    ADD CONSTRAINT namespace_limits_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_package_settings
    ADD CONSTRAINT namespace_package_settings_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_root_storage_statistics
    ADD CONSTRAINT namespace_root_storage_statistics_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_settings
    ADD CONSTRAINT namespace_settings_pkey PRIMARY KEY (namespace_id);

ALTER TABLE ONLY namespace_statistics
    ADD CONSTRAINT namespace_statistics_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespaces
    ADD CONSTRAINT namespaces_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespaces_storage_limit_exclusions
    ADD CONSTRAINT namespaces_storage_limit_exclusions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY namespaces_sync_events
    ADD CONSTRAINT namespaces_sync_events_pkey PRIMARY KEY (id);

ALTER TABLE ONLY note_diff_files
    ADD CONSTRAINT note_diff_files_pkey PRIMARY KEY (id);

ALTER TABLE ONLY note_metadata
    ADD CONSTRAINT note_metadata_pkey PRIMARY KEY (note_id);

ALTER TABLE ONLY notes
    ADD CONSTRAINT notes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY notification_settings
    ADD CONSTRAINT notification_settings_pkey PRIMARY KEY (id);

ALTER TABLE ONLY oauth_access_grants
    ADD CONSTRAINT oauth_access_grants_pkey PRIMARY KEY (id);

ALTER TABLE ONLY oauth_access_tokens
    ADD CONSTRAINT oauth_access_tokens_pkey PRIMARY KEY (id);

ALTER TABLE ONLY oauth_applications
    ADD CONSTRAINT oauth_applications_pkey PRIMARY KEY (id);

ALTER TABLE ONLY oauth_device_grants
    ADD CONSTRAINT oauth_device_grants_pkey PRIMARY KEY (id);

ALTER TABLE ONLY oauth_openid_requests
    ADD CONSTRAINT oauth_openid_requests_pkey PRIMARY KEY (id);

ALTER TABLE ONLY observability_logs_issues_connections
    ADD CONSTRAINT observability_logs_issues_connections_pkey PRIMARY KEY (id);

ALTER TABLE ONLY observability_metrics_issues_connections
    ADD CONSTRAINT observability_metrics_issues_connections_pkey PRIMARY KEY (id);

ALTER TABLE ONLY observability_traces_issues_connections
    ADD CONSTRAINT observability_traces_issues_connections_pkey PRIMARY KEY (id);

ALTER TABLE ONLY onboarding_progresses
    ADD CONSTRAINT onboarding_progresses_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_feature_flag_scopes
    ADD CONSTRAINT operations_feature_flag_scopes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_feature_flags_clients
    ADD CONSTRAINT operations_feature_flags_clients_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_feature_flags_issues
    ADD CONSTRAINT operations_feature_flags_issues_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_feature_flags
    ADD CONSTRAINT operations_feature_flags_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_scopes
    ADD CONSTRAINT operations_scopes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_strategies
    ADD CONSTRAINT operations_strategies_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_strategies_user_lists
    ADD CONSTRAINT operations_strategies_user_lists_pkey PRIMARY KEY (id);

ALTER TABLE ONLY operations_user_lists
    ADD CONSTRAINT operations_user_lists_pkey PRIMARY KEY (id);

ALTER TABLE ONLY organization_details
    ADD CONSTRAINT organization_details_pkey PRIMARY KEY (organization_id);

ALTER TABLE ONLY organization_settings
    ADD CONSTRAINT organization_settings_pkey PRIMARY KEY (organization_id);

ALTER TABLE ONLY organization_users
    ADD CONSTRAINT organization_users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY organizations
    ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);

ALTER TABLE ONLY p_batched_git_ref_updates_deletions
    ADD CONSTRAINT p_batched_git_ref_updates_deletions_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY p_catalog_resource_component_usages
    ADD CONSTRAINT p_catalog_resource_component_usages_pkey PRIMARY KEY (id, used_date);

ALTER TABLE ONLY p_catalog_resource_sync_events
    ADD CONSTRAINT p_catalog_resource_sync_events_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY p_ci_build_names
    ADD CONSTRAINT p_ci_build_names_pkey PRIMARY KEY (build_id, partition_id);

ALTER TABLE ONLY p_ci_build_sources
    ADD CONSTRAINT p_ci_build_sources_pkey PRIMARY KEY (build_id, partition_id);

ALTER TABLE ONLY p_ci_build_tags
    ADD CONSTRAINT p_ci_build_tags_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY p_ci_build_trace_metadata
    ADD CONSTRAINT p_ci_build_trace_metadata_pkey PRIMARY KEY (build_id, partition_id);

ALTER TABLE ONLY p_ci_builds_execution_configs
    ADD CONSTRAINT p_ci_builds_execution_configs_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY p_ci_finished_build_ch_sync_events
    ADD CONSTRAINT p_ci_finished_build_ch_sync_events_pkey PRIMARY KEY (build_id, partition);

ALTER TABLE ONLY p_ci_finished_pipeline_ch_sync_events
    ADD CONSTRAINT p_ci_finished_pipeline_ch_sync_events_pkey PRIMARY KEY (pipeline_id, partition);

ALTER TABLE ONLY p_ci_job_annotations
    ADD CONSTRAINT p_ci_job_annotations_pkey PRIMARY KEY (id, partition_id);

ALTER TABLE ONLY p_ci_job_artifact_reports
    ADD CONSTRAINT p_ci_job_artifact_reports_pkey PRIMARY KEY (job_artifact_id, partition_id);

ALTER TABLE ONLY p_ci_pipelines_config
    ADD CONSTRAINT p_ci_pipelines_config_pkey PRIMARY KEY (pipeline_id, partition_id);

ALTER TABLE ONLY p_ci_runner_machine_builds
    ADD CONSTRAINT p_ci_runner_machine_builds_pkey PRIMARY KEY (build_id, partition_id);

ALTER TABLE ONLY packages_build_infos
    ADD CONSTRAINT packages_build_infos_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_cleanup_policies
    ADD CONSTRAINT packages_cleanup_policies_pkey PRIMARY KEY (project_id);

ALTER TABLE ONLY packages_composer_metadata
    ADD CONSTRAINT packages_composer_metadata_pkey PRIMARY KEY (package_id);

ALTER TABLE ONLY packages_conan_file_metadata
    ADD CONSTRAINT packages_conan_file_metadata_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_conan_metadata
    ADD CONSTRAINT packages_conan_metadata_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_conan_package_references
    ADD CONSTRAINT packages_conan_package_references_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_conan_package_revisions
    ADD CONSTRAINT packages_conan_package_revisions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_conan_recipe_revisions
    ADD CONSTRAINT packages_conan_recipe_revisions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_file_metadata
    ADD CONSTRAINT packages_debian_file_metadata_pkey PRIMARY KEY (package_file_id);

ALTER TABLE ONLY packages_debian_group_architectures
    ADD CONSTRAINT packages_debian_group_architectures_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_group_component_files
    ADD CONSTRAINT packages_debian_group_component_files_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_group_components
    ADD CONSTRAINT packages_debian_group_components_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_group_distribution_keys
    ADD CONSTRAINT packages_debian_group_distribution_keys_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_group_distributions
    ADD CONSTRAINT packages_debian_group_distributions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_project_architectures
    ADD CONSTRAINT packages_debian_project_architectures_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_project_component_files
    ADD CONSTRAINT packages_debian_project_component_files_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_project_components
    ADD CONSTRAINT packages_debian_project_components_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_project_distribution_keys
    ADD CONSTRAINT packages_debian_project_distribution_keys_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_project_distributions
    ADD CONSTRAINT packages_debian_project_distributions_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_debian_publications
    ADD CONSTRAINT packages_debian_publications_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_dependencies
    ADD CONSTRAINT packages_dependencies_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_dependency_links
    ADD CONSTRAINT packages_dependency_links_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_helm_file_metadata
    ADD CONSTRAINT packages_helm_file_metadata_pkey PRIMARY KEY (package_file_id);

ALTER TABLE ONLY packages_maven_metadata
    ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_npm_metadata_caches
    ADD CONSTRAINT packages_npm_metadata_caches_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_npm_metadata
    ADD CONSTRAINT packages_npm_metadata_pkey PRIMARY KEY (package_id);

ALTER TABLE ONLY packages_nuget_dependency_link_metadata
    ADD CONSTRAINT packages_nuget_dependency_link_metadata_pkey PRIMARY KEY (dependency_link_id);

ALTER TABLE ONLY packages_nuget_metadata
    ADD CONSTRAINT packages_nuget_metadata_pkey PRIMARY KEY (package_id);

ALTER TABLE ONLY packages_nuget_symbols
    ADD CONSTRAINT packages_nuget_symbols_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_package_file_build_infos
    ADD CONSTRAINT packages_package_file_build_infos_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_package_files
    ADD CONSTRAINT packages_package_files_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_packages
    ADD CONSTRAINT packages_packages_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_protection_rules
    ADD CONSTRAINT packages_protection_rules_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_pypi_metadata
    ADD CONSTRAINT packages_pypi_metadata_pkey PRIMARY KEY (package_id);

ALTER TABLE ONLY packages_rpm_metadata
    ADD CONSTRAINT packages_rpm_metadata_pkey PRIMARY KEY (package_id);

ALTER TABLE ONLY packages_rpm_repository_files
    ADD CONSTRAINT packages_rpm_repository_files_pkey PRIMARY KEY (id);

ALTER TABLE ONLY packages_rubygems_metadata
    ADD CONSTRAINT packages_rubygems_metadata_pkey PRIMARY KEY (package_id);

