--
-- PostgreSQL database dump
--

-- Dumped from database version 17.1 (Debian 17.1-1.pgdg120+1)
-- Dumped by pg_dump version 17.1 (Debian 17.1-1.pgdg120+1)

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

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: advice_configurations; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.advice_configurations (
    id uuid NOT NULL,
    type character varying(255) DEFAULT 'DAY'::character varying NOT NULL,
    user_id uuid NOT NULL,
    repeat integer DEFAULT 1 NOT NULL,
    days character varying(255) DEFAULT 'a:0:{}'::character varying NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.advice_configurations OWNER TO perxo_api_user;

--
-- Name: advice_likes; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.advice_likes (
    id uuid NOT NULL,
    advice_id uuid NOT NULL,
    user_id uuid NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.advice_likes OWNER TO perxo_api_user;

--
-- Name: advice_schedules; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.advice_schedules (
    id uuid NOT NULL,
    user_id uuid,
    "time" time(0) without time zone NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.advice_schedules OWNER TO perxo_api_user;

--
-- Name: advices; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.advices (
    id uuid NOT NULL,
    advice text NOT NULL,
    category_id uuid,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.advices OWNER TO perxo_api_user;

--
-- Name: answers; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.answers (
    id uuid NOT NULL,
    answer character varying(255) NOT NULL,
    question_id uuid NOT NULL,
    is_correct boolean DEFAULT false NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    watermelon_id character varying(255),
    deleted_at timestamp(0) without time zone
);


ALTER TABLE public.answers OWNER TO perxo_api_user;

--
-- Name: categories; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.categories (
    id uuid NOT NULL,
    name character varying(255) NOT NULL,
    image character varying(255),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.categories OWNER TO perxo_api_user;

--
-- Name: category_user; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.category_user (
    category_id uuid NOT NULL,
    user_id uuid NOT NULL
);


ALTER TABLE public.category_user OWNER TO perxo_api_user;

--
-- Name: exponent_push_notification_interests; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.exponent_push_notification_interests (
    key character varying(255) NOT NULL,
    value character varying(255) NOT NULL
);


ALTER TABLE public.exponent_push_notification_interests OWNER TO perxo_api_user;

--
-- Name: migrations; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.migrations (
    id integer NOT NULL,
    migration character varying(255) NOT NULL,
    batch integer NOT NULL
);


ALTER TABLE public.migrations OWNER TO perxo_api_user;

--
-- Name: migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: perxo_api_user
--

CREATE SEQUENCE public.migrations_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.migrations_id_seq OWNER TO perxo_api_user;

--
-- Name: migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: perxo_api_user
--

ALTER SEQUENCE public.migrations_id_seq OWNED BY public.migrations.id;


--
-- Name: password_resets; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.password_resets (
    email character varying(255) NOT NULL,
    token character varying(255) NOT NULL,
    created_at timestamp(0) without time zone
);


ALTER TABLE public.password_resets OWNER TO perxo_api_user;

--
-- Name: personal_access_tokens; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.personal_access_tokens (
    id bigint NOT NULL,
    tokenable_type character varying(255) NOT NULL,
    tokenable_id character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    token character varying(64) NOT NULL,
    abilities text,
    last_used_at timestamp(0) without time zone,
    expires_at timestamp(0) without time zone,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.personal_access_tokens OWNER TO perxo_api_user;

--
-- Name: personal_access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: perxo_api_user
--

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


ALTER SEQUENCE public.personal_access_tokens_id_seq OWNER TO perxo_api_user;

--
-- Name: personal_access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: perxo_api_user
--

ALTER SEQUENCE public.personal_access_tokens_id_seq OWNED BY public.personal_access_tokens.id;


--
-- Name: questions; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.questions (
    id uuid NOT NULL,
    question character varying(255) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    watermelon_id character varying(255),
    deleted_at timestamp(0) without time zone,
    explanation text
);


ALTER TABLE public.questions OWNER TO perxo_api_user;

--
-- Name: users; Type: TABLE; Schema: public; Owner: perxo_api_user
--

CREATE TABLE public.users (
    id uuid NOT NULL,
    lastname character varying(255) NOT NULL,
    email character varying(255),
    phone character varying(255) NOT NULL,
    phone_code character varying(255) NOT NULL,
    email_verified_at timestamp(0) without time zone,
    password character varying(255) NOT NULL,
    passcode character varying(255),
    remember_token character varying(100),
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    firstname character varying(255),
    identified character varying(255)
);


ALTER TABLE public.users OWNER TO perxo_api_user;

--
-- Name: migrations id; Type: DEFAULT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.migrations ALTER COLUMN id SET DEFAULT nextval('public.migrations_id_seq'::regclass);


--
-- Name: personal_access_tokens id; Type: DEFAULT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.personal_access_tokens ALTER COLUMN id SET DEFAULT nextval('public.personal_access_tokens_id_seq'::regclass);


--
-- Data for Name: advice_configurations; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.advice_configurations (id, type, user_id, repeat, days, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: advice_likes; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.advice_likes (id, advice_id, user_id, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: advice_schedules; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.advice_schedules (id, user_id, "time", created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: advices; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.advices (id, advice, category_id, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: answers; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.answers (id, answer, question_id, is_correct, created_at, updated_at, watermelon_id, deleted_at) FROM stdin;
\.


--
-- Data for Name: categories; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.categories (id, name, image, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: category_user; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.category_user (category_id, user_id) FROM stdin;
\.


--
-- Data for Name: exponent_push_notification_interests; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.exponent_push_notification_interests (key, value) FROM stdin;
\.


--
-- Data for Name: migrations; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.migrations (id, migration, batch) FROM stdin;
1	2014_10_12_000000_create_users_table	1
2	2014_10_12_100000_create_password_resets_table	1
3	2019_12_14_000001_create_personal_access_tokens_table	1
4	2024_01_26_153348_add_firstname_lastname_in_users_table	1
5	2024_02_29_000000_create_questions_table	1
6	2024_02_29_100000_create_answers_table	1
7	2024_03_01_123012_add_watermelon_id_to_all_tables_table	1
8	2024_03_01_211334_add_deleted_at_to_questions_and_answers_table	1
9	2024_03_06_151718_add_explanation_to_questions_table	1
10	2024_03_18_000000_create_categories_table	1
11	2024_03_18_100000_create_advices_table	1
12	2024_03_19_100000_create_advice_configurations_table	1
13	2024_03_19_161408_create_category_user_table	1
14	2024_03_20_152131_create_exponent_push_notification_interests_table	1
15	2024_03_20_161408_create_advice_likes_table	1
16	2024_03_20_162947_create_advice_schedules_table	1
17	2024_09_01_020608_add_identified_to_users_table	1
\.


--
-- Data for Name: password_resets; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.password_resets (email, token, created_at) FROM stdin;
\.


--
-- Data for Name: personal_access_tokens; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.personal_access_tokens (id, tokenable_type, tokenable_id, name, token, abilities, last_used_at, expires_at, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: questions; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.questions (id, question, created_at, updated_at, watermelon_id, deleted_at, explanation) FROM stdin;
\.


--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: perxo_api_user
--

COPY public.users (id, lastname, email, phone, phone_code, email_verified_at, password, passcode, remember_token, created_at, updated_at, firstname, identified) FROM stdin;
\.


--
-- Name: migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: perxo_api_user
--

SELECT pg_catalog.setval('public.migrations_id_seq', 17, true);


--
-- Name: personal_access_tokens_id_seq; Type: SEQUENCE SET; Schema: public; Owner: perxo_api_user
--

SELECT pg_catalog.setval('public.personal_access_tokens_id_seq', 1, false);


--
-- Name: advice_configurations advice_configurations_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advice_configurations
    ADD CONSTRAINT advice_configurations_pkey PRIMARY KEY (id);


--
-- Name: advice_likes advice_likes_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advice_likes
    ADD CONSTRAINT advice_likes_pkey PRIMARY KEY (id);


--
-- Name: advice_schedules advice_schedules_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advice_schedules
    ADD CONSTRAINT advice_schedules_pkey PRIMARY KEY (id);


--
-- Name: advices advices_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advices
    ADD CONSTRAINT advices_pkey PRIMARY KEY (id);


--
-- Name: answers answers_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.answers
    ADD CONSTRAINT answers_pkey PRIMARY KEY (id);


--
-- Name: answers answers_watermelon_id_unique; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.answers
    ADD CONSTRAINT answers_watermelon_id_unique UNIQUE (watermelon_id);


--
-- Name: categories categories_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.categories
    ADD CONSTRAINT categories_pkey PRIMARY KEY (id);


--
-- Name: exponent_push_notification_interests exponent_push_notification_interests_key_value_unique; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.exponent_push_notification_interests
    ADD CONSTRAINT exponent_push_notification_interests_key_value_unique UNIQUE (key, value);


--
-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.migrations
    ADD CONSTRAINT migrations_pkey PRIMARY KEY (id);


--
-- Name: password_resets password_resets_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.password_resets
    ADD CONSTRAINT password_resets_pkey PRIMARY KEY (email);


--
-- Name: personal_access_tokens personal_access_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.personal_access_tokens
    ADD CONSTRAINT personal_access_tokens_pkey PRIMARY KEY (id);


--
-- Name: personal_access_tokens personal_access_tokens_token_unique; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.personal_access_tokens
    ADD CONSTRAINT personal_access_tokens_token_unique UNIQUE (token);


--
-- Name: questions questions_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.questions
    ADD CONSTRAINT questions_pkey PRIMARY KEY (id);


--
-- Name: questions questions_watermelon_id_unique; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.questions
    ADD CONSTRAINT questions_watermelon_id_unique UNIQUE (watermelon_id);


--
-- Name: users users_email_unique; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_email_unique UNIQUE (email);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: perxo_api_user
--

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


--
-- Name: exponent_push_notification_interests_key_index; Type: INDEX; Schema: public; Owner: perxo_api_user
--

CREATE INDEX exponent_push_notification_interests_key_index ON public.exponent_push_notification_interests USING btree (key);


--
-- Name: advice_configurations advice_configurations_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advice_configurations
    ADD CONSTRAINT advice_configurations_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: advice_likes advice_likes_advice_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advice_likes
    ADD CONSTRAINT advice_likes_advice_id_foreign FOREIGN KEY (advice_id) REFERENCES public.advices(id);


--
-- Name: advice_likes advice_likes_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advice_likes
    ADD CONSTRAINT advice_likes_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: advice_schedules advice_schedules_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advice_schedules
    ADD CONSTRAINT advice_schedules_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- Name: advices advices_category_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.advices
    ADD CONSTRAINT advices_category_id_foreign FOREIGN KEY (category_id) REFERENCES public.categories(id);


--
-- Name: answers answers_question_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.answers
    ADD CONSTRAINT answers_question_id_foreign FOREIGN KEY (question_id) REFERENCES public.questions(id);


--
-- Name: category_user category_user_category_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.category_user
    ADD CONSTRAINT category_user_category_id_foreign FOREIGN KEY (category_id) REFERENCES public.categories(id);


--
-- Name: category_user category_user_user_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: perxo_api_user
--

ALTER TABLE ONLY public.category_user
    ADD CONSTRAINT category_user_user_id_foreign FOREIGN KEY (user_id) REFERENCES public.users(id);


--
-- PostgreSQL database dump complete
--

