 
 
 --
--- Name: fk_post_relations__post1; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY post_relations
-    ADD CONSTRAINT fk_post_relations__post1 FOREIGN KEY (post1) REFERENCES posts(id) ON DELETE CASCADE;
-
-
---
--- Name: fk_post_relations__post2; Type: FK CONSTRAINT; Schema: public; Owner: -
---
-
-ALTER TABLE ONLY post_relations
-    ADD CONSTRAINT fk_post_relations__post2 FOREIGN KEY (post2) REFERENCES posts(id) ON DELETE CASCADE;
-
-
---
 -- Name: fk_post_tag_histories__post; Type: FK CONSTRAINT; Schema: public; Owner: -
 --
 



--
-- Name: post_relations; Type: TABLE; Schema: public; Owner: -; Tablespace: 
--

CREATE TABLE post_relations (
    id integer NOT NULL,
    created_at timestamp without time zone NOT NULL,
    post1 integer NOT NULL,
    post2 integer NOT NULL,
    total_shared integer NOT NULL
);


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


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

ALTER TABLE ONLY histories ALTER COLUMN id SET DEFAULT nextval('histories_id_seq'::regclass);


