--
-- PostgreSQL database dump
--

\restrict jRVVCTjjNeqN7io926QnQVJwr7IrvCK3DlzNPCoIfbivC5osmHT8eLuiehzRiDV

-- Dumped from database version 15.15 (Debian 15.15-1.pgdg13+1)
-- Dumped by pg_dump version 15.15 (Debian 15.15-1.pgdg13+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: data; Type: SCHEMA; Schema: -; Owner: kincses
--

CREATE SCHEMA data;


ALTER SCHEMA data OWNER TO kincses;

--
-- Name: public; Type: SCHEMA; Schema: -; Owner: service_finder_app
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO service_finder_app;

--
-- Name: companyrole; Type: TYPE; Schema: data; Owner: kincses
--

CREATE TYPE data.companyrole AS ENUM (
    'owner',
    'manager',
    'driver'
);


ALTER TYPE data.companyrole OWNER TO kincses;

--
-- Name: expense_category_enum; Type: TYPE; Schema: data; Owner: kincses
--

CREATE TYPE data.expense_category_enum AS ENUM (
    'PURCHASE_PRICE',
    'TRANSFER_TAX',
    'ADMIN_FEE',
    'VEHICLE_TAX',
    'INSURANCE',
    'REFUELING',
    'SERVICE',
    'PARKING',
    'TOLL',
    'FINE',
    'TUNING_ACCESSORIES',
    'OTHER'
);


ALTER TYPE data.expense_category_enum OWNER TO kincses;

--
-- Name: moderation_status_enum; Type: TYPE; Schema: data; Owner: kincses
--

CREATE TYPE data.moderation_status_enum AS ENUM (
    'pending',
    'approved',
    'rejected'
);


ALTER TYPE data.moderation_status_enum OWNER TO kincses;

--
-- Name: source_type_enum; Type: TYPE; Schema: data; Owner: kincses
--

CREATE TYPE data.source_type_enum AS ENUM (
    'manual',
    'ocr',
    'api_import'
);


ALTER TYPE data.source_type_enum OWNER TO kincses;

--
-- Name: companyrole; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.companyrole AS ENUM (
    'OWNER',
    'MANAGER',
    'DRIVER'
);


ALTER TYPE public.companyrole OWNER TO kincses;

--
-- Name: emailtype; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.emailtype AS ENUM (
    'REGISTRATION',
    'PASSWORD_RESET',
    'GDPR_NOTICE'
);


ALTER TYPE public.emailtype OWNER TO kincses;

--
-- Name: orgtype; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.orgtype AS ENUM (
    'PRIVATE',
    'COMPANY',
    'SERVICE'
);


ALTER TYPE public.orgtype OWNER TO kincses;

--
-- Name: orguserrole; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.orguserrole AS ENUM (
    'OWNER',
    'ADMIN',
    'FLEET_MANAGER',
    'DRIVER',
    'owner',
    'manager',
    'driver',
    'service'
);


ALTER TYPE public.orguserrole OWNER TO kincses;

--
-- Name: tokentype; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.tokentype AS ENUM (
    'EMAIL_VERIFY',
    'PASSWORD_RESET',
    'email_verify'
);


ALTER TYPE public.tokentype OWNER TO kincses;

--
-- Name: uitheme; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.uitheme AS ENUM (
    'LIGHT',
    'DARK',
    'SYSTEM'
);


ALTER TYPE public.uitheme OWNER TO kincses;

--
-- Name: userrole; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.userrole AS ENUM (
    'OWNER',
    'ADMIN',
    'FLEET_MANAGER',
    'DRIVER'
);


ALTER TYPE public.userrole OWNER TO kincses;

--
-- Name: validationstatus; Type: TYPE; Schema: public; Owner: kincses
--

CREATE TYPE public.validationstatus AS ENUM (
    'NOT_VALIDATED',
    'PENDING',
    'VALIDATED',
    'REJECTED'
);


ALTER TYPE public.validationstatus OWNER TO kincses;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: audit_logs; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.audit_logs (
    id integer NOT NULL,
    user_id integer,
    action character varying(100) NOT NULL,
    endpoint character varying(255),
    method character varying(10),
    payload jsonb,
    ip_address character varying(45),
    user_agent text,
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE data.audit_logs OWNER TO kincses;

--
-- Name: audit_logs_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.audit_logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.audit_logs_id_seq OWNER TO kincses;

--
-- Name: audit_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.audit_logs_id_seq OWNED BY data.audit_logs.id;


--
-- Name: badges; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.badges (
    id integer NOT NULL,
    name character varying NOT NULL,
    description character varying NOT NULL,
    icon_url character varying
);


ALTER TABLE data.badges OWNER TO kincses;

--
-- Name: badges_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.badges_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.badges_id_seq OWNER TO kincses;

--
-- Name: badges_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.badges_id_seq OWNED BY data.badges.id;


--
-- Name: companies; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.companies (
    id integer NOT NULL,
    name character varying(255) NOT NULL,
    tax_number character varying(50),
    subscription_tier character varying(50) DEFAULT 'free'::character varying,
    owner_id integer NOT NULL
);


ALTER TABLE data.companies OWNER TO kincses;

--
-- Name: companies_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.companies_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.companies_id_seq OWNER TO kincses;

--
-- Name: companies_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.companies_id_seq OWNED BY data.companies.id;


--
-- Name: company_members; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.company_members (
    id integer NOT NULL,
    company_id integer NOT NULL,
    user_id integer NOT NULL,
    role data.companyrole DEFAULT 'driver'::data.companyrole,
    can_edit_service boolean DEFAULT false,
    can_see_costs boolean DEFAULT false,
    is_active boolean DEFAULT true
);


ALTER TABLE data.company_members OWNER TO kincses;

--
-- Name: company_members_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.company_members_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.company_members_id_seq OWNER TO kincses;

--
-- Name: company_members_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.company_members_id_seq OWNED BY data.company_members.id;


--
-- Name: competitions; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.competitions (
    id integer NOT NULL,
    name character varying NOT NULL,
    description text,
    start_date timestamp without time zone NOT NULL,
    end_date timestamp without time zone NOT NULL,
    is_active boolean
);


ALTER TABLE data.competitions OWNER TO kincses;

--
-- Name: competitions_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.competitions_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.competitions_id_seq OWNER TO kincses;

--
-- Name: competitions_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.competitions_id_seq OWNED BY data.competitions.id;


--
-- Name: credit_logs; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.credit_logs (
    id integer NOT NULL,
    org_id integer,
    amount numeric(10,2),
    description text,
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE data.credit_logs OWNER TO kincses;

--
-- Name: credit_logs_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.credit_logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.credit_logs_id_seq OWNER TO kincses;

--
-- Name: credit_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.credit_logs_id_seq OWNED BY data.credit_logs.id;


--
-- Name: email_logs; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.email_logs (
    id integer NOT NULL,
    email character varying,
    type character varying,
    sent_at timestamp with time zone DEFAULT now(),
    recipient character varying(255),
    user_id integer,
    provider_id integer,
    status character varying(50) DEFAULT 'sent'::character varying,
    email_type character varying(100)
);


ALTER TABLE data.email_logs OWNER TO kincses;

--
-- Name: email_logs_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.email_logs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.email_logs_id_seq OWNER TO kincses;

--
-- Name: email_logs_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.email_logs_id_seq OWNED BY data.email_logs.id;


--
-- Name: email_provider_configs; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.email_provider_configs (
    id integer NOT NULL,
    name character varying(50),
    provider_type character varying(20),
    priority integer,
    settings json NOT NULL,
    is_active boolean,
    fail_count integer,
    max_fail_threshold integer,
    success_rate double precision
);


ALTER TABLE data.email_provider_configs OWNER TO kincses;

--
-- Name: email_provider_configs_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.email_provider_configs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.email_provider_configs_id_seq OWNER TO kincses;

--
-- Name: email_provider_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.email_provider_configs_id_seq OWNED BY data.email_provider_configs.id;


--
-- Name: email_providers; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.email_providers (
    id integer NOT NULL,
    name character varying(50) NOT NULL,
    priority integer DEFAULT 1,
    provider_type character varying(10) DEFAULT 'SMTP'::character varying,
    host character varying(255),
    port integer,
    username character varying(255),
    password_hash character varying(255),
    is_active boolean DEFAULT true,
    daily_limit integer DEFAULT 300,
    current_daily_usage integer DEFAULT 0
);


ALTER TABLE data.email_providers OWNER TO kincses;

--
-- Name: email_providers_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.email_providers_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.email_providers_id_seq OWNER TO kincses;

--
-- Name: email_providers_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.email_providers_id_seq OWNED BY data.email_providers.id;


--
-- Name: email_templates; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.email_templates (
    id integer NOT NULL,
    type public.emailtype,
    subject character varying(255) NOT NULL,
    body_html text NOT NULL
);


ALTER TABLE data.email_templates OWNER TO kincses;

--
-- Name: email_templates_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.email_templates_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.email_templates_id_seq OWNER TO kincses;

--
-- Name: email_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.email_templates_id_seq OWNED BY data.email_templates.id;


--
-- Name: legal_acceptances; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.legal_acceptances (
    id integer NOT NULL,
    user_id integer,
    document_id integer,
    accepted_at timestamp with time zone DEFAULT now(),
    ip_address character varying(45),
    user_agent text
);


ALTER TABLE data.legal_acceptances OWNER TO kincses;

--
-- Name: legal_acceptances_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.legal_acceptances_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.legal_acceptances_id_seq OWNER TO kincses;

--
-- Name: legal_acceptances_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.legal_acceptances_id_seq OWNED BY data.legal_acceptances.id;


--
-- Name: legal_documents; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.legal_documents (
    id integer NOT NULL,
    title character varying(255),
    content text NOT NULL,
    version character varying(20) NOT NULL,
    region_code character varying(5),
    language character varying(5),
    is_active boolean,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE data.legal_documents OWNER TO kincses;

--
-- Name: legal_documents_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.legal_documents_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.legal_documents_id_seq OWNER TO kincses;

--
-- Name: legal_documents_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.legal_documents_id_seq OWNED BY data.legal_documents.id;


--
-- Name: level_configs; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.level_configs (
    id integer NOT NULL,
    level_number integer NOT NULL,
    min_points integer NOT NULL,
    rank_name character varying NOT NULL
);


ALTER TABLE data.level_configs OWNER TO kincses;

--
-- Name: level_configs_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.level_configs_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.level_configs_id_seq OWNER TO kincses;

--
-- Name: level_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.level_configs_id_seq OWNED BY data.level_configs.id;


--
-- Name: locations; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.locations (
    id integer NOT NULL,
    name character varying(255),
    address text,
    latitude numeric(9,6),
    longitude numeric(9,6),
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE data.locations OWNER TO kincses;

--
-- Name: locations_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.locations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.locations_id_seq OWNER TO kincses;

--
-- Name: locations_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.locations_id_seq OWNED BY data.locations.id;


--
-- Name: org_subscriptions; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.org_subscriptions (
    id integer NOT NULL,
    org_id integer,
    tier_id integer,
    valid_from timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    valid_until timestamp with time zone,
    is_active boolean DEFAULT true
);


ALTER TABLE data.org_subscriptions OWNER TO kincses;

--
-- Name: org_subscriptions_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.org_subscriptions_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.org_subscriptions_id_seq OWNER TO kincses;

--
-- Name: org_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.org_subscriptions_id_seq OWNED BY data.org_subscriptions.id;


--
-- Name: organization_locations; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.organization_locations (
    id integer NOT NULL,
    organization_id integer,
    label character varying(100),
    address text,
    latitude numeric(10,8),
    longitude numeric(11,8),
    is_main_location boolean DEFAULT false,
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE data.organization_locations OWNER TO kincses;

--
-- Name: organization_locations_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.organization_locations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.organization_locations_id_seq OWNER TO kincses;

--
-- Name: organization_locations_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.organization_locations_id_seq OWNED BY data.organization_locations.id;


--
-- Name: organization_members; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.organization_members (
    id integer NOT NULL,
    organization_id integer NOT NULL,
    user_id integer NOT NULL,
    role public.orguserrole,
    is_permanent boolean
);


ALTER TABLE data.organization_members OWNER TO kincses;

--
-- Name: organization_members_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.organization_members_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.organization_members_id_seq OWNER TO kincses;

--
-- Name: organization_members_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.organization_members_id_seq OWNED BY data.organization_members.id;


--
-- Name: organizations; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.organizations (
    id integer NOT NULL,
    name character varying NOT NULL,
    org_type public.orgtype,
    tax_number character varying,
    founded_at date,
    validation_status public.validationstatus,
    owner_id integer,
    ui_theme character varying,
    created_at timestamp with time zone DEFAULT now(),
    theme character varying DEFAULT 'system'::character varying,
    is_active boolean DEFAULT true,
    slug character varying(100)
);


ALTER TABLE data.organizations OWNER TO kincses;

--
-- Name: organizations_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.organizations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.organizations_id_seq OWNER TO kincses;

--
-- Name: organizations_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.organizations_id_seq OWNED BY data.organizations.id;


--
-- Name: point_rules; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.point_rules (
    id integer NOT NULL,
    action_key character varying NOT NULL,
    points integer NOT NULL,
    description character varying,
    is_active boolean NOT NULL
);


ALTER TABLE data.point_rules OWNER TO kincses;

--
-- Name: point_rules_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.point_rules_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.point_rules_id_seq OWNER TO kincses;

--
-- Name: point_rules_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.point_rules_id_seq OWNED BY data.point_rules.id;


--
-- Name: points_ledger; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.points_ledger (
    id integer NOT NULL,
    user_id integer NOT NULL,
    points integer NOT NULL,
    reason character varying NOT NULL,
    created_at timestamp without time zone NOT NULL
);


ALTER TABLE data.points_ledger OWNER TO kincses;

--
-- Name: points_ledger_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.points_ledger_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.points_ledger_id_seq OWNER TO kincses;

--
-- Name: points_ledger_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.points_ledger_id_seq OWNED BY data.points_ledger.id;


--
-- Name: regional_settings; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.regional_settings (
    id integer NOT NULL,
    country_code character varying NOT NULL,
    currency character varying NOT NULL,
    is_active boolean NOT NULL
);


ALTER TABLE data.regional_settings OWNER TO kincses;

--
-- Name: regional_settings_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.regional_settings_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.regional_settings_id_seq OWNER TO kincses;

--
-- Name: regional_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.regional_settings_id_seq OWNED BY data.regional_settings.id;


--
-- Name: service_providers; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.service_providers (
    id integer NOT NULL,
    name character varying NOT NULL,
    address character varying NOT NULL,
    category character varying,
    status data.moderation_status_enum NOT NULL,
    source data.source_type_enum NOT NULL,
    validation_score integer,
    evidence_image_path character varying,
    added_by_user_id integer,
    created_at timestamp without time zone
);


ALTER TABLE data.service_providers OWNER TO kincses;

--
-- Name: service_providers_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.service_providers_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.service_providers_id_seq OWNER TO kincses;

--
-- Name: service_providers_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.service_providers_id_seq OWNED BY data.service_providers.id;


--
-- Name: service_specialties; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.service_specialties (
    id integer NOT NULL,
    parent_id integer,
    name character varying(100),
    slug character varying(100)
);


ALTER TABLE data.service_specialties OWNER TO kincses;

--
-- Name: service_specialties_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.service_specialties_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.service_specialties_id_seq OWNER TO kincses;

--
-- Name: service_specialties_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.service_specialties_id_seq OWNED BY data.service_specialties.id;


--
-- Name: subscription_tiers; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.subscription_tiers (
    id integer NOT NULL,
    name character varying(50),
    rules jsonb,
    is_custom boolean DEFAULT false
);


ALTER TABLE data.subscription_tiers OWNER TO kincses;

--
-- Name: subscription_tiers_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.subscription_tiers_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.subscription_tiers_id_seq OWNER TO kincses;

--
-- Name: subscription_tiers_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.subscription_tiers_id_seq OWNED BY data.subscription_tiers.id;


--
-- Name: system_settings; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.system_settings (
    key_name character varying NOT NULL,
    value_json json NOT NULL,
    description character varying,
    region_code character varying(5),
    tier_id integer,
    org_id integer
);


ALTER TABLE data.system_settings OWNER TO kincses;

--
-- Name: translations; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.translations (
    id integer NOT NULL,
    key character varying(100) NOT NULL,
    lang_code character varying(5) NOT NULL,
    value text NOT NULL,
    is_published boolean
);


ALTER TABLE data.translations OWNER TO kincses;

--
-- Name: translations_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.translations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.translations_id_seq OWNER TO kincses;

--
-- Name: translations_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.translations_id_seq OWNED BY data.translations.id;


--
-- Name: user_badges; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.user_badges (
    id integer NOT NULL,
    user_id integer NOT NULL,
    badge_id integer NOT NULL,
    earned_at timestamp without time zone NOT NULL
);


ALTER TABLE data.user_badges OWNER TO kincses;

--
-- Name: user_badges_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.user_badges_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.user_badges_id_seq OWNER TO kincses;

--
-- Name: user_badges_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.user_badges_id_seq OWNED BY data.user_badges.id;


--
-- Name: user_scores; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.user_scores (
    id integer NOT NULL,
    user_id integer,
    competition_id integer,
    points integer,
    last_updated timestamp without time zone
);


ALTER TABLE data.user_scores OWNER TO kincses;

--
-- Name: user_scores_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.user_scores_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.user_scores_id_seq OWNER TO kincses;

--
-- Name: user_scores_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.user_scores_id_seq OWNED BY data.user_scores.id;


--
-- Name: user_stats; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.user_stats (
    id integer NOT NULL,
    user_id integer NOT NULL,
    total_points integer NOT NULL,
    current_level integer NOT NULL,
    last_activity timestamp without time zone NOT NULL
);


ALTER TABLE data.user_stats OWNER TO kincses;

--
-- Name: user_stats_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.user_stats_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.user_stats_id_seq OWNER TO kincses;

--
-- Name: user_stats_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.user_stats_id_seq OWNED BY data.user_stats.id;


--
-- Name: user_vehicles; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.user_vehicles (
    id integer NOT NULL,
    vin character varying NOT NULL,
    license_plate character varying NOT NULL,
    variant_id integer,
    color character varying,
    purchase_date timestamp without time zone,
    purchase_price double precision,
    current_odometer double precision,
    extras json,
    current_org_id integer,
    created_at timestamp with time zone DEFAULT now(),
    is_deleted boolean
);


ALTER TABLE data.user_vehicles OWNER TO kincses;

--
-- Name: user_vehicles_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.user_vehicles_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.user_vehicles_id_seq OWNER TO kincses;

--
-- Name: user_vehicles_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.user_vehicles_id_seq OWNED BY data.user_vehicles.id;


--
-- Name: users; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.users (
    id integer NOT NULL,
    email character varying NOT NULL,
    first_name character varying,
    last_name character varying,
    birthday date,
    is_active boolean,
    is_banned boolean,
    is_gdpr_deleted boolean,
    previous_login_count integer,
    created_at timestamp with time zone DEFAULT now(),
    verified_at timestamp with time zone,
    hashed_password character varying,
    role character varying DEFAULT 'user'::character varying,
    is_superuser boolean DEFAULT false,
    is_company boolean DEFAULT false,
    updated_at timestamp with time zone,
    company_name character varying,
    tax_number character varying,
    region_code character varying DEFAULT 'HU'::character varying
);


ALTER TABLE data.users OWNER TO kincses;

--
-- Name: users_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.users_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.users_id_seq OWNER TO kincses;

--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.users_id_seq OWNED BY data.users.id;


--
-- Name: vehicle_brands; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.vehicle_brands (
    id integer NOT NULL,
    name character varying NOT NULL,
    origin_country character varying,
    slug character varying,
    country_code character varying,
    category_id integer
);


ALTER TABLE data.vehicle_brands OWNER TO kincses;

--
-- Name: vehicle_brands_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.vehicle_brands_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.vehicle_brands_id_seq OWNER TO kincses;

--
-- Name: vehicle_brands_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.vehicle_brands_id_seq OWNED BY data.vehicle_brands.id;


--
-- Name: vehicle_categories; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.vehicle_categories (
    id integer NOT NULL,
    name character varying NOT NULL,
    slug character varying
);


ALTER TABLE data.vehicle_categories OWNER TO kincses;

--
-- Name: vehicle_categories_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.vehicle_categories_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.vehicle_categories_id_seq OWNER TO kincses;

--
-- Name: vehicle_categories_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.vehicle_categories_id_seq OWNED BY data.vehicle_categories.id;


--
-- Name: vehicle_events; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.vehicle_events (
    id integer NOT NULL,
    vehicle_id integer,
    service_provider_id integer,
    event_type character varying(100),
    description text,
    odometer_reading integer,
    event_date timestamp with time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE data.vehicle_events OWNER TO kincses;

--
-- Name: vehicle_events_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.vehicle_events_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.vehicle_events_id_seq OWNER TO kincses;

--
-- Name: vehicle_events_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.vehicle_events_id_seq OWNED BY data.vehicle_events.id;


--
-- Name: vehicle_models; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.vehicle_models (
    id integer NOT NULL,
    brand_id integer,
    category_id integer,
    name character varying NOT NULL,
    year_start integer,
    year_end integer,
    slug character varying
);


ALTER TABLE data.vehicle_models OWNER TO kincses;

--
-- Name: vehicle_models_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.vehicle_models_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.vehicle_models_id_seq OWNER TO kincses;

--
-- Name: vehicle_models_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.vehicle_models_id_seq OWNED BY data.vehicle_models.id;


--
-- Name: vehicle_ownership; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.vehicle_ownership (
    id integer NOT NULL,
    vehicle_id integer NOT NULL,
    user_id integer NOT NULL,
    role character varying(20),
    license_plate character varying(20),
    is_active boolean,
    start_date date DEFAULT CURRENT_DATE,
    end_date date
);


ALTER TABLE data.vehicle_ownership OWNER TO kincses;

--
-- Name: vehicle_ownership_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.vehicle_ownership_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.vehicle_ownership_id_seq OWNER TO kincses;

--
-- Name: vehicle_ownership_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.vehicle_ownership_id_seq OWNED BY data.vehicle_ownership.id;


--
-- Name: vehicle_variants; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.vehicle_variants (
    id integer NOT NULL,
    model_id integer,
    engine_size double precision,
    power_kw double precision,
    spec_data json
);


ALTER TABLE data.vehicle_variants OWNER TO kincses;

--
-- Name: vehicle_variants_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.vehicle_variants_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.vehicle_variants_id_seq OWNER TO kincses;

--
-- Name: vehicle_variants_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.vehicle_variants_id_seq OWNED BY data.vehicle_variants.id;


--
-- Name: vehicles; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.vehicles (
    id integer NOT NULL,
    model_id integer NOT NULL,
    license_plate character varying(20),
    vin character varying(50),
    manufacture_year integer,
    color character varying(50),
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
    category character varying(50),
    current_odometer integer DEFAULT 0,
    engine_number character varying(100),
    base_color character varying(50)
);


ALTER TABLE data.vehicles OWNER TO kincses;

--
-- Name: vehicles_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.vehicles_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.vehicles_id_seq OWNER TO kincses;

--
-- Name: vehicles_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.vehicles_id_seq OWNED BY data.vehicles.id;


--
-- Name: verification_tokens; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.verification_tokens (
    id integer NOT NULL,
    user_id integer,
    token character varying(255),
    token_type public.tokentype,
    expires_at timestamp with time zone,
    created_at timestamp with time zone DEFAULT now(),
    token_hash text,
    is_used boolean DEFAULT false
);


ALTER TABLE data.verification_tokens OWNER TO kincses;

--
-- Name: verification_tokens_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.verification_tokens_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.verification_tokens_id_seq OWNER TO kincses;

--
-- Name: verification_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.verification_tokens_id_seq OWNED BY data.verification_tokens.id;


--
-- Name: votes; Type: TABLE; Schema: data; Owner: kincses
--

CREATE TABLE data.votes (
    id integer NOT NULL,
    user_id integer NOT NULL,
    provider_id integer NOT NULL,
    vote_value integer NOT NULL
);


ALTER TABLE data.votes OWNER TO kincses;

--
-- Name: votes_id_seq; Type: SEQUENCE; Schema: data; Owner: kincses
--

CREATE SEQUENCE data.votes_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER TABLE data.votes_id_seq OWNER TO kincses;

--
-- Name: votes_id_seq; Type: SEQUENCE OWNED BY; Schema: data; Owner: kincses
--

ALTER SEQUENCE data.votes_id_seq OWNED BY data.votes.id;


--
-- Name: alembic_version; Type: TABLE; Schema: public; Owner: kincses
--

CREATE TABLE public.alembic_version (
    version_num character varying(32) NOT NULL
);


ALTER TABLE public.alembic_version OWNER TO kincses;

--
-- Name: audit_logs id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.audit_logs ALTER COLUMN id SET DEFAULT nextval('data.audit_logs_id_seq'::regclass);


--
-- Name: badges id; Type: DEFAULT; Schema: data; Owner: kincses
--

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


--
-- Name: companies id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.companies ALTER COLUMN id SET DEFAULT nextval('data.companies_id_seq'::regclass);


--
-- Name: company_members id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.company_members ALTER COLUMN id SET DEFAULT nextval('data.company_members_id_seq'::regclass);


--
-- Name: competitions id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.competitions ALTER COLUMN id SET DEFAULT nextval('data.competitions_id_seq'::regclass);


--
-- Name: credit_logs id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.credit_logs ALTER COLUMN id SET DEFAULT nextval('data.credit_logs_id_seq'::regclass);


--
-- Name: email_logs id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_logs ALTER COLUMN id SET DEFAULT nextval('data.email_logs_id_seq'::regclass);


--
-- Name: email_provider_configs id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_provider_configs ALTER COLUMN id SET DEFAULT nextval('data.email_provider_configs_id_seq'::regclass);


--
-- Name: email_providers id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_providers ALTER COLUMN id SET DEFAULT nextval('data.email_providers_id_seq'::regclass);


--
-- Name: email_templates id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_templates ALTER COLUMN id SET DEFAULT nextval('data.email_templates_id_seq'::regclass);


--
-- Name: legal_acceptances id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.legal_acceptances ALTER COLUMN id SET DEFAULT nextval('data.legal_acceptances_id_seq'::regclass);


--
-- Name: legal_documents id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.legal_documents ALTER COLUMN id SET DEFAULT nextval('data.legal_documents_id_seq'::regclass);


--
-- Name: level_configs id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.level_configs ALTER COLUMN id SET DEFAULT nextval('data.level_configs_id_seq'::regclass);


--
-- Name: locations id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.locations ALTER COLUMN id SET DEFAULT nextval('data.locations_id_seq'::regclass);


--
-- Name: org_subscriptions id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.org_subscriptions ALTER COLUMN id SET DEFAULT nextval('data.org_subscriptions_id_seq'::regclass);


--
-- Name: organization_locations id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_locations ALTER COLUMN id SET DEFAULT nextval('data.organization_locations_id_seq'::regclass);


--
-- Name: organization_members id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_members ALTER COLUMN id SET DEFAULT nextval('data.organization_members_id_seq'::regclass);


--
-- Name: organizations id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organizations ALTER COLUMN id SET DEFAULT nextval('data.organizations_id_seq'::regclass);


--
-- Name: point_rules id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.point_rules ALTER COLUMN id SET DEFAULT nextval('data.point_rules_id_seq'::regclass);


--
-- Name: points_ledger id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.points_ledger ALTER COLUMN id SET DEFAULT nextval('data.points_ledger_id_seq'::regclass);


--
-- Name: regional_settings id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.regional_settings ALTER COLUMN id SET DEFAULT nextval('data.regional_settings_id_seq'::regclass);


--
-- Name: service_providers id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.service_providers ALTER COLUMN id SET DEFAULT nextval('data.service_providers_id_seq'::regclass);


--
-- Name: service_specialties id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.service_specialties ALTER COLUMN id SET DEFAULT nextval('data.service_specialties_id_seq'::regclass);


--
-- Name: subscription_tiers id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.subscription_tiers ALTER COLUMN id SET DEFAULT nextval('data.subscription_tiers_id_seq'::regclass);


--
-- Name: translations id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.translations ALTER COLUMN id SET DEFAULT nextval('data.translations_id_seq'::regclass);


--
-- Name: user_badges id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_badges ALTER COLUMN id SET DEFAULT nextval('data.user_badges_id_seq'::regclass);


--
-- Name: user_scores id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_scores ALTER COLUMN id SET DEFAULT nextval('data.user_scores_id_seq'::regclass);


--
-- Name: user_stats id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_stats ALTER COLUMN id SET DEFAULT nextval('data.user_stats_id_seq'::regclass);


--
-- Name: user_vehicles id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_vehicles ALTER COLUMN id SET DEFAULT nextval('data.user_vehicles_id_seq'::regclass);


--
-- Name: users id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.users ALTER COLUMN id SET DEFAULT nextval('data.users_id_seq'::regclass);


--
-- Name: vehicle_brands id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_brands ALTER COLUMN id SET DEFAULT nextval('data.vehicle_brands_id_seq'::regclass);


--
-- Name: vehicle_categories id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_categories ALTER COLUMN id SET DEFAULT nextval('data.vehicle_categories_id_seq'::regclass);


--
-- Name: vehicle_events id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_events ALTER COLUMN id SET DEFAULT nextval('data.vehicle_events_id_seq'::regclass);


--
-- Name: vehicle_models id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_models ALTER COLUMN id SET DEFAULT nextval('data.vehicle_models_id_seq'::regclass);


--
-- Name: vehicle_ownership id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_ownership ALTER COLUMN id SET DEFAULT nextval('data.vehicle_ownership_id_seq'::regclass);


--
-- Name: vehicle_variants id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_variants ALTER COLUMN id SET DEFAULT nextval('data.vehicle_variants_id_seq'::regclass);


--
-- Name: vehicles id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicles ALTER COLUMN id SET DEFAULT nextval('data.vehicles_id_seq'::regclass);


--
-- Name: verification_tokens id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.verification_tokens ALTER COLUMN id SET DEFAULT nextval('data.verification_tokens_id_seq'::regclass);


--
-- Name: votes id; Type: DEFAULT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.votes ALTER COLUMN id SET DEFAULT nextval('data.votes_id_seq'::regclass);


--
-- Data for Name: audit_logs; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.audit_logs (id, user_id, action, endpoint, method, payload, ip_address, user_agent, created_at) FROM stdin;
4	4	USER_REGISTERED	/api/v2/auth/register	POST	\N	192.168.100.179	\N	2026-01-28 19:37:19.225767+00
\.


--
-- Data for Name: badges; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.badges (id, name, description, icon_url) FROM stdin;
\.


--
-- Data for Name: companies; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.companies (id, name, tax_number, subscription_tier, owner_id) FROM stdin;
\.


--
-- Data for Name: company_members; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.company_members (id, company_id, user_id, role, can_edit_service, can_see_costs, is_active) FROM stdin;
\.


--
-- Data for Name: competitions; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.competitions (id, name, description, start_date, end_date, is_active) FROM stdin;
\.


--
-- Data for Name: credit_logs; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.credit_logs (id, org_id, amount, description, created_at) FROM stdin;
2	1	10000.00	Kezdő tesztkeret	2026-01-26 22:47:12.891324+00
\.


--
-- Data for Name: email_logs; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.email_logs (id, email, type, sent_at, recipient, user_id, provider_id, status, email_type) FROM stdin;
1	\N	\N	2026-01-28 19:37:19.482744+00	zs.gyongyossy@gmail.com	4	5	sent	registration
\.


--
-- Data for Name: email_provider_configs; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.email_provider_configs (id, name, provider_type, priority, settings, is_active, fail_count, max_fail_threshold, success_rate) FROM stdin;
1	SendGrid_Primary	SENDGRID	1	{"api_key": "YOUR_SENDGRID_KEY_HERE"}	t	0	3	100
\.


--
-- Data for Name: email_providers; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.email_providers (id, name, priority, provider_type, host, port, username, password_hash, is_active, daily_limit, current_daily_usage) FROM stdin;
2	Resend_Backup	2	API	\N	\N	\N	\N	f	3000	0
5	SendGrid	1	SMTP	smtp.sendgrid.net	587	apikey	[REDACTED]t	100	0
\.


--
-- Data for Name: email_templates; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.email_templates (id, type, subject, body_html) FROM stdin;
1	REGISTRATION	Üdvözöljük a Service Finderben!	\n                <h3>Kedves {{ name }}!</h3>\n                <p>Köszönjük a regisztrációt! Az aktiváláshoz kattints ide:</p>\n                <a href="{{ link }}">Fiók aktiválása</a>\n                <p>A link 24 óráig érvényes.</p>\n            
\.


--
-- Data for Name: legal_acceptances; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.legal_acceptances (id, user_id, document_id, accepted_at, ip_address, user_agent) FROM stdin;
\.


--
-- Data for Name: legal_documents; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.legal_documents (id, title, content, version, region_code, language, is_active, created_at) FROM stdin;
1	Általános Szerződési Feltételek	Ide jön az ÁSZF szövege... Kérjük görgessen az aljáig.	v1.0	HU	hu	t	2026-01-26 10:09:00.632463+00
2	Adatkezelési Tájékoztató (GDPR)	Ide jön a GDPR szövege... Kérjük görgessen az aljáig.	v1.0	HU	hu	t	2026-01-26 10:09:00.632463+00
\.


--
-- Data for Name: level_configs; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.level_configs (id, level_number, min_points, rank_name) FROM stdin;
\.


--
-- Data for Name: locations; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.locations (id, name, address, latitude, longitude, created_at) FROM stdin;
\.


--
-- Data for Name: org_subscriptions; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.org_subscriptions (id, org_id, tier_id, valid_from, valid_until, is_active) FROM stdin;
1	1	3	2026-01-26 22:47:12.891324+00	2030-01-01 00:00:00+00	t
\.


--
-- Data for Name: organization_locations; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.organization_locations (id, organization_id, label, address, latitude, longitude, is_main_location, created_at) FROM stdin;
1	2	Budaörsi Telep	Budaörs, Fő út 1.	47.46200000	18.95300000	t	2026-01-27 18:39:56.278217+00
2	2	Pesti Gyorsszerviz	Budapest, Váci út 10.	47.53100000	19.06900000	f	2026-01-27 18:39:56.278217+00
\.


--
-- Data for Name: organization_members; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.organization_members (id, organization_id, user_id, role, is_permanent) FROM stdin;
1	1	1	owner	\N
\.


--
-- Data for Name: organizations; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.organizations (id, name, org_type, tax_number, founded_at, validation_status, owner_id, ui_theme, created_at, theme, is_active, slug) FROM stdin;
1	Admin Flotta	\N	\N	\N	\N	\N	\N	2026-01-26 22:47:12.875535+00	system	t	admin-flotta
2	Gumi Mester Kft.	SERVICE	\N	\N	\N	\N	\N	2026-01-27 18:39:56.278217+00	system	t	gumi-mester-kft
\.


--
-- Data for Name: point_rules; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.point_rules (id, action_key, points, description, is_active) FROM stdin;
\.


--
-- Data for Name: points_ledger; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.points_ledger (id, user_id, points, reason, created_at) FROM stdin;
\.


--
-- Data for Name: regional_settings; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.regional_settings (id, country_code, currency, is_active) FROM stdin;
\.


--
-- Data for Name: service_providers; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.service_providers (id, name, address, category, status, source, validation_score, evidence_image_path, added_by_user_id, created_at) FROM stdin;
\.


--
-- Data for Name: service_specialties; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.service_specialties (id, parent_id, name, slug) FROM stdin;
1	\N	Karosszéria	bodywork
2	\N	Elektromos hajtás	electric-drive
3	1	Fényezés	painting
4	1	Lakatos munkák	metal-work
9	3	Bolore Blue Technológia	bolore-blue
\.


--
-- Data for Name: subscription_tiers; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.subscription_tiers (id, name, rules, is_custom) FROM stdin;
1	Free	{"max_vehicles": 1, "ai_verification": false}	f
2	Premium	{"fleet_report": true, "max_vehicles": 10, "ai_verification": true}	f
3	VIP	{"max_vehicles": 999, "ai_verification": true, "priority_support": true}	f
\.


--
-- Data for Name: system_settings; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.system_settings (key_name, value_json, description, region_code, tier_id, org_id) FROM stdin;
max_vehicles	3	Globális alapértelmezett járműlimit a Free csomagban	\N	\N	\N
weight_distance	0.6	A távolság súlya a rangsorolásban (0.0 - 1.0)	\N	\N	\N
weight_rating	0.4	Az értékelés súlya a rangsorolásban (0.0 - 1.0)	\N	\N	\N
bonus_gold_service	500	Fix bónusz pont Gold fokozatú szervizeknek	\N	\N	\N
match_limit_default	5	Hány találatot mutassunk alapból	\N	\N	\N
audit_log_enabled	true	Minden felhasználói mozdulat naplózása (true/false)	\N	\N	\N
audit_log_retention_days	90	Hány napig őrizzük meg a naplókat	\N	\N	\N
registration_throttle_minutes	10	Bot-védelem: IP alapú regisztrációs korlát percekben	\N	\N	\N
allowed_countries_list	["AT", "BE", "BG", "CY", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GR", "HR", "HU", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PL", "PT", "RO", "SE", "SI", "SK"]	Engedélyezett országkódok listája	\N	\N	\N
\.


--
-- Data for Name: translations; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.translations (id, key, lang_code, value, is_published) FROM stdin;
\.


--
-- Data for Name: user_badges; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.user_badges (id, user_id, badge_id, earned_at) FROM stdin;
\.


--
-- Data for Name: user_scores; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.user_scores (id, user_id, competition_id, points, last_updated) FROM stdin;
\.


--
-- Data for Name: user_stats; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.user_stats (id, user_id, total_points, current_level, last_activity) FROM stdin;
\.


--
-- Data for Name: user_vehicles; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.user_vehicles (id, vin, license_plate, variant_id, color, purchase_date, purchase_price, current_odometer, extras, current_org_id, created_at, is_deleted) FROM stdin;
\.


--
-- Data for Name: users; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.users (id, email, first_name, last_name, birthday, is_active, is_banned, is_gdpr_deleted, previous_login_count, created_at, verified_at, hashed_password, role, is_superuser, is_company, updated_at, company_name, tax_number, region_code) FROM stdin;
1	admin@profibot.hu	Admin	Profibot	\N	t	\N	\N	\N	2026-01-26 20:32:23.490817+00	\N	$2b$12$97TXbl.pcuJhCzPboqczxeuIW0Lt8OOvT3JrvLIEaBvvgJ1kWcERq	admin	t	f	\N	\N	\N	HU
4	zs.gyongyossy@gmail.com	zsolt	gyongyossy	\N	t	\N	\N	\N	2026-01-28 19:37:19.225767+00	\N	$2b$12$ZGTO7x2timOCvUf/hvehDOfqkCsqddC6nWuScXXGzNe5trsGqQuRi	user	f	f	\N	\N	\N	HU
\.


--
-- Data for Name: vehicle_brands; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.vehicle_brands (id, name, origin_country, slug, country_code, category_id) FROM stdin;
1	Honda	\N	honda	JP	\N
29	BMW	\N	bmw	\N	\N
30	Tesla	\N	tesla	\N	\N
31	Yamaha	\N	yamaha	\N	\N
32	Scania	\N	scania	\N	\N
33	Mercedes-Benz	\N	mercedes	\N	\N
35	Toyota	\N	\N	\N	3
36	Volkswagen	\N	\N	\N	3
37	Ford	\N	\N	\N	3
40	Audi	\N	\N	\N	3
42	Hyundai	\N	\N	\N	3
43	Kia	\N	\N	\N	3
44	Mazda	\N	\N	\N	3
45	Nissan	\N	\N	\N	3
46	Opel	\N	\N	\N	3
47	Peugeot	\N	\N	\N	3
48	Renault	\N	\N	\N	3
49	Skoda	\N	\N	\N	3
50	Suzuki	\N	\N	\N	3
51	Volvo	\N	\N	\N	3
52	Fiat	\N	\N	\N	3
53	Dacia	\N	\N	\N	3
54	Citroen	\N	\N	\N	3
56	Lexus	\N	\N	\N	3
57	Alfa Romeo	\N	\N	\N	3
58	Jaguar	\N	\N	\N	3
59	Land Rover	\N	\N	\N	3
60	Mitsubishi	\N	\N	\N	3
61	Subaru	\N	\N	\N	3
62	Seat	\N	\N	\N	3
63	Cupra	\N	\N	\N	3
64	Jeep	\N	\N	\N	3
65	Chevrolet	\N	\N	\N	3
66	Cadillac	\N	\N	\N	3
67	Buick	\N	\N	\N	3
68	GMC	\N	\N	\N	3
69	Dodge	\N	\N	\N	3
70	Ram	\N	\N	\N	3
71	Chrysler	\N	\N	\N	3
72	Acura	\N	\N	\N	3
73	Infiniti	\N	\N	\N	3
74	Lincoln	\N	\N	\N	3
75	Porsche	\N	\N	\N	3
76	Mini	\N	\N	\N	3
77	Smart	\N	\N	\N	3
78	Bentley	\N	\N	\N	3
79	Rolls-Royce	\N	\N	\N	3
80	Lamborghini	\N	\N	\N	3
81	Ferrari	\N	\N	\N	3
82	Maserati	\N	\N	\N	3
83	Aston Martin	\N	\N	\N	3
84	Bugatti	\N	\N	\N	3
85	Lotus	\N	\N	\N	3
86	McLaren	\N	\N	\N	3
87	Polestar	\N	\N	\N	3
88	Genesis	\N	\N	\N	3
89	BYD	\N	\N	\N	3
90	Geely	\N	\N	\N	3
91	Chery	\N	\N	\N	3
92	MG	\N	\N	\N	3
93	Lada	\N	\N	\N	3
94	Iveco	\N	\N	\N	3
95	Isuzu	\N	\N	\N	3
96	SsangYong	\N	\N	\N	3
97	Rover	\N	\N	\N	3
98	Saab	\N	\N	\N	3
99	Lancia	\N	\N	\N	3
100	Pontiac	\N	\N	\N	3
101	Saturn	\N	\N	\N	3
102	Hummer	\N	\N	\N	3
103	Oldsmobile	\N	\N	\N	3
106	Kawasaki	\N	\N	\N	4
108	BMW Motorrad	\N	\N	\N	4
109	Harley-Davidson	\N	\N	\N	4
110	Ducati	\N	\N	\N	4
111	KTM	\N	\N	\N	4
112	Triumph	\N	\N	\N	4
113	Royal Enfield	\N	\N	\N	4
114	Indian	\N	\N	\N	4
115	Aprilia	\N	\N	\N	4
116	Moto Guzzi	\N	\N	\N	4
117	Vespa	\N	\N	\N	4
118	Piaggio	\N	\N	\N	4
119	MV Agusta	\N	\N	\N	4
120	Norton	\N	\N	\N	4
121	Husqvarna	\N	\N	\N	4
122	Benelli	\N	\N	\N	4
123	Bimota	\N	\N	\N	4
124	Beta	\N	\N	\N	4
125	Gas Gas	\N	\N	\N	4
126	Sherco	\N	\N	\N	4
127	CF Moto	\N	\N	\N	4
128	Hyosung	\N	\N	\N	4
129	Keeway	\N	\N	\N	4
130	SYM	\N	\N	\N	4
131	Kymco	\N	\N	\N	4
132	Bajaj	\N	\N	\N	4
133	Zero	\N	\N	\N	4
135	Volvo Trucks	\N	\N	\N	5
136	MAN	\N	\N	\N	5
137	DAF	\N	\N	\N	5
139	Mercedes-Benz Trucks	\N	\N	\N	5
140	Renault Trucks	\N	\N	\N	5
141	MACK	\N	\N	\N	5
142	Peterbilt	\N	\N	\N	5
143	Kenworth	\N	\N	\N	5
144	Ford Commercial	\N	\N	\N	6
145	Volkswagen Commercial	\N	\N	\N	6
146	Iveco Daily	\N	\N	\N	6
147	Mercedes-Benz Vans	\N	\N	\N	6
148	Fiat Professional	\N	\N	\N	6
\.


--
-- Data for Name: vehicle_categories; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.vehicle_categories (id, name, slug) FROM stdin;
1	Személyautó	car
2	Motorkerékpár	motorcycle
3	CAR	\N
4	MOTORCYCLE	\N
5	TRUCK	\N
6	VAN	\N
\.


--
-- Data for Name: vehicle_events; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.vehicle_events (id, vehicle_id, service_provider_id, event_type, description, odometer_reading, event_date) FROM stdin;
\.


--
-- Data for Name: vehicle_models; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.vehicle_models (id, brand_id, category_id, name, year_start, year_end, slug) FROM stdin;
1	1	\N	Civic	\N	\N	civic
2	1	\N	Accord	\N	\N	accord
3	1	\N	CR-V	\N	\N	cr-v
4	1	\N	Jazz	\N	\N	jazz
5	1	\N	HR-V	\N	\N	hr-v
6	1	\N	NSX	\N	\N	nsx
34	29	\N	320d	\N	\N	320d
35	30	\N	Model 3	\N	\N	model-3
36	31	\N	MT-07	\N	\N	mt-07
37	32	\N	R500	\N	\N	r500
38	33	\N	Actros	\N	\N	actros
39	1	\N	Africa Twin	\N	\N	africa-twin
44	1	\N	CB 500	\N	\N	\N
46	29	\N	3 Series	\N	\N	\N
47	29	\N	5 Series	\N	\N	\N
48	29	\N	X5	\N	\N	\N
49	29	\N	X3	\N	\N	\N
50	29	\N	1 Series	\N	\N	\N
51	29	\N	7 Series	\N	\N	\N
53	31	\N	R1	\N	\N	\N
54	31	\N	Tracer 900	\N	\N	\N
55	31	\N	Ténéré 700	\N	\N	\N
56	31	\N	XMAX	\N	\N	\N
57	32	\N	R-series	\N	\N	\N
58	32	\N	S-series	\N	\N	\N
59	32	\N	G-series	\N	\N	\N
60	32	\N	P-series	\N	\N	\N
61	35	\N	Corolla	\N	\N	\N
62	35	\N	Yaris	\N	\N	\N
63	35	\N	Hilux	\N	\N	\N
64	35	\N	RAV4	\N	\N	\N
65	35	\N	C-HR	\N	\N	\N
66	35	\N	Avensis	\N	\N	\N
67	35	\N	Land Cruiser	\N	\N	\N
68	36	\N	Golf	\N	\N	\N
69	36	\N	Passat	\N	\N	\N
70	36	\N	Polo	\N	\N	\N
71	36	\N	Tiguan	\N	\N	\N
72	36	\N	Touran	\N	\N	\N
73	36	\N	Transporter	\N	\N	\N
74	36	\N	Caddy	\N	\N	\N
\.


--
-- Data for Name: vehicle_ownership; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.vehicle_ownership (id, vehicle_id, user_id, role, license_plate, is_active, start_date, end_date) FROM stdin;
1	3	1	owner	BMW-320-DE	t	2026-01-26	\N
2	4	1	owner	EL-TESLA-01	t	2026-01-26	\N
3	5	1	owner	MOTO-001	t	2026-01-26	\N
4	6	1	owner	HON-AFR-01	t	2026-01-26	\N
5	7	1	owner	TRUCK-01	t	2026-01-26	\N
6	8	1	owner	KAMION-01	t	2026-01-26	\N
\.


--
-- Data for Name: vehicle_variants; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.vehicle_variants (id, model_id, engine_size, power_kw, spec_data) FROM stdin;
\.


--
-- Data for Name: vehicles; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.vehicles (id, model_id, license_plate, vin, manufacture_year, color, created_at, updated_at, category, current_odometer, engine_number, base_color) FROM stdin;
1	1	PRO-F1-01	HONDA123456789	2024	Sonic Grey	2026-01-26 20:39:18.015641+00	2026-01-26 20:39:18.015641+00	\N	0	\N	\N
3	34	\N	VIN-BMW-CAR-001	2022	\N	2026-01-26 21:48:09.085387+00	2026-01-26 21:48:09.085387+00	land	45000	\N	\N
4	35	\N	VIN-TSL-ELE-002	2023	\N	2026-01-26 21:48:09.085387+00	2026-01-26 21:48:09.085387+00	land	12000	\N	\N
5	36	\N	VIN-YAM-MOT-003	2021	\N	2026-01-26 21:48:09.085387+00	2026-01-26 21:48:09.085387+00	land	8500	\N	\N
6	39	\N	VIN-HON-MOT-004	2024	\N	2026-01-26 21:48:09.085387+00	2026-01-26 21:48:09.085387+00	land	500	\N	\N
7	37	\N	VIN-SCA-TRU-005	2020	\N	2026-01-26 21:48:09.085387+00	2026-01-26 21:48:09.085387+00	land	350000	\N	\N
8	38	\N	VIN-MER-TRU-006	2021	\N	2026-01-26 21:48:09.085387+00	2026-01-26 21:48:09.085387+00	land	280000	\N	\N
\.


--
-- Data for Name: verification_tokens; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.verification_tokens (id, user_id, token, token_type, expires_at, created_at, token_hash, is_used) FROM stdin;
4	4	\N	email_verify	2026-01-30 19:37:19.480563+00	2026-01-28 19:37:19.225767+00	8eba078dc9ab1f95c7189efb68723b19146e34b4e48dc6e30dfee3b4f2655532	t
\.


--
-- Data for Name: votes; Type: TABLE DATA; Schema: data; Owner: kincses
--

COPY data.votes (id, user_id, provider_id, vote_value) FROM stdin;
\.


--
-- Data for Name: alembic_version; Type: TABLE DATA; Schema: public; Owner: kincses
--

COPY public.alembic_version (version_num) FROM stdin;
10b73fee8967
\.


--
-- Name: audit_logs_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.audit_logs_id_seq', 4, true);


--
-- Name: badges_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.badges_id_seq', 1, false);


--
-- Name: companies_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.companies_id_seq', 1, false);


--
-- Name: company_members_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.company_members_id_seq', 1, false);


--
-- Name: competitions_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.competitions_id_seq', 1, false);


--
-- Name: credit_logs_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.credit_logs_id_seq', 2, true);


--
-- Name: email_logs_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.email_logs_id_seq', 1, true);


--
-- Name: email_provider_configs_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.email_provider_configs_id_seq', 1, true);


--
-- Name: email_providers_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.email_providers_id_seq', 5, true);


--
-- Name: email_templates_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.email_templates_id_seq', 1, true);


--
-- Name: legal_acceptances_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.legal_acceptances_id_seq', 1, false);


--
-- Name: legal_documents_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.legal_documents_id_seq', 2, true);


--
-- Name: level_configs_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.level_configs_id_seq', 1, false);


--
-- Name: locations_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.locations_id_seq', 1, false);


--
-- Name: org_subscriptions_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.org_subscriptions_id_seq', 1, true);


--
-- Name: organization_locations_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.organization_locations_id_seq', 2, true);


--
-- Name: organization_members_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.organization_members_id_seq', 1, true);


--
-- Name: organizations_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.organizations_id_seq', 2, true);


--
-- Name: point_rules_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.point_rules_id_seq', 1, false);


--
-- Name: points_ledger_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.points_ledger_id_seq', 1, false);


--
-- Name: regional_settings_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.regional_settings_id_seq', 1, false);


--
-- Name: service_providers_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.service_providers_id_seq', 1, false);


--
-- Name: service_specialties_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.service_specialties_id_seq', 9, true);


--
-- Name: subscription_tiers_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.subscription_tiers_id_seq', 6, true);


--
-- Name: translations_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.translations_id_seq', 1, false);


--
-- Name: user_badges_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.user_badges_id_seq', 1, false);


--
-- Name: user_scores_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.user_scores_id_seq', 1, false);


--
-- Name: user_stats_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.user_stats_id_seq', 1, false);


--
-- Name: user_vehicles_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.user_vehicles_id_seq', 1, false);


--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.users_id_seq', 4, true);


--
-- Name: vehicle_brands_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.vehicle_brands_id_seq', 149, true);


--
-- Name: vehicle_categories_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.vehicle_categories_id_seq', 15, true);


--
-- Name: vehicle_events_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.vehicle_events_id_seq', 1, false);


--
-- Name: vehicle_models_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.vehicle_models_id_seq', 74, true);


--
-- Name: vehicle_ownership_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.vehicle_ownership_id_seq', 6, true);


--
-- Name: vehicle_variants_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.vehicle_variants_id_seq', 1, false);


--
-- Name: vehicles_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.vehicles_id_seq', 8, true);


--
-- Name: verification_tokens_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.verification_tokens_id_seq', 4, true);


--
-- Name: votes_id_seq; Type: SEQUENCE SET; Schema: data; Owner: kincses
--

SELECT pg_catalog.setval('data.votes_id_seq', 1, false);


--
-- Name: audit_logs audit_logs_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.audit_logs
    ADD CONSTRAINT audit_logs_pkey PRIMARY KEY (id);


--
-- Name: badges badges_name_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.badges
    ADD CONSTRAINT badges_name_key UNIQUE (name);


--
-- Name: badges badges_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.badges
    ADD CONSTRAINT badges_pkey PRIMARY KEY (id);


--
-- Name: companies companies_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.companies
    ADD CONSTRAINT companies_pkey PRIMARY KEY (id);


--
-- Name: company_members company_members_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.company_members
    ADD CONSTRAINT company_members_pkey PRIMARY KEY (id);


--
-- Name: competitions competitions_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.competitions
    ADD CONSTRAINT competitions_pkey PRIMARY KEY (id);


--
-- Name: credit_logs credit_logs_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.credit_logs
    ADD CONSTRAINT credit_logs_pkey PRIMARY KEY (id);


--
-- Name: email_logs email_logs_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_logs
    ADD CONSTRAINT email_logs_pkey PRIMARY KEY (id);


--
-- Name: email_provider_configs email_provider_configs_name_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_provider_configs
    ADD CONSTRAINT email_provider_configs_name_key UNIQUE (name);


--
-- Name: email_provider_configs email_provider_configs_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_provider_configs
    ADD CONSTRAINT email_provider_configs_pkey PRIMARY KEY (id);


--
-- Name: email_providers email_providers_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_providers
    ADD CONSTRAINT email_providers_pkey PRIMARY KEY (id);


--
-- Name: email_templates email_templates_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_templates
    ADD CONSTRAINT email_templates_pkey PRIMARY KEY (id);


--
-- Name: legal_acceptances legal_acceptances_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.legal_acceptances
    ADD CONSTRAINT legal_acceptances_pkey PRIMARY KEY (id);


--
-- Name: legal_documents legal_documents_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.legal_documents
    ADD CONSTRAINT legal_documents_pkey PRIMARY KEY (id);


--
-- Name: level_configs level_configs_level_number_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.level_configs
    ADD CONSTRAINT level_configs_level_number_key UNIQUE (level_number);


--
-- Name: level_configs level_configs_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.level_configs
    ADD CONSTRAINT level_configs_pkey PRIMARY KEY (id);


--
-- Name: locations locations_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.locations
    ADD CONSTRAINT locations_pkey PRIMARY KEY (id);


--
-- Name: org_subscriptions org_subscriptions_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.org_subscriptions
    ADD CONSTRAINT org_subscriptions_pkey PRIMARY KEY (id);


--
-- Name: organization_locations organization_locations_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_locations
    ADD CONSTRAINT organization_locations_pkey PRIMARY KEY (id);


--
-- Name: organization_members organization_members_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_members
    ADD CONSTRAINT organization_members_pkey PRIMARY KEY (id);


--
-- Name: organizations organizations_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organizations
    ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);


--
-- Name: point_rules point_rules_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.point_rules
    ADD CONSTRAINT point_rules_pkey PRIMARY KEY (id);


--
-- Name: points_ledger points_ledger_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.points_ledger
    ADD CONSTRAINT points_ledger_pkey PRIMARY KEY (id);


--
-- Name: regional_settings regional_settings_country_code_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.regional_settings
    ADD CONSTRAINT regional_settings_country_code_key UNIQUE (country_code);


--
-- Name: regional_settings regional_settings_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.regional_settings
    ADD CONSTRAINT regional_settings_pkey PRIMARY KEY (id);


--
-- Name: service_providers service_providers_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.service_providers
    ADD CONSTRAINT service_providers_pkey PRIMARY KEY (id);


--
-- Name: service_specialties service_specialties_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.service_specialties
    ADD CONSTRAINT service_specialties_pkey PRIMARY KEY (id);


--
-- Name: service_specialties service_specialties_slug_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.service_specialties
    ADD CONSTRAINT service_specialties_slug_key UNIQUE (slug);


--
-- Name: subscription_tiers subscription_tiers_name_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.subscription_tiers
    ADD CONSTRAINT subscription_tiers_name_key UNIQUE (name);


--
-- Name: subscription_tiers subscription_tiers_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.subscription_tiers
    ADD CONSTRAINT subscription_tiers_pkey PRIMARY KEY (id);


--
-- Name: system_settings system_settings_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.system_settings
    ADD CONSTRAINT system_settings_pkey PRIMARY KEY (key_name);


--
-- Name: translations translations_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.translations
    ADD CONSTRAINT translations_pkey PRIMARY KEY (id);


--
-- Name: vehicles uni_vin; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicles
    ADD CONSTRAINT uni_vin UNIQUE (vin);


--
-- Name: email_providers unique_provider_name; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.email_providers
    ADD CONSTRAINT unique_provider_name UNIQUE (name);


--
-- Name: organization_members unique_user_org; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_members
    ADD CONSTRAINT unique_user_org UNIQUE (organization_id, user_id);


--
-- Name: translations uq_translation_key_lang; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.translations
    ADD CONSTRAINT uq_translation_key_lang UNIQUE (key, lang_code);


--
-- Name: user_scores uq_user_competition_score; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_scores
    ADD CONSTRAINT uq_user_competition_score UNIQUE (user_id, competition_id);


--
-- Name: votes uq_user_provider_vote; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.votes
    ADD CONSTRAINT uq_user_provider_vote UNIQUE (user_id, provider_id);


--
-- Name: user_badges user_badges_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_badges
    ADD CONSTRAINT user_badges_pkey PRIMARY KEY (id);


--
-- Name: user_scores user_scores_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_scores
    ADD CONSTRAINT user_scores_pkey PRIMARY KEY (id);


--
-- Name: user_stats user_stats_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_stats
    ADD CONSTRAINT user_stats_pkey PRIMARY KEY (id);


--
-- Name: user_stats user_stats_user_id_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_stats
    ADD CONSTRAINT user_stats_user_id_key UNIQUE (user_id);


--
-- Name: user_vehicles user_vehicles_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_vehicles
    ADD CONSTRAINT user_vehicles_pkey PRIMARY KEY (id);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- Name: vehicle_brands vehicle_brands_cat_name_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_brands
    ADD CONSTRAINT vehicle_brands_cat_name_key UNIQUE (category_id, name);


--
-- Name: vehicle_brands vehicle_brands_name_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_brands
    ADD CONSTRAINT vehicle_brands_name_key UNIQUE (name);


--
-- Name: vehicle_brands vehicle_brands_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_brands
    ADD CONSTRAINT vehicle_brands_pkey PRIMARY KEY (id);


--
-- Name: vehicle_categories vehicle_categories_name_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_categories
    ADD CONSTRAINT vehicle_categories_name_key UNIQUE (name);


--
-- Name: vehicle_categories vehicle_categories_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_categories
    ADD CONSTRAINT vehicle_categories_pkey PRIMARY KEY (id);


--
-- Name: vehicle_events vehicle_events_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_events
    ADD CONSTRAINT vehicle_events_pkey PRIMARY KEY (id);


--
-- Name: vehicle_models vehicle_models_brand_name_key; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_models
    ADD CONSTRAINT vehicle_models_brand_name_key UNIQUE (brand_id, name);


--
-- Name: vehicle_models vehicle_models_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_models
    ADD CONSTRAINT vehicle_models_pkey PRIMARY KEY (id);


--
-- Name: vehicle_ownership vehicle_ownership_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_ownership
    ADD CONSTRAINT vehicle_ownership_pkey PRIMARY KEY (id);


--
-- Name: vehicle_variants vehicle_variants_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_variants
    ADD CONSTRAINT vehicle_variants_pkey PRIMARY KEY (id);


--
-- Name: vehicles vehicles_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicles
    ADD CONSTRAINT vehicles_pkey PRIMARY KEY (id);


--
-- Name: verification_tokens verification_tokens_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.verification_tokens
    ADD CONSTRAINT verification_tokens_pkey PRIMARY KEY (id);


--
-- Name: votes votes_pkey; Type: CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.votes
    ADD CONSTRAINT votes_pkey PRIMARY KEY (id);


--
-- Name: alembic_version alembic_version_pkc; Type: CONSTRAINT; Schema: public; Owner: kincses
--

ALTER TABLE ONLY public.alembic_version
    ADD CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num);


--
-- Name: idx_org_slug; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX idx_org_slug ON data.organizations USING btree (slug);


--
-- Name: idx_settings_lookup; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX idx_settings_lookup ON data.system_settings USING btree (key_name, COALESCE(region_code, ''::character varying), COALESCE(tier_id, 0), COALESCE(org_id, 0));


--
-- Name: idx_vb_slug; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX idx_vb_slug ON data.vehicle_brands USING btree (slug);


--
-- Name: idx_vc_slug; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX idx_vc_slug ON data.vehicle_categories USING btree (slug);


--
-- Name: idx_vm_slug; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX idx_vm_slug ON data.vehicle_models USING btree (brand_id, slug);


--
-- Name: ix_data_badges_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_badges_id ON data.badges USING btree (id);


--
-- Name: ix_data_email_logs_email; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_email_logs_email ON data.email_logs USING btree (email);


--
-- Name: ix_data_email_logs_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_email_logs_id ON data.email_logs USING btree (id);


--
-- Name: ix_data_email_provider_configs_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_email_provider_configs_id ON data.email_provider_configs USING btree (id);


--
-- Name: ix_data_email_templates_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_email_templates_id ON data.email_templates USING btree (id);


--
-- Name: ix_data_email_templates_type; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX ix_data_email_templates_type ON data.email_templates USING btree (type);


--
-- Name: ix_data_legal_acceptances_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_legal_acceptances_id ON data.legal_acceptances USING btree (id);


--
-- Name: ix_data_legal_documents_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_legal_documents_id ON data.legal_documents USING btree (id);


--
-- Name: ix_data_level_configs_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_level_configs_id ON data.level_configs USING btree (id);


--
-- Name: ix_data_organization_members_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_organization_members_id ON data.organization_members USING btree (id);


--
-- Name: ix_data_organizations_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_organizations_id ON data.organizations USING btree (id);


--
-- Name: ix_data_organizations_tax_number; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_organizations_tax_number ON data.organizations USING btree (tax_number);


--
-- Name: ix_data_point_rules_action_key; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX ix_data_point_rules_action_key ON data.point_rules USING btree (action_key);


--
-- Name: ix_data_point_rules_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_point_rules_id ON data.point_rules USING btree (id);


--
-- Name: ix_data_points_ledger_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_points_ledger_id ON data.points_ledger USING btree (id);


--
-- Name: ix_data_regional_settings_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_regional_settings_id ON data.regional_settings USING btree (id);


--
-- Name: ix_data_service_providers_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_service_providers_id ON data.service_providers USING btree (id);


--
-- Name: ix_data_system_settings_key; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_system_settings_key ON data.system_settings USING btree (key_name);


--
-- Name: ix_data_translations_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_translations_id ON data.translations USING btree (id);


--
-- Name: ix_data_translations_key; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_translations_key ON data.translations USING btree (key);


--
-- Name: ix_data_translations_lang_code; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_translations_lang_code ON data.translations USING btree (lang_code);


--
-- Name: ix_data_user_badges_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_user_badges_id ON data.user_badges USING btree (id);


--
-- Name: ix_data_user_stats_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_user_stats_id ON data.user_stats USING btree (id);


--
-- Name: ix_data_user_vehicles_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_user_vehicles_id ON data.user_vehicles USING btree (id);


--
-- Name: ix_data_user_vehicles_license_plate; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_user_vehicles_license_plate ON data.user_vehicles USING btree (license_plate);


--
-- Name: ix_data_user_vehicles_vin; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX ix_data_user_vehicles_vin ON data.user_vehicles USING btree (vin);


--
-- Name: ix_data_users_email; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX ix_data_users_email ON data.users USING btree (email);


--
-- Name: ix_data_users_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_users_id ON data.users USING btree (id);


--
-- Name: ix_data_vehicle_brands_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_vehicle_brands_id ON data.vehicle_brands USING btree (id);


--
-- Name: ix_data_vehicle_categories_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_vehicle_categories_id ON data.vehicle_categories USING btree (id);


--
-- Name: ix_data_vehicle_models_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_vehicle_models_id ON data.vehicle_models USING btree (id);


--
-- Name: ix_data_vehicle_ownership_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_vehicle_ownership_id ON data.vehicle_ownership USING btree (id);


--
-- Name: ix_data_vehicle_variants_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_vehicle_variants_id ON data.vehicle_variants USING btree (id);


--
-- Name: ix_data_verification_tokens_id; Type: INDEX; Schema: data; Owner: kincses
--

CREATE INDEX ix_data_verification_tokens_id ON data.verification_tokens USING btree (id);


--
-- Name: ix_data_verification_tokens_token; Type: INDEX; Schema: data; Owner: kincses
--

CREATE UNIQUE INDEX ix_data_verification_tokens_token ON data.verification_tokens USING btree (token);


--
-- Name: audit_logs audit_logs_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.audit_logs
    ADD CONSTRAINT audit_logs_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id);


--
-- Name: companies companies_owner_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.companies
    ADD CONSTRAINT companies_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES data.users(id);


--
-- Name: company_members company_members_company_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.company_members
    ADD CONSTRAINT company_members_company_id_fkey FOREIGN KEY (company_id) REFERENCES data.companies(id) ON DELETE CASCADE;


--
-- Name: company_members company_members_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.company_members
    ADD CONSTRAINT company_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id) ON DELETE CASCADE;


--
-- Name: credit_logs credit_logs_org_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.credit_logs
    ADD CONSTRAINT credit_logs_org_id_fkey FOREIGN KEY (org_id) REFERENCES data.organizations(id);


--
-- Name: legal_acceptances legal_acceptances_document_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.legal_acceptances
    ADD CONSTRAINT legal_acceptances_document_id_fkey FOREIGN KEY (document_id) REFERENCES data.legal_documents(id);


--
-- Name: legal_acceptances legal_acceptances_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.legal_acceptances
    ADD CONSTRAINT legal_acceptances_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id);


--
-- Name: org_subscriptions org_subscriptions_org_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.org_subscriptions
    ADD CONSTRAINT org_subscriptions_org_id_fkey FOREIGN KEY (org_id) REFERENCES data.organizations(id);


--
-- Name: org_subscriptions org_subscriptions_tier_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.org_subscriptions
    ADD CONSTRAINT org_subscriptions_tier_id_fkey FOREIGN KEY (tier_id) REFERENCES data.subscription_tiers(id);


--
-- Name: organization_locations organization_locations_organization_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_locations
    ADD CONSTRAINT organization_locations_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES data.organizations(id) ON DELETE CASCADE;


--
-- Name: organization_members organization_members_org_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_members
    ADD CONSTRAINT organization_members_org_id_fkey FOREIGN KEY (organization_id) REFERENCES data.organizations(id) ON DELETE CASCADE;


--
-- Name: organization_members organization_members_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organization_members
    ADD CONSTRAINT organization_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id) ON DELETE CASCADE;


--
-- Name: organizations organizations_owner_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.organizations
    ADD CONSTRAINT organizations_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES data.users(id);


--
-- Name: points_ledger points_ledger_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.points_ledger
    ADD CONSTRAINT points_ledger_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id);


--
-- Name: service_providers service_providers_added_by_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.service_providers
    ADD CONSTRAINT service_providers_added_by_user_id_fkey FOREIGN KEY (added_by_user_id) REFERENCES data.users(id);


--
-- Name: service_specialties service_specialties_parent_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.service_specialties
    ADD CONSTRAINT service_specialties_parent_id_fkey FOREIGN KEY (parent_id) REFERENCES data.service_specialties(id);


--
-- Name: user_badges user_badges_badge_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_badges
    ADD CONSTRAINT user_badges_badge_id_fkey FOREIGN KEY (badge_id) REFERENCES data.badges(id);


--
-- Name: user_badges user_badges_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_badges
    ADD CONSTRAINT user_badges_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id);


--
-- Name: user_scores user_scores_competition_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_scores
    ADD CONSTRAINT user_scores_competition_id_fkey FOREIGN KEY (competition_id) REFERENCES data.competitions(id);


--
-- Name: user_scores user_scores_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_scores
    ADD CONSTRAINT user_scores_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id);


--
-- Name: user_stats user_stats_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_stats
    ADD CONSTRAINT user_stats_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id);


--
-- Name: user_vehicles user_vehicles_current_org_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_vehicles
    ADD CONSTRAINT user_vehicles_current_org_id_fkey FOREIGN KEY (current_org_id) REFERENCES data.organizations(id);


--
-- Name: user_vehicles user_vehicles_variant_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.user_vehicles
    ADD CONSTRAINT user_vehicles_variant_id_fkey FOREIGN KEY (variant_id) REFERENCES data.vehicle_variants(id);


--
-- Name: vehicle_brands vehicle_brands_category_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_brands
    ADD CONSTRAINT vehicle_brands_category_id_fkey FOREIGN KEY (category_id) REFERENCES data.vehicle_categories(id);


--
-- Name: vehicle_events vehicle_events_service_provider_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_events
    ADD CONSTRAINT vehicle_events_service_provider_id_fkey FOREIGN KEY (service_provider_id) REFERENCES data.service_providers(id);


--
-- Name: vehicle_events vehicle_events_vehicle_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_events
    ADD CONSTRAINT vehicle_events_vehicle_id_fkey FOREIGN KEY (vehicle_id) REFERENCES data.user_vehicles(id) ON DELETE CASCADE;


--
-- Name: vehicle_models vehicle_models_brand_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_models
    ADD CONSTRAINT vehicle_models_brand_id_fkey FOREIGN KEY (brand_id) REFERENCES data.vehicle_brands(id);


--
-- Name: vehicle_models vehicle_models_category_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_models
    ADD CONSTRAINT vehicle_models_category_id_fkey FOREIGN KEY (category_id) REFERENCES data.vehicle_categories(id);


--
-- Name: vehicle_ownership vehicle_ownership_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_ownership
    ADD CONSTRAINT vehicle_ownership_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id) ON DELETE CASCADE;


--
-- Name: vehicle_ownership vehicle_ownership_vehicle_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_ownership
    ADD CONSTRAINT vehicle_ownership_vehicle_id_fkey FOREIGN KEY (vehicle_id) REFERENCES data.vehicles(id) ON DELETE CASCADE;


--
-- Name: vehicle_variants vehicle_variants_model_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicle_variants
    ADD CONSTRAINT vehicle_variants_model_id_fkey FOREIGN KEY (model_id) REFERENCES data.vehicle_models(id);


--
-- Name: vehicles vehicles_model_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.vehicles
    ADD CONSTRAINT vehicles_model_id_fkey FOREIGN KEY (model_id) REFERENCES data.vehicle_models(id);


--
-- Name: verification_tokens verification_tokens_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.verification_tokens
    ADD CONSTRAINT verification_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id) ON DELETE CASCADE;


--
-- Name: votes votes_provider_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.votes
    ADD CONSTRAINT votes_provider_id_fkey FOREIGN KEY (provider_id) REFERENCES data.service_providers(id);


--
-- Name: votes votes_user_id_fkey; Type: FK CONSTRAINT; Schema: data; Owner: kincses
--

ALTER TABLE ONLY data.votes
    ADD CONSTRAINT votes_user_id_fkey FOREIGN KEY (user_id) REFERENCES data.users(id);


--
-- PostgreSQL database dump complete
--

\unrestrict jRVVCTjjNeqN7io926QnQVJwr7IrvCK3DlzNPCoIfbivC5osmHT8eLuiehzRiDV

