--
-- PostgreSQL database dump
--

\restrict pekc8reoLFUFmGL30ln9alNcy9GjDOHAgeHZy2F1W01BdHE5hNbPrMrQjdKd7e8

-- Dumped from database version 18.1
-- Dumped by pg_dump version 18.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: conversation_members; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.conversation_members (
    id integer NOT NULL,
    conversation_id integer NOT NULL,
    user_id integer NOT NULL,
    joined_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    last_read_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: conversation_members_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: conversation_members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.conversation_members_id_seq OWNED BY public.conversation_members.id;


--
-- Name: conversations; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.conversations (
    id integer NOT NULL,
    name character varying(100),
    is_group boolean DEFAULT false,
    created_by integer,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: conversations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: conversations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.conversations_id_seq OWNED BY public.conversations.id;


--
-- Name: friend_requests; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.friend_requests (
    id integer NOT NULL,
    sender_id integer NOT NULL,
    receiver_id integer NOT NULL,
    status character varying(20) DEFAULT 'pending'::character varying,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT friend_requests_check CHECK ((sender_id <> receiver_id)),
    CONSTRAINT friend_requests_status_check CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'accepted'::character varying, 'rejected'::character varying])::text[])))
);


--
-- Name: friend_requests_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: friend_requests_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.friend_requests_id_seq OWNED BY public.friend_requests.id;


--
-- Name: friendships; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.friendships (
    id integer NOT NULL,
    user_id integer NOT NULL,
    friend_id integer NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT friendships_check CHECK ((user_id <> friend_id))
);


--
-- Name: friendships_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: friendships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.friendships_id_seq OWNED BY public.friendships.id;


--
-- Name: grocery_list_shares; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.grocery_list_shares (
    id integer NOT NULL,
    list_id integer NOT NULL,
    shared_with_user_id integer NOT NULL,
    can_edit boolean DEFAULT false,
    shared_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: grocery_list_shares_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: grocery_list_shares_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.grocery_list_shares_id_seq OWNED BY public.grocery_list_shares.id;


--
-- Name: grocery_lists; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.grocery_lists (
    id integer NOT NULL,
    name text NOT NULL,
    items text[] DEFAULT '{}'::text[] NOT NULL,
    owner_id integer NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    is_pinned boolean DEFAULT false
);


--
-- Name: grocery_lists_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: grocery_lists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.grocery_lists_id_seq OWNED BY public.grocery_lists.id;


--
-- Name: group_members; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.group_members (
    id integer NOT NULL,
    group_id integer NOT NULL,
    user_id integer NOT NULL,
    role character varying(20) DEFAULT 'member'::character varying,
    joined_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT group_members_role_check CHECK (((role)::text = ANY ((ARRAY['admin'::character varying, 'moderator'::character varying, 'member'::character varying])::text[])))
);


--
-- Name: group_members_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: group_members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.group_members_id_seq OWNED BY public.group_members.id;


--
-- Name: groups; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.groups (
    id integer NOT NULL,
    name character varying(100) NOT NULL,
    description text,
    created_by integer NOT NULL,
    is_private boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.groups_id_seq OWNED BY public.groups.id;


--
-- Name: messages; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.messages (
    id integer NOT NULL,
    conversation_id integer NOT NULL,
    sender_id integer NOT NULL,
    content text NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    edited_at timestamp without time zone,
    is_deleted boolean DEFAULT false
);


--
-- Name: messages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: messages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.messages_id_seq OWNED BY public.messages.id;


--
-- Name: notifications; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.notifications (
    id integer NOT NULL,
    user_id integer NOT NULL,
    type text NOT NULL,
    message text NOT NULL,
    related_id integer,
    is_read boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: notifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: notifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.notifications_id_seq OWNED BY public.notifications.id;


--
-- Name: recipe_comments; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.recipe_comments (
    id integer NOT NULL,
    recipe_id integer NOT NULL,
    user_id integer NOT NULL,
    content text NOT NULL,
    parent_comment_id integer,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    is_deleted boolean DEFAULT false
);


--
-- Name: recipe_comments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: recipe_comments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.recipe_comments_id_seq OWNED BY public.recipe_comments.id;


--
-- Name: recipe_ratings; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.recipe_ratings (
    id integer NOT NULL,
    recipe_id integer NOT NULL,
    user_id integer NOT NULL,
    rating integer NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT recipe_ratings_rating_check CHECK (((rating >= 1) AND (rating <= 5)))
);


--
-- Name: recipe_ratings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: recipe_ratings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.recipe_ratings_id_seq OWNED BY public.recipe_ratings.id;


--
-- Name: recipe_shares; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.recipe_shares (
    id integer NOT NULL,
    recipe_id integer NOT NULL,
    group_id integer NOT NULL,
    shared_by integer NOT NULL,
    shared_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


--
-- Name: recipe_shares_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: recipe_shares_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.recipe_shares_id_seq OWNED BY public.recipe_shares.id;


--
-- Name: recipes; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.recipes (
    id integer NOT NULL,
    name text NOT NULL,
    meal_type text NOT NULL,
    time_minutes integer NOT NULL,
    tags jsonb DEFAULT '[]'::jsonb NOT NULL,
    ingredients jsonb DEFAULT '[]'::jsonb NOT NULL,
    steps jsonb DEFAULT '[]'::jsonb NOT NULL,
    image text,
    made_by text,
    user_id integer,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    visibility character varying(20) DEFAULT 'public'::character varying,
    CONSTRAINT recipes_visibility_check CHECK (((visibility)::text = ANY ((ARRAY['public'::character varying, 'private'::character varying, 'friends'::character varying, 'groups'::character varying])::text[])))
);


--
-- Name: recipes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: recipes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE public.recipes_id_seq OWNED BY public.recipes.id;


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

CREATE TABLE public.users (
    id integer NOT NULL,
    username text NOT NULL,
    email text NOT NULL,
    password_hash text NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    first_name text,
    last_name text,
    display_name text NOT NULL,
    is_admin boolean DEFAULT false,
    auth_provider character varying(50) DEFAULT 'local'::character varying NOT NULL
);


--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

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


--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

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


--
-- Name: conversation_members id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: conversations id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: friend_requests id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: friendships id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: grocery_list_shares id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: grocery_lists id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: group_members id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: groups id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: messages id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: notifications id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: recipe_comments id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: recipe_ratings id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: recipe_shares id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: recipes id; Type: DEFAULT; Schema: public; Owner: -
--

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


--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
--

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


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

COPY public.conversation_members (id, conversation_id, user_id, joined_at, last_read_at) FROM stdin;
1	1	8	2025-12-19 07:09:10.822011	2025-12-19 10:34:08.52574
2	1	10	2025-12-19 07:09:10.822011	2025-12-19 13:01:57.058671
\.


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

COPY public.conversations (id, name, is_group, created_by, created_at, updated_at) FROM stdin;
1	\N	f	10	2025-12-19 07:09:10.822011	2025-12-19 07:09:20.333729
\.


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

COPY public.friend_requests (id, sender_id, receiver_id, status, created_at, updated_at) FROM stdin;
1	8	10	accepted	2025-12-19 06:14:58.92162	2025-12-19 07:03:29.174737
\.


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

COPY public.friendships (id, user_id, friend_id, created_at) FROM stdin;
\.


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

COPY public.grocery_list_shares (id, list_id, shared_with_user_id, can_edit, shared_at) FROM stdin;
8	12	11	f	2025-12-21 02:26:09.504339
\.


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

COPY public.grocery_lists (id, name, items, owner_id, created_at, updated_at, is_pinned) FROM stdin;
6	test	{}	7	2025-12-14 01:18:17.25618	2025-12-14 01:18:17.25618	f
7	test	{}	10	2025-12-19 05:02:39.41555	2025-12-19 05:03:05.742052	t
10	test	{}	8	2025-12-19 05:58:52.331687	2025-12-19 05:58:52.331687	f
12	test	{}	10	2025-12-19 15:19:49.351716	2025-12-19 15:19:49.351716	f
11	test	{חלב,ביצים}	10	2025-12-19 15:19:19.012322	2025-12-20 23:24:29.577085	f
8	test2	{חלב,ביצים,קמח}	10	2025-12-19 05:29:56.642726	2025-12-20 23:24:48.774257	t
\.


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

COPY public.group_members (id, group_id, user_id, role, joined_at) FROM stdin;
1	1	8	admin	2025-12-19 11:34:03.59015
\.


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

COPY public.groups (id, name, description, created_by, is_private, created_at, updated_at) FROM stdin;
1	מתכונים משפחתיים	מתכוני משפחה	8	t	2025-12-19 11:34:03.59015	2025-12-19 11:34:03.59015
\.


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

COPY public.messages (id, conversation_id, sender_id, content, created_at, edited_at, is_deleted) FROM stdin;
1	1	10	היי	2025-12-19 07:09:20.333729	\N	f
\.


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

COPY public.notifications (id, user_id, type, message, related_id, is_read, created_at) FROM stdin;
2	7	grocery_share	רשימת קניות 'בדיקה' שותפה איתך על ידי דביר חורב	2	t	2025-12-11 05:16:16.208681
4	7	grocery_share	רשימת קניות 'test list' שותפה איתך על ידי דביר חורב	4	t	2025-12-11 21:59:09.881568
5	7	grocery_share	רשימת קניות 'test list' שותפה איתך על ידי דביר חורב	4	t	2025-12-11 22:00:19.770974
6	8	friend_accepted	Dvir Horev קיבל את בקשת החברות שלך	10	t	2025-12-19 07:03:29.360703
7	10	friend_request	admin שלח לך בקשת חברות	1	t	2025-12-19 11:54:33.687267
11	11	grocery_share	רשימת קניות 'test2' שותפה איתך על ידי Dvir Horev	8	t	2025-12-21 02:44:09.977181
12	11	grocery_share	רשימת קניות 'test2' שותפה איתך על ידי Dvir Horev	8	t	2025-12-21 02:44:28.459037
13	11	grocery_share	רשימת קניות 'test2' שותפה איתך על ידי Dvir Horev	8	t	2025-12-21 02:45:57.765331
\.


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

COPY public.recipe_comments (id, recipe_id, user_id, content, parent_comment_id, created_at, updated_at, is_deleted) FROM stdin;
\.


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

COPY public.recipe_ratings (id, recipe_id, user_id, rating, created_at, updated_at) FROM stdin;
1	12	8	5	2025-12-19 06:06:35.577569	2025-12-19 06:06:53.680222
\.


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

COPY public.recipe_shares (id, recipe_id, group_id, shared_by, shared_at) FROM stdin;
\.


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

COPY public.recipes (id, name, meal_type, time_minutes, tags, ingredients, steps, image, made_by, user_id, created_at, visibility) FROM stdin;
14	כעי	lunch	15	["עכי", "כגעי"]	["םןחגכע", "ךלחעגכי"]	["חעי", "ףךלחע"]	data:image/jpeg;base64,[encoded data, 52908 characters]	דביר	10	2025-12-20 22:46:16.417283	public
15	ghfnjm	lunch	15	["hnm", "hgfj"]	["ghvn", "fghj", "fgh"]	["dfgh", "dfvbg", "dfg"]	data:image/jpeg;base64,[encoded data, 260048 characters]	shilo	10	2025-12-20 22:51:32.141196	public
16	עכיעכי	lunch	15	["כעימ", "כעי", "עכי"]	["עכיכעי", "עכי", "כעי"]	["עכיכע", "עכיעכ", "כעיכע"]	data:image/jpeg;base64,[encoded data, 123708 characters]	דביר	10	2025-12-20 22:57:36.450363	public
17	חלגדכה	lunch	15	["עיחמ", "יעכח"]	["עכיחמ", "עיחמחל"]	["יעכחמ", "יעמח"]	\N	דביר	10	2025-12-20 23:00:14.757088	public
18	כענינכע	lunch	15	["ךגכה", "ףך]פלך"]	["מלח ופלפל"]	["חלמגכה", "גכעגכ", "גכה"]	\N	דביר	10	2025-12-20 23:02:30.679996	public
10	שקשוקה ביתית	breakfast	25	["מהיר", "בריא", "צמחוני"]	["4 ביצים", "2 עגבניות גדולות", "1 בצל", "2 שיני שום", "פלפל אדום", "כוסברה", "כמון", "מלח ופלפל"]	["לחתוך את הבצל והשום דק", "לחמם שמן בסיר ולהזהיב את הבצל", "להוסיף עגבניות קצוצות ותבלינים", "לבשל 15 דקות עד שמתעבה", "לפתוח גומות ולשבור ביצים", "לכסות ולבשל 5 דקות", "לקשט בכוסברה ולהגיש עם לחם"]	data:image/jpeg;base64,[encoded data, 123708 characters]	מנהל	8	2025-12-19 05:22:08.863183	public
11	פסטה ברוטב שמנת ופטריות	lunch	30	["מהיר", "מנת", "ערב", "איטלקי"]	["500 גרם פסטה", "300 גרם פטריות", "200 מ\\"ל שמנת מתוקה", "2 שיני שום", "פרמזן", "חמאה", "פטרוזיליה", "מלח ופלפל"]	["להרתיח מים ולבשל את הפסטה לפי ההוראות", "לחתוך פטריות ושום דק", "לחמם חמאה ולטגן פטריות 5 דקות", "להוסיף שום ולטגן דקה", "להוסיף שמנת ופרמזן ולערבב", "להוסיף את הפסטה המסוננת לרוטב", "לערבב היטב ולהגיש עם פרמזן"]	data:image/jpeg;base64,[encoded data, 242252 characters]	מנהל	8	2025-12-19 05:22:08.863183	public
12	עוגת שוקולד פאדג׳	snack	45	["קינוח", "שוקולד", "מתוק"]	["200 גרם שוקולד מריר", "150 גרם חמאה", "3 ביצים", "1 כוס סוכר", "3/4 כוס קמח", "אבקת אפייה", "וניל"]	["לחמם תנור ל-180 מעלות", "להמיס שוקולד וחמאה במיקרו", "להקציף ביצים עם סוכר", "להוסיף שוקולד מומס ולערבב", "להוסיף קמח ואבקת אפייה", "לשפוך לתבנית משומנת", "לאפות 30 דקות", "להוציא ולהגיש עם גלידה"]	data:image/jpeg;base64,[encoded data, 260048 characters]	מנהל	8	2025-12-19 05:22:08.863183	public
\.


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

COPY public.users (id, username, email, password_hash, created_at, first_name, last_name, display_name, is_admin, auth_provider) FROM stdin;
7	amit	amithorev9@gmail.com	$2b$12$CWx9lJ/nFQx91jxmJxagU.yC.8mDw/lOjAwo0OVsK/Qqj7uC07Yha	2025-12-08 09:06:12.859767	עמית	חורב	Amit	f	local
10	dvirlabs	dvirlabs@gmail.com	$2b$12$tdZneZln60mNHn1jLGtS8ueNJB718BTbzFR3h4DKAZsMCtiM/b38q	2025-12-19 03:57:27.06225	Dvir	Horev	Dvir Horev	f	google
11	dvir	dvir8360@gmail.com	$2b$12$yHHBBbhMRIpOgb7G3MT5be0Bt2RGL4gLH9tyi.zsJ/bEwrcE2nD6S	2025-12-19 04:07:56.637917	דביר	חורב	דביר חורב	f	local
8	admin	admin@myrecipes.local	$2b$12$ko.e4lAAQlpDHM9lsSQRJ.TLv5Ggt3XQsTIzatcKN.48wX/A3jqya	2025-12-08 09:22:42.950784	Admin	User	admin	t	local
\.


--
-- Name: conversation_members_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.conversation_members_id_seq', 2, true);


--
-- Name: conversations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.conversations_id_seq', 1, true);


--
-- Name: friend_requests_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.friend_requests_id_seq', 3, true);


--
-- Name: friendships_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.friendships_id_seq', 2, true);


--
-- Name: grocery_list_shares_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.grocery_list_shares_id_seq', 13, true);


--
-- Name: grocery_lists_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.grocery_lists_id_seq', 12, true);


--
-- Name: group_members_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.group_members_id_seq', 1, true);


--
-- Name: groups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.groups_id_seq', 1, true);


--
-- Name: messages_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.messages_id_seq', 1, true);


--
-- Name: notifications_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.notifications_id_seq', 13, true);


--
-- Name: recipe_comments_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

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


--
-- Name: recipe_ratings_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.recipe_ratings_id_seq', 6, true);


--
-- Name: recipe_shares_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

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


--
-- Name: recipes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.recipes_id_seq', 18, true);


--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--

SELECT pg_catalog.setval('public.users_id_seq', 11, true);


--
-- Name: conversation_members conversation_members_conversation_id_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.conversation_members
    ADD CONSTRAINT conversation_members_conversation_id_user_id_key UNIQUE (conversation_id, user_id);


--
-- Name: conversation_members conversation_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.conversation_members
    ADD CONSTRAINT conversation_members_pkey PRIMARY KEY (id);


--
-- Name: conversations conversations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.conversations
    ADD CONSTRAINT conversations_pkey PRIMARY KEY (id);


--
-- Name: friend_requests friend_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friend_requests
    ADD CONSTRAINT friend_requests_pkey PRIMARY KEY (id);


--
-- Name: friend_requests friend_requests_sender_id_receiver_id_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friend_requests
    ADD CONSTRAINT friend_requests_sender_id_receiver_id_key UNIQUE (sender_id, receiver_id);


--
-- Name: friendships friendships_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friendships
    ADD CONSTRAINT friendships_pkey PRIMARY KEY (id);


--
-- Name: friendships friendships_user_id_friend_id_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friendships
    ADD CONSTRAINT friendships_user_id_friend_id_key UNIQUE (user_id, friend_id);


--
-- Name: grocery_list_shares grocery_list_shares_list_id_shared_with_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.grocery_list_shares
    ADD CONSTRAINT grocery_list_shares_list_id_shared_with_user_id_key UNIQUE (list_id, shared_with_user_id);


--
-- Name: grocery_list_shares grocery_list_shares_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.grocery_list_shares
    ADD CONSTRAINT grocery_list_shares_pkey PRIMARY KEY (id);


--
-- Name: grocery_lists grocery_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.grocery_lists
    ADD CONSTRAINT grocery_lists_pkey PRIMARY KEY (id);


--
-- Name: group_members group_members_group_id_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.group_members
    ADD CONSTRAINT group_members_group_id_user_id_key UNIQUE (group_id, user_id);


--
-- Name: group_members group_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.group_members
    ADD CONSTRAINT group_members_pkey PRIMARY KEY (id);


--
-- Name: groups groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.groups
    ADD CONSTRAINT groups_pkey PRIMARY KEY (id);


--
-- Name: messages messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.messages
    ADD CONSTRAINT messages_pkey PRIMARY KEY (id);


--
-- Name: notifications notifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_pkey PRIMARY KEY (id);


--
-- Name: recipe_comments recipe_comments_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_comments
    ADD CONSTRAINT recipe_comments_pkey PRIMARY KEY (id);


--
-- Name: recipe_ratings recipe_ratings_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_ratings
    ADD CONSTRAINT recipe_ratings_pkey PRIMARY KEY (id);


--
-- Name: recipe_ratings recipe_ratings_recipe_id_user_id_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_ratings
    ADD CONSTRAINT recipe_ratings_recipe_id_user_id_key UNIQUE (recipe_id, user_id);


--
-- Name: recipe_shares recipe_shares_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_shares
    ADD CONSTRAINT recipe_shares_pkey PRIMARY KEY (id);


--
-- Name: recipe_shares recipe_shares_recipe_id_group_id_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_shares
    ADD CONSTRAINT recipe_shares_recipe_id_group_id_key UNIQUE (recipe_id, group_id);


--
-- Name: recipes recipes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipes
    ADD CONSTRAINT recipes_pkey PRIMARY KEY (id);


--
-- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: -
--

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


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

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


--
-- Name: users users_username_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.users
    ADD CONSTRAINT users_username_key UNIQUE (username);


--
-- Name: idx_conversation_members_user; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_conversation_members_user ON public.conversation_members USING btree (user_id);


--
-- Name: idx_friend_requests_receiver; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_friend_requests_receiver ON public.friend_requests USING btree (receiver_id);


--
-- Name: idx_friend_requests_sender; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_friend_requests_sender ON public.friend_requests USING btree (sender_id);


--
-- Name: idx_friendships_friend_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_friendships_friend_id ON public.friendships USING btree (friend_id);


--
-- Name: idx_friendships_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_friendships_user_id ON public.friendships USING btree (user_id);


--
-- Name: idx_grocery_list_shares_list_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_grocery_list_shares_list_id ON public.grocery_list_shares USING btree (list_id);


--
-- Name: idx_grocery_list_shares_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_grocery_list_shares_user_id ON public.grocery_list_shares USING btree (shared_with_user_id);


--
-- Name: idx_grocery_lists_owner_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_grocery_lists_owner_id ON public.grocery_lists USING btree (owner_id);


--
-- Name: idx_group_members_group; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_group_members_group ON public.group_members USING btree (group_id);


--
-- Name: idx_group_members_user; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_group_members_user ON public.group_members USING btree (user_id);


--
-- Name: idx_messages_conversation; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_messages_conversation ON public.messages USING btree (conversation_id);


--
-- Name: idx_messages_created_at; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_messages_created_at ON public.messages USING btree (created_at);


--
-- Name: idx_notifications_is_read; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_notifications_is_read ON public.notifications USING btree (is_read);


--
-- Name: idx_notifications_user_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_notifications_user_id ON public.notifications USING btree (user_id);


--
-- Name: idx_recipe_comments_recipe; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipe_comments_recipe ON public.recipe_comments USING btree (recipe_id);


--
-- Name: idx_recipe_ratings_recipe; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipe_ratings_recipe ON public.recipe_ratings USING btree (recipe_id);


--
-- Name: idx_recipe_shares_group; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipe_shares_group ON public.recipe_shares USING btree (group_id);


--
-- Name: idx_recipes_ingredients_jsonb; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipes_ingredients_jsonb ON public.recipes USING gin (ingredients);


--
-- Name: idx_recipes_made_by; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipes_made_by ON public.recipes USING btree (made_by);


--
-- Name: idx_recipes_meal_type; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipes_meal_type ON public.recipes USING btree (meal_type);


--
-- Name: idx_recipes_tags_jsonb; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipes_tags_jsonb ON public.recipes USING gin (tags);


--
-- Name: idx_recipes_time_minutes; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipes_time_minutes ON public.recipes USING btree (time_minutes);


--
-- Name: idx_recipes_visibility; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_recipes_visibility ON public.recipes USING btree (visibility);


--
-- Name: idx_users_auth_provider; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_users_auth_provider ON public.users USING btree (auth_provider);


--
-- Name: idx_users_email; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_users_email ON public.users USING btree (email);


--
-- Name: idx_users_username; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_users_username ON public.users USING btree (username);


--
-- Name: conversation_members conversation_members_conversation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.conversation_members
    ADD CONSTRAINT conversation_members_conversation_id_fkey FOREIGN KEY (conversation_id) REFERENCES public.conversations(id) ON DELETE CASCADE;


--
-- Name: conversation_members conversation_members_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.conversation_members
    ADD CONSTRAINT conversation_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: conversations conversations_created_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.conversations
    ADD CONSTRAINT conversations_created_by_fkey FOREIGN KEY (created_by) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: friend_requests friend_requests_receiver_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friend_requests
    ADD CONSTRAINT friend_requests_receiver_id_fkey FOREIGN KEY (receiver_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: friend_requests friend_requests_sender_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friend_requests
    ADD CONSTRAINT friend_requests_sender_id_fkey FOREIGN KEY (sender_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: friendships friendships_friend_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friendships
    ADD CONSTRAINT friendships_friend_id_fkey FOREIGN KEY (friend_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: friendships friendships_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.friendships
    ADD CONSTRAINT friendships_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: grocery_list_shares grocery_list_shares_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.grocery_list_shares
    ADD CONSTRAINT grocery_list_shares_list_id_fkey FOREIGN KEY (list_id) REFERENCES public.grocery_lists(id) ON DELETE CASCADE;


--
-- Name: grocery_list_shares grocery_list_shares_shared_with_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.grocery_list_shares
    ADD CONSTRAINT grocery_list_shares_shared_with_user_id_fkey FOREIGN KEY (shared_with_user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: grocery_lists grocery_lists_owner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.grocery_lists
    ADD CONSTRAINT grocery_lists_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: group_members group_members_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.group_members
    ADD CONSTRAINT group_members_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.groups(id) ON DELETE CASCADE;


--
-- Name: group_members group_members_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.group_members
    ADD CONSTRAINT group_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: groups groups_created_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.groups
    ADD CONSTRAINT groups_created_by_fkey FOREIGN KEY (created_by) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: messages messages_conversation_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.messages
    ADD CONSTRAINT messages_conversation_id_fkey FOREIGN KEY (conversation_id) REFERENCES public.conversations(id) ON DELETE CASCADE;


--
-- Name: messages messages_sender_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.messages
    ADD CONSTRAINT messages_sender_id_fkey FOREIGN KEY (sender_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: notifications notifications_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: recipe_comments recipe_comments_parent_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_comments
    ADD CONSTRAINT recipe_comments_parent_comment_id_fkey FOREIGN KEY (parent_comment_id) REFERENCES public.recipe_comments(id) ON DELETE CASCADE;


--
-- Name: recipe_comments recipe_comments_recipe_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_comments
    ADD CONSTRAINT recipe_comments_recipe_id_fkey FOREIGN KEY (recipe_id) REFERENCES public.recipes(id) ON DELETE CASCADE;


--
-- Name: recipe_comments recipe_comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_comments
    ADD CONSTRAINT recipe_comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: recipe_ratings recipe_ratings_recipe_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_ratings
    ADD CONSTRAINT recipe_ratings_recipe_id_fkey FOREIGN KEY (recipe_id) REFERENCES public.recipes(id) ON DELETE CASCADE;


--
-- Name: recipe_ratings recipe_ratings_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_ratings
    ADD CONSTRAINT recipe_ratings_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: recipe_shares recipe_shares_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_shares
    ADD CONSTRAINT recipe_shares_group_id_fkey FOREIGN KEY (group_id) REFERENCES public.groups(id) ON DELETE CASCADE;


--
-- Name: recipe_shares recipe_shares_recipe_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_shares
    ADD CONSTRAINT recipe_shares_recipe_id_fkey FOREIGN KEY (recipe_id) REFERENCES public.recipes(id) ON DELETE CASCADE;


--
-- Name: recipe_shares recipe_shares_shared_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipe_shares
    ADD CONSTRAINT recipe_shares_shared_by_fkey FOREIGN KEY (shared_by) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: recipes recipes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.recipes
    ADD CONSTRAINT recipes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- PostgreSQL database dump complete
--

\unrestrict pekc8reoLFUFmGL30ln9alNcy9GjDOHAgeHZy2F1W01BdHE5hNbPrMrQjdKd7e8

