--
-- PostgreSQL database dump
--

\restrict 4YOUlr9n0NTc89H7ICKbtYmhm2YiHmjYRhjtXmZ9eiBSyYsasVrSg7jUM4Lojbf

-- Dumped from database version 13.23
-- Dumped by pg_dump version 13.23

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: public; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA public;


ALTER SCHEMA public OWNER TO postgres;

--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'standard public schema';


--
-- Name: app_generate_uuid(); Type: FUNCTION; Schema: public; Owner: myczroxg
--

CREATE FUNCTION public.app_generate_uuid() RETURNS uuid
    LANGUAGE plpgsql
    AS $$
DECLARE
    generated UUID;
BEGIN
    IF to_regprocedure('gen_random_uuid()') IS NOT NULL THEN
        EXECUTE 'SELECT gen_random_uuid()' INTO generated;
    ELSIF to_regprocedure('uuid_generate_v4()') IS NOT NULL THEN
        EXECUTE 'SELECT uuid_generate_v4()' INTO generated;
    ELSE
        generated := md5(random()::text || clock_timestamp()::text || pg_backend_pid()::text)::uuid;
    END IF;

    RETURN generated;
END;
$$;


ALTER FUNCTION public.app_generate_uuid() OWNER TO myczroxg;

--
-- Name: delete_expired_stories(); Type: FUNCTION; Schema: public; Owner: myczroxg
--

CREATE FUNCTION public.delete_expired_stories() RETURNS void
    LANGUAGE plpgsql
    AS $$
BEGIN
    DELETE FROM stories WHERE expires_at < CURRENT_TIMESTAMP;
END;
$$;


ALTER FUNCTION public.delete_expired_stories() OWNER TO myczroxg;

--
-- Name: update_updated_at_column(); Type: FUNCTION; Schema: public; Owner: myczroxg
--

CREATE FUNCTION public.update_updated_at_column() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
    NEW.updated_at = CURRENT_TIMESTAMP;
    RETURN NEW;
END;
$$;


ALTER FUNCTION public.update_updated_at_column() OWNER TO myczroxg;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: admin_actions; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.admin_actions (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    admin_id uuid NOT NULL,
    action_type character varying(50) NOT NULL,
    target_user_id uuid,
    target_post_id uuid,
    target_comment_id uuid,
    report_id uuid,
    reason text,
    details jsonb,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT admin_actions_action_type_check CHECK (((action_type)::text = ANY ((ARRAY['ban_user'::character varying, 'unban_user'::character varying, 'block_post'::character varying, 'unblock_post'::character varying, 'delete_post'::character varying, 'delete_comment'::character varying, 'promote_user'::character varying, 'demote_user'::character varying, 'resolve_report'::character varying, 'dismiss_report'::character varying])::text[])))
);


ALTER TABLE public.admin_actions OWNER TO myczroxg;

--
-- Name: blocked_users; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.blocked_users (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    blocker_id uuid NOT NULL,
    blocked_id uuid NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.blocked_users OWNER TO myczroxg;

--
-- Name: comment_likes; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.comment_likes (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    comment_id uuid NOT NULL,
    user_id uuid NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.comment_likes OWNER TO myczroxg;

--
-- Name: comments; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.comments (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    post_id uuid NOT NULL,
    user_id uuid NOT NULL,
    parent_comment_id uuid,
    content text NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.comments OWNER TO myczroxg;

--
-- Name: follow_requests; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.follow_requests (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    requester_id uuid NOT NULL,
    requested_id uuid 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 follow_requests_status_check CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'accepted'::character varying, 'rejected'::character varying])::text[])))
);


ALTER TABLE public.follow_requests OWNER TO myczroxg;

--
-- Name: follows; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.follows (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    follower_id uuid NOT NULL,
    following_id uuid NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT follows_check CHECK ((follower_id <> following_id))
);


ALTER TABLE public.follows OWNER TO myczroxg;

--
-- Name: hashtags; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.hashtags (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    name character varying(100) NOT NULL,
    post_count integer DEFAULT 0,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.hashtags OWNER TO myczroxg;

--
-- Name: likes; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.likes (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    post_id uuid NOT NULL,
    user_id uuid NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.likes OWNER TO myczroxg;

--
-- Name: mentions; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.mentions (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    post_id uuid,
    comment_id uuid,
    user_id uuid NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.mentions OWNER TO myczroxg;

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

CREATE TABLE public.messages (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    sender_id uuid NOT NULL,
    receiver_id uuid NOT NULL,
    content text NOT NULL,
    media_url character varying(500),
    is_read boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.messages OWNER TO myczroxg;

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

CREATE TABLE public.notifications (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    user_id uuid NOT NULL,
    sender_id uuid,
    type character varying(50) NOT NULL,
    post_id uuid,
    comment_id uuid,
    message_id uuid,
    content text,
    is_read boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT notifications_type_check CHECK (((type)::text = ANY ((ARRAY['like'::character varying, 'comment'::character varying, 'follow'::character varying, 'follow_request'::character varying, 'mention'::character varying, 'message'::character varying])::text[])))
);


ALTER TABLE public.notifications OWNER TO myczroxg;

--
-- Name: post_hashtags; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.post_hashtags (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    post_id uuid NOT NULL,
    hashtag_id uuid NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.post_hashtags OWNER TO myczroxg;

--
-- Name: post_media; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.post_media (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    post_id uuid NOT NULL,
    media_url character varying(500) NOT NULL,
    media_type character varying(20) NOT NULL,
    media_order integer NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT post_media_media_type_check CHECK (((media_type)::text = ANY ((ARRAY['image'::character varying, 'video'::character varying])::text[])))
);


ALTER TABLE public.post_media OWNER TO myczroxg;

--
-- Name: posts; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.posts (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    user_id uuid NOT NULL,
    caption text,
    location character varying(255),
    is_archived boolean DEFAULT false,
    is_blocked boolean DEFAULT false,
    block_reason text,
    blocked_by uuid,
    blocked_at timestamp without time zone,
    comments_disabled boolean DEFAULT false,
    likes_hidden boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.posts OWNER TO myczroxg;

--
-- Name: reports; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.reports (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    reporter_id uuid NOT NULL,
    reported_post_id uuid,
    reported_user_id uuid,
    reported_comment_id uuid,
    report_type character varying(50) NOT NULL,
    description text,
    status character varying(20) DEFAULT 'pending'::character varying,
    reviewed_by uuid,
    reviewed_at timestamp without time zone,
    resolution_notes text,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT reports_report_type_check CHECK (((report_type)::text = ANY ((ARRAY['spam'::character varying, 'harassment'::character varying, 'hate_speech'::character varying, 'violence'::character varying, 'nudity'::character varying, 'false_information'::character varying, 'other'::character varying])::text[]))),
    CONSTRAINT reports_status_check CHECK (((status)::text = ANY ((ARRAY['pending'::character varying, 'reviewing'::character varying, 'resolved'::character varying, 'dismissed'::character varying])::text[])))
);


ALTER TABLE public.reports OWNER TO myczroxg;

--
-- Name: saved_posts; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.saved_posts (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    user_id uuid NOT NULL,
    post_id uuid NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.saved_posts OWNER TO myczroxg;

--
-- Name: stories; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.stories (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    user_id uuid NOT NULL,
    media_url character varying(500) NOT NULL,
    media_type character varying(20) NOT NULL,
    caption text,
    expires_at timestamp without time zone NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT stories_media_type_check CHECK (((media_type)::text = ANY ((ARRAY['image'::character varying, 'video'::character varying])::text[])))
);


ALTER TABLE public.stories OWNER TO myczroxg;

--
-- Name: story_views; Type: TABLE; Schema: public; Owner: myczroxg
--

CREATE TABLE public.story_views (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    story_id uuid NOT NULL,
    user_id uuid NOT NULL,
    viewed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.story_views OWNER TO myczroxg;

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

CREATE TABLE public.users (
    id uuid DEFAULT public.app_generate_uuid() NOT NULL,
    username character varying(50) NOT NULL,
    email character varying(255) NOT NULL,
    password_hash character varying(255) NOT NULL,
    full_name character varying(100) NOT NULL,
    bio text,
    profile_picture character varying(500),
    website character varying(255),
    role character varying(20) DEFAULT 'user'::character varying,
    is_verified boolean DEFAULT false,
    is_private boolean DEFAULT false,
    is_banned boolean DEFAULT false,
    banned_until timestamp without time zone,
    ban_reason text,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT users_role_check CHECK (((role)::text = ANY ((ARRAY['user'::character varying, 'admin'::character varying, 'super_admin'::character varying])::text[])))
);


ALTER TABLE public.users OWNER TO myczroxg;

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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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

INSERT INTO public.users VALUES ('46f1d2cb-7b40-4d55-a7b1-eb017b084187', 'admin', 'admin@yourdomain.com', '$2a$10$rOvHfz5g5SZUPj4U6MxZHOXQkL3wD3qk9xj6gxKvCUc2YJWYBq7Vy', 'Administrator', NULL, NULL, NULL, 'super_admin', false, false, false, NULL, NULL, '2026-07-10 15:41:46.11109', '2026-07-10 15:41:46.11109');
INSERT INTO public.users VALUES ('c0ecea26-a790-427c-825c-f31429cc4e3f', 'djo', 'djonah@gmail.com', '$2b$10$hzenySH0QAS.s9HycPtq1OEPaNaUTTh0w21IG4PbFFanFCarPC8lq', 'David', NULL, NULL, NULL, 'user', false, false, false, NULL, NULL, '2026-07-10 18:43:50.064324', '2026-07-10 18:43:50.064324');


--
-- Name: admin_actions admin_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.admin_actions
    ADD CONSTRAINT admin_actions_pkey PRIMARY KEY (id);


--
-- Name: blocked_users blocked_users_blocker_id_blocked_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.blocked_users
    ADD CONSTRAINT blocked_users_blocker_id_blocked_id_key UNIQUE (blocker_id, blocked_id);


--
-- Name: blocked_users blocked_users_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.blocked_users
    ADD CONSTRAINT blocked_users_pkey PRIMARY KEY (id);


--
-- Name: comment_likes comment_likes_comment_id_user_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.comment_likes
    ADD CONSTRAINT comment_likes_comment_id_user_id_key UNIQUE (comment_id, user_id);


--
-- Name: comment_likes comment_likes_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.comment_likes
    ADD CONSTRAINT comment_likes_pkey PRIMARY KEY (id);


--
-- Name: comments comments_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_pkey PRIMARY KEY (id);


--
-- Name: follow_requests follow_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follow_requests
    ADD CONSTRAINT follow_requests_pkey PRIMARY KEY (id);


--
-- Name: follow_requests follow_requests_requester_id_requested_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follow_requests
    ADD CONSTRAINT follow_requests_requester_id_requested_id_key UNIQUE (requester_id, requested_id);


--
-- Name: follows follows_follower_id_following_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follows
    ADD CONSTRAINT follows_follower_id_following_id_key UNIQUE (follower_id, following_id);


--
-- Name: follows follows_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follows
    ADD CONSTRAINT follows_pkey PRIMARY KEY (id);


--
-- Name: hashtags hashtags_name_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.hashtags
    ADD CONSTRAINT hashtags_name_key UNIQUE (name);


--
-- Name: hashtags hashtags_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.hashtags
    ADD CONSTRAINT hashtags_pkey PRIMARY KEY (id);


--
-- Name: likes likes_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.likes
    ADD CONSTRAINT likes_pkey PRIMARY KEY (id);


--
-- Name: likes likes_post_id_user_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.likes
    ADD CONSTRAINT likes_post_id_user_id_key UNIQUE (post_id, user_id);


--
-- Name: mentions mentions_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.mentions
    ADD CONSTRAINT mentions_pkey PRIMARY KEY (id);


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

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


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

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


--
-- Name: post_hashtags post_hashtags_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.post_hashtags
    ADD CONSTRAINT post_hashtags_pkey PRIMARY KEY (id);


--
-- Name: post_hashtags post_hashtags_post_id_hashtag_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.post_hashtags
    ADD CONSTRAINT post_hashtags_post_id_hashtag_id_key UNIQUE (post_id, hashtag_id);


--
-- Name: post_media post_media_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.post_media
    ADD CONSTRAINT post_media_pkey PRIMARY KEY (id);


--
-- Name: posts posts_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.posts
    ADD CONSTRAINT posts_pkey PRIMARY KEY (id);


--
-- Name: reports reports_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.reports
    ADD CONSTRAINT reports_pkey PRIMARY KEY (id);


--
-- Name: saved_posts saved_posts_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.saved_posts
    ADD CONSTRAINT saved_posts_pkey PRIMARY KEY (id);


--
-- Name: saved_posts saved_posts_user_id_post_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.saved_posts
    ADD CONSTRAINT saved_posts_user_id_post_id_key UNIQUE (user_id, post_id);


--
-- Name: stories stories_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.stories
    ADD CONSTRAINT stories_pkey PRIMARY KEY (id);


--
-- Name: story_views story_views_pkey; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.story_views
    ADD CONSTRAINT story_views_pkey PRIMARY KEY (id);


--
-- Name: story_views story_views_story_id_user_id_key; Type: CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.story_views
    ADD CONSTRAINT story_views_story_id_user_id_key UNIQUE (story_id, user_id);


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

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


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

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


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

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


--
-- Name: idx_admin_actions_admin_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_admin_actions_admin_id ON public.admin_actions USING btree (admin_id);


--
-- Name: idx_admin_actions_created_at; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_admin_actions_created_at ON public.admin_actions USING btree (created_at DESC);


--
-- Name: idx_comments_post_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_comments_post_id ON public.comments USING btree (post_id);


--
-- Name: idx_comments_user_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_comments_user_id ON public.comments USING btree (user_id);


--
-- Name: idx_follows_follower_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_follows_follower_id ON public.follows USING btree (follower_id);


--
-- Name: idx_follows_following_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_follows_following_id ON public.follows USING btree (following_id);


--
-- Name: idx_hashtags_name; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_hashtags_name ON public.hashtags USING btree (name);


--
-- Name: idx_likes_post_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_likes_post_id ON public.likes USING btree (post_id);


--
-- Name: idx_likes_user_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_likes_user_id ON public.likes USING btree (user_id);


--
-- Name: idx_messages_receiver_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_messages_receiver_id ON public.messages USING btree (receiver_id);


--
-- Name: idx_messages_sender_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_messages_sender_id ON public.messages USING btree (sender_id);


--
-- Name: idx_notifications_created_at; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_notifications_created_at ON public.notifications USING btree (created_at DESC);


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

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


--
-- Name: idx_post_hashtags_hashtag_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_post_hashtags_hashtag_id ON public.post_hashtags USING btree (hashtag_id);


--
-- Name: idx_post_hashtags_post_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_post_hashtags_post_id ON public.post_hashtags USING btree (post_id);


--
-- Name: idx_post_media_post_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_post_media_post_id ON public.post_media USING btree (post_id);


--
-- Name: idx_posts_created_at; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_posts_created_at ON public.posts USING btree (created_at DESC);


--
-- Name: idx_posts_is_blocked; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_posts_is_blocked ON public.posts USING btree (is_blocked);


--
-- Name: idx_posts_user_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_posts_user_id ON public.posts USING btree (user_id);


--
-- Name: idx_reports_reported_post_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_reports_reported_post_id ON public.reports USING btree (reported_post_id);


--
-- Name: idx_reports_reported_user_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_reports_reported_user_id ON public.reports USING btree (reported_user_id);


--
-- Name: idx_reports_reporter_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_reports_reporter_id ON public.reports USING btree (reporter_id);


--
-- Name: idx_reports_status; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_reports_status ON public.reports USING btree (status);


--
-- Name: idx_stories_expires_at; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_stories_expires_at ON public.stories USING btree (expires_at);


--
-- Name: idx_stories_user_id; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_stories_user_id ON public.stories USING btree (user_id);


--
-- Name: idx_users_is_banned; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_users_is_banned ON public.users USING btree (is_banned);


--
-- Name: idx_users_role; Type: INDEX; Schema: public; Owner: myczroxg
--

CREATE INDEX idx_users_role ON public.users USING btree (role);


--
-- Name: comments update_comments_updated_at; Type: TRIGGER; Schema: public; Owner: myczroxg
--

CREATE TRIGGER update_comments_updated_at BEFORE UPDATE ON public.comments FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column();


--
-- Name: follow_requests update_follow_requests_updated_at; Type: TRIGGER; Schema: public; Owner: myczroxg
--

CREATE TRIGGER update_follow_requests_updated_at BEFORE UPDATE ON public.follow_requests FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column();


--
-- Name: messages update_messages_updated_at; Type: TRIGGER; Schema: public; Owner: myczroxg
--

CREATE TRIGGER update_messages_updated_at BEFORE UPDATE ON public.messages FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column();


--
-- Name: posts update_posts_updated_at; Type: TRIGGER; Schema: public; Owner: myczroxg
--

CREATE TRIGGER update_posts_updated_at BEFORE UPDATE ON public.posts FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column();


--
-- Name: reports update_reports_updated_at; Type: TRIGGER; Schema: public; Owner: myczroxg
--

CREATE TRIGGER update_reports_updated_at BEFORE UPDATE ON public.reports FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column();


--
-- Name: users update_users_updated_at; Type: TRIGGER; Schema: public; Owner: myczroxg
--

CREATE TRIGGER update_users_updated_at BEFORE UPDATE ON public.users FOR EACH ROW EXECUTE FUNCTION public.update_updated_at_column();


--
-- Name: admin_actions admin_actions_admin_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.admin_actions
    ADD CONSTRAINT admin_actions_admin_id_fkey FOREIGN KEY (admin_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: admin_actions admin_actions_report_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.admin_actions
    ADD CONSTRAINT admin_actions_report_id_fkey FOREIGN KEY (report_id) REFERENCES public.reports(id) ON DELETE SET NULL;


--
-- Name: admin_actions admin_actions_target_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.admin_actions
    ADD CONSTRAINT admin_actions_target_comment_id_fkey FOREIGN KEY (target_comment_id) REFERENCES public.comments(id) ON DELETE SET NULL;


--
-- Name: admin_actions admin_actions_target_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.admin_actions
    ADD CONSTRAINT admin_actions_target_post_id_fkey FOREIGN KEY (target_post_id) REFERENCES public.posts(id) ON DELETE SET NULL;


--
-- Name: admin_actions admin_actions_target_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.admin_actions
    ADD CONSTRAINT admin_actions_target_user_id_fkey FOREIGN KEY (target_user_id) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: blocked_users blocked_users_blocked_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.blocked_users
    ADD CONSTRAINT blocked_users_blocked_id_fkey FOREIGN KEY (blocked_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: blocked_users blocked_users_blocker_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.blocked_users
    ADD CONSTRAINT blocked_users_blocker_id_fkey FOREIGN KEY (blocker_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: comment_likes comment_likes_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.comment_likes
    ADD CONSTRAINT comment_likes_comment_id_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id) ON DELETE CASCADE;


--
-- Name: comment_likes comment_likes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: comments comments_parent_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: comments comments_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.comments
    ADD CONSTRAINT comments_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: comments comments_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: follow_requests follow_requests_requested_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follow_requests
    ADD CONSTRAINT follow_requests_requested_id_fkey FOREIGN KEY (requested_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: follow_requests follow_requests_requester_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follow_requests
    ADD CONSTRAINT follow_requests_requester_id_fkey FOREIGN KEY (requester_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: follows follows_follower_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follows
    ADD CONSTRAINT follows_follower_id_fkey FOREIGN KEY (follower_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: follows follows_following_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.follows
    ADD CONSTRAINT follows_following_id_fkey FOREIGN KEY (following_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: likes likes_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.likes
    ADD CONSTRAINT likes_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: likes likes_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: mentions mentions_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.mentions
    ADD CONSTRAINT mentions_comment_id_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id) ON DELETE CASCADE;


--
-- Name: mentions mentions_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.mentions
    ADD CONSTRAINT mentions_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: mentions mentions_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: messages messages_receiver_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


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

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_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_comment_id_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id) ON DELETE CASCADE;


--
-- Name: notifications notifications_message_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_message_id_fkey FOREIGN KEY (message_id) REFERENCES public.messages(id) ON DELETE CASCADE;


--
-- Name: notifications notifications_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: notifications notifications_sender_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.notifications
    ADD CONSTRAINT notifications_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: myczroxg
--

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


--
-- Name: post_hashtags post_hashtags_hashtag_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.post_hashtags
    ADD CONSTRAINT post_hashtags_hashtag_id_fkey FOREIGN KEY (hashtag_id) REFERENCES public.hashtags(id) ON DELETE CASCADE;


--
-- Name: post_hashtags post_hashtags_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.post_hashtags
    ADD CONSTRAINT post_hashtags_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: post_media post_media_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.post_media
    ADD CONSTRAINT post_media_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: posts posts_blocked_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.posts
    ADD CONSTRAINT posts_blocked_by_fkey FOREIGN KEY (blocked_by) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: posts posts_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: reports reports_reported_comment_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.reports
    ADD CONSTRAINT reports_reported_comment_id_fkey FOREIGN KEY (reported_comment_id) REFERENCES public.comments(id) ON DELETE CASCADE;


--
-- Name: reports reports_reported_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.reports
    ADD CONSTRAINT reports_reported_post_id_fkey FOREIGN KEY (reported_post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: reports reports_reported_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.reports
    ADD CONSTRAINT reports_reported_user_id_fkey FOREIGN KEY (reported_user_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: reports reports_reporter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.reports
    ADD CONSTRAINT reports_reporter_id_fkey FOREIGN KEY (reporter_id) REFERENCES public.users(id) ON DELETE CASCADE;


--
-- Name: reports reports_reviewed_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.reports
    ADD CONSTRAINT reports_reviewed_by_fkey FOREIGN KEY (reviewed_by) REFERENCES public.users(id) ON DELETE SET NULL;


--
-- Name: saved_posts saved_posts_post_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.saved_posts
    ADD CONSTRAINT saved_posts_post_id_fkey FOREIGN KEY (post_id) REFERENCES public.posts(id) ON DELETE CASCADE;


--
-- Name: saved_posts saved_posts_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: stories stories_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: story_views story_views_story_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

ALTER TABLE ONLY public.story_views
    ADD CONSTRAINT story_views_story_id_fkey FOREIGN KEY (story_id) REFERENCES public.stories(id) ON DELETE CASCADE;


--
-- Name: story_views story_views_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: myczroxg
--

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


--
-- Name: TABLE admin_actions; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.admin_actions TO myczroxg_instavlog;


--
-- Name: TABLE blocked_users; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.blocked_users TO myczroxg_instavlog;


--
-- Name: TABLE comment_likes; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.comment_likes TO myczroxg_instavlog;


--
-- Name: TABLE comments; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.comments TO myczroxg_instavlog;


--
-- Name: TABLE follow_requests; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.follow_requests TO myczroxg_instavlog;


--
-- Name: TABLE follows; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.follows TO myczroxg_instavlog;


--
-- Name: TABLE hashtags; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.hashtags TO myczroxg_instavlog;


--
-- Name: TABLE likes; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.likes TO myczroxg_instavlog;


--
-- Name: TABLE mentions; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.mentions TO myczroxg_instavlog;


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

GRANT ALL ON TABLE public.messages TO myczroxg_instavlog;


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

GRANT ALL ON TABLE public.notifications TO myczroxg_instavlog;


--
-- Name: TABLE post_hashtags; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.post_hashtags TO myczroxg_instavlog;


--
-- Name: TABLE post_media; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.post_media TO myczroxg_instavlog;


--
-- Name: TABLE posts; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.posts TO myczroxg_instavlog;


--
-- Name: TABLE reports; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.reports TO myczroxg_instavlog;


--
-- Name: TABLE saved_posts; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.saved_posts TO myczroxg_instavlog;


--
-- Name: TABLE stories; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.stories TO myczroxg_instavlog;


--
-- Name: TABLE story_views; Type: ACL; Schema: public; Owner: myczroxg
--

GRANT ALL ON TABLE public.story_views TO myczroxg_instavlog;


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

GRANT ALL ON TABLE public.users TO myczroxg_instavlog;


--
-- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: myczroxg
--

ALTER DEFAULT PRIVILEGES FOR ROLE myczroxg IN SCHEMA public GRANT ALL ON SEQUENCES  TO myczroxg;


--
-- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: myczroxg
--

ALTER DEFAULT PRIVILEGES FOR ROLE myczroxg IN SCHEMA public GRANT ALL ON FUNCTIONS  TO myczroxg;


--
-- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: myczroxg
--

ALTER DEFAULT PRIVILEGES FOR ROLE myczroxg IN SCHEMA public GRANT ALL ON TABLES  TO myczroxg;


--
-- PostgreSQL database dump complete
--

\unrestrict 4YOUlr9n0NTc89H7ICKbtYmhm2YiHmjYRhjtXmZ9eiBSyYsasVrSg7jUM4Lojbf
