Просмотр файла katrinka.ru/db.sql

Размер файла: 20.13Kb


--
-- TOC entry 11 (OID 17172)
-- Name: user_status; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE user_status (
    id serial NOT NULL,
    name_eng text,
    name_rus text,
    min integer,
    max integer
);


--
-- TOC entry 12 (OID 17172)
-- Name: user_status; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE user_status FROM PUBLIC;


--
-- TOC entry 13 (OID 17180)
-- Name: users; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE users (
    id serial NOT NULL,
    login text,
    passwd text,
    email text,
    name text,
    bday date,
    "operator" text,
    posts integer DEFAULT 0,
    moder integer DEFAULT 0,
    fr text,
    phonenum text,
    web text,
    info text,
    dreg date,
    "access" integer DEFAULT 0,
    cust_status text,
    phonemod text,
    lastact integer DEFAULT 0,
    wap text,
    icq integer DEFAULT 0,
    invisible integer DEFAULT 0,
    job text,
    refresh integer DEFAULT 300,
    ppp integer DEFAULT 9,
    translit integer DEFAULT 0,
    avatar text,
    lastagent text,
    temp_ban integer DEFAULT 0,
    kmoder integer DEFAULT 0,
    lasttag integer DEFAULT 0,
    lastforum integer DEFAULT 0,
    fppp integer DEFAULT 3,
    ftpp integer DEFAULT 10,
    showemail integer DEFAULT 1,
    showpics integer DEFAULT 1,
    lastpwdrem integer DEFAULT 0,
    fnewtop boolean DEFAULT true,
    fposts integer DEFAULT 0
);


--
-- TOC entry 14 (OID 17180)
-- Name: users; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE users FROM PUBLIC;


--
-- TOC entry 15 (OID 17200)
-- Name: downloads; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE downloads (
    id serial NOT NULL,
    uid integer,
    midi integer,
    "time" integer,
    agent text,
    ip inet
);


--
-- TOC entry 16 (OID 17200)
-- Name: downloads; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE downloads FROM PUBLIC;


--
-- TOC entry 42 (OID 17200)
-- Name: downloads_id_seq; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE downloads_id_seq FROM PUBLIC;


--
-- TOC entry 17 (OID 17208)
-- Name: chat_rooms; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE chat_rooms (
    id serial NOT NULL,
    name_eng text,
    name_rus text,
    flag integer DEFAULT 0
);


--
-- TOC entry 18 (OID 17208)
-- Name: chat_rooms; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE chat_rooms FROM PUBLIC;
GRANT ALL ON TABLE chat_rooms TO andrey;


--
-- TOC entry 44 (OID 17208)
-- Name: chat_rooms_id_seq; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE chat_rooms_id_seq FROM PUBLIC;


--
-- TOC entry 19 (OID 17217)
-- Name: chat; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE chat (
    id serial NOT NULL,
    room integer,
    fr_u integer,
    to_u integer,
    message text,
    "time" integer,
    host inet,
    agent text,
    flag integer DEFAULT 0
);


--
-- TOC entry 20 (OID 17217)
-- Name: chat; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE chat FROM PUBLIC;


--
-- TOC entry 46 (OID 17217)
-- Name: chat_id_seq; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE chat_id_seq FROM PUBLIC;


--
-- TOC entry 21 (OID 17226)
-- Name: users_ignore; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE users_ignore (
    id serial NOT NULL,
    uid integer,
    who integer,
    if integer DEFAULT 0
);


--
-- TOC entry 22 (OID 17226)
-- Name: users_ignore; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE users_ignore FROM PUBLIC;


--
-- TOC entry 48 (OID 17226)
-- Name: users_ignore_id_seq; Type: ACL; Schema: public; Owner: katrinka
--

REVOKE ALL ON TABLE users_ignore_id_seq FROM PUBLIC;


--
-- TOC entry 23 (OID 17230)
-- Name: site_var; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE site_var (
    id integer NOT NULL,
    v_num integer DEFAULT 0,
    v_txt text
);


--
-- TOC entry 24 (OID 17238)
-- Name: mfolders; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE mfolders (
    id serial NOT NULL,
    name_eng text,
    name_rus text
);


--
-- TOC entry 25 (OID 17246)
-- Name: messages; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE messages (
    id serial NOT NULL,
    folder integer DEFAULT 2,
    "time" integer,
    fr_u integer,
    to_u integer,
    host inet,
    agent text,
    subject text,
    message text,
    flag integer DEFAULT 0
);


--
-- TOC entry 26 (OID 17256)
-- Name: chat_tet; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE chat_tet (
    id serial NOT NULL,
    fr_u integer,
    to_u integer,
    message text,
    "time" integer,
    host inet,
    agent text
);


--
-- TOC entry 27 (OID 17264)
-- Name: photos; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE photos (
    id serial NOT NULL,
    uid integer,
    "path" text,
    dlcount integer DEFAULT 0
);


--
-- TOC entry 28 (OID 17273)
-- Name: user_agent; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE user_agent (
    id serial NOT NULL,
    uid integer,
    agent text
);


--
-- TOC entry 29 (OID 17281)
-- Name: chat_tags; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE chat_tags (
    id serial NOT NULL,
    tag text,
    txt text
);


--
-- TOC entry 30 (OID 256939)
-- Name: forums; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE forums (
    id serial NOT NULL,
    name text,
    flag integer DEFAULT 0,
    nthemes integer DEFAULT 0,
    nrepl integer DEFAULT 0,
    note text
);


--
-- TOC entry 31 (OID 257206)
-- Name: themes; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE themes (
    id serial NOT NULL,
    forum integer,
    uid integer,
    name text,
    rdnum integer DEFAULT 0,
    lastrepl integer DEFAULT 0,
    "time" integer DEFAULT 0,
    rplnum integer DEFAULT 0,
    closed integer DEFAULT 0,
    sticker boolean DEFAULT false
);


--
-- TOC entry 32 (OID 257372)
-- Name: threads; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE threads (
    id serial NOT NULL,
    theme integer,
    message text,
    uid integer,
    agent text,
    host inet,
    "time" integer
);


--
-- TOC entry 33 (OID 258049)
-- Name: seen_by; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE seen_by (
    id serial NOT NULL,
    theme integer,
    uid integer
);


--
-- TOC entry 34 (OID 10388826)
-- Name: fseen_by; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE fseen_by (
    id serial NOT NULL,
    forum integer,
    uid integer
);


--
-- TOC entry 35 (OID 11081707)
-- Name: forum_moder; Type: TABLE; Schema: public; Owner: katrinka
--

CREATE TABLE forum_moder (
    id serial NOT NULL,
    forum integer,
    uid integer
);

--
-- TOC entry 83 (OID 42957)
-- Name: users_ignore_uid_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX users_ignore_uid_idx ON users_ignore USING btree (uid);


--
-- TOC entry 76 (OID 42958)
-- Name: downloads_uid_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX downloads_uid_idx ON downloads USING btree (uid);


--
-- TOC entry 70 (OID 42959)
-- Name: users_email_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX users_email_idx ON users USING btree (email);


--
-- TOC entry 67 (OID 42960)
-- Name: midi_path_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE UNIQUE INDEX midi_path_idx ON midi USING btree ("path");


--
-- TOC entry 80 (OID 42961)
-- Name: chat_room_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX chat_room_idx ON chat USING btree (room);


--
-- TOC entry 81 (OID 42962)
-- Name: chat_time_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX chat_time_idx ON chat USING btree ("time");


--
-- TOC entry 78 (OID 42963)
-- Name: chat_fr_u_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX chat_fr_u_idx ON chat USING btree (fr_u);


--
-- TOC entry 64 (OID 42964)
-- Name: midi_category_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX midi_category_idx ON midi USING btree (category);


--
-- TOC entry 63 (OID 42965)
-- Name: midi_adate_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX midi_adate_idx ON midi USING btree (adate);


--
-- TOC entry 65 (OID 42966)
-- Name: midi_dlcount_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX midi_dlcount_idx ON midi USING btree (dlcount);


--
-- TOC entry 66 (OID 42967)
-- Name: midi_name_eng_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX midi_name_eng_idx ON midi USING btree (name_eng);


--
-- TOC entry 88 (OID 42968)
-- Name: chat_tet_fr_u_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX chat_tet_fr_u_idx ON chat_tet USING btree (fr_u);


--
-- TOC entry 91 (OID 42969)
-- Name: chat_tet_to_u_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX chat_tet_to_u_idx ON chat_tet USING btree (to_u);


--
-- TOC entry 90 (OID 42970)
-- Name: chat_tet_time_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX chat_tet_time_idx ON chat_tet USING btree ("time");


--
-- TOC entry 74 (OID 42971)
-- Name: users_posts_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX users_posts_idx ON users USING btree (posts);


--
-- TOC entry 92 (OID 42972)
-- Name: photos_path_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE UNIQUE INDEX photos_path_idx ON photos USING btree ("path");


--
-- TOC entry 94 (OID 42973)
-- Name: photos_uid_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX photos_uid_idx ON photos USING btree (uid);


--
-- TOC entry 87 (OID 42974)
-- Name: messages_to_u_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX messages_to_u_idx ON messages USING btree (to_u);


--
-- TOC entry 96 (OID 42975)
-- Name: user_agent_uid_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX user_agent_uid_idx ON user_agent USING btree (uid);


--
-- TOC entry 98 (OID 42976)
-- Name: chat_tags_tag_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX chat_tags_tag_idx ON chat_tags USING btree (tag);


--
-- TOC entry 72 (OID 257537)
-- Name: users_passwd_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX users_passwd_idx ON users USING btree (passwd);


--
-- TOC entry 71 (OID 257831)
-- Name: users_login_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE UNIQUE INDEX users_login_idx ON users USING btree (login);


--
-- TOC entry 100 (OID 10333004)
-- Name: themes_forum_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX themes_forum_idx ON themes USING btree (forum);


--
-- TOC entry 107 (OID 10333139)
-- Name: seen_by_uid_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX seen_by_uid_idx ON seen_by USING btree (uid);


--
-- TOC entry 106 (OID 10333142)
-- Name: seen_by_theme_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX seen_by_theme_idx ON seen_by USING btree (theme);


--
-- TOC entry 101 (OID 10337492)
-- Name: themes_lastrepl_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX themes_lastrepl_idx ON themes USING btree (lastrepl);


--
-- TOC entry 104 (OID 10337531)
-- Name: threads_theme_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX threads_theme_idx ON threads USING btree (theme);


--
-- TOC entry 108 (OID 10388930)
-- Name: fseen_by_forum_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX fseen_by_forum_idx ON fseen_by USING btree (forum);


--
-- TOC entry 110 (OID 10389327)
-- Name: fseen_by_uid_idx; Type: INDEX; Schema: public; Owner: katrinka
--

CREATE INDEX fseen_by_uid_idx ON fseen_by USING btree (uid);


--
-- TOC entry 61 (OID 42977)
-- Name: wapgbk_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY wapgbk
    ADD CONSTRAINT wapgbk_pkey PRIMARY KEY (id);


--
-- TOC entry 62 (OID 42979)
-- Name: cat_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY cat
    ADD CONSTRAINT cat_pkey PRIMARY KEY (id);


--
-- TOC entry 68 (OID 42981)
-- Name: midi_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY midi
    ADD CONSTRAINT midi_pkey PRIMARY KEY (id);


--
-- TOC entry 69 (OID 42983)
-- Name: user_status_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY user_status
    ADD CONSTRAINT user_status_pkey PRIMARY KEY (id);


--
-- TOC entry 75 (OID 42987)
-- Name: downloads_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY downloads
    ADD CONSTRAINT downloads_pkey PRIMARY KEY (id);


--
-- TOC entry 77 (OID 42989)
-- Name: chat_rooms_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat_rooms
    ADD CONSTRAINT chat_rooms_pkey PRIMARY KEY (id);


--
-- TOC entry 79 (OID 42991)
-- Name: chat_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat
    ADD CONSTRAINT chat_pkey PRIMARY KEY (id);


--
-- TOC entry 82 (OID 42993)
-- Name: users_ignore_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY users_ignore
    ADD CONSTRAINT users_ignore_pkey PRIMARY KEY (id);


--
-- TOC entry 84 (OID 42995)
-- Name: site_var_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY site_var
    ADD CONSTRAINT site_var_pkey PRIMARY KEY (id);


--
-- TOC entry 85 (OID 42997)
-- Name: mfolders_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY mfolders
    ADD CONSTRAINT mfolders_pkey PRIMARY KEY (id);


--
-- TOC entry 86 (OID 42999)
-- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

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


--
-- TOC entry 89 (OID 43001)
-- Name: chat_tet_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat_tet
    ADD CONSTRAINT chat_tet_pkey PRIMARY KEY (id);


--
-- TOC entry 93 (OID 43003)
-- Name: photos_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY photos
    ADD CONSTRAINT photos_pkey PRIMARY KEY (id);


--
-- TOC entry 95 (OID 43005)
-- Name: user_agent_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY user_agent
    ADD CONSTRAINT user_agent_pkey PRIMARY KEY (id);


--
-- TOC entry 97 (OID 43007)
-- Name: chat_tags_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat_tags
    ADD CONSTRAINT chat_tags_pkey PRIMARY KEY (id);


--
-- TOC entry 99 (OID 256945)
-- Name: forums_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY forums
    ADD CONSTRAINT forums_pkey PRIMARY KEY (id);


--
-- TOC entry 102 (OID 257212)
-- Name: themes_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY themes
    ADD CONSTRAINT themes_pkey PRIMARY KEY (id);


--
-- TOC entry 103 (OID 257378)
-- Name: threads_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY threads
    ADD CONSTRAINT threads_pkey PRIMARY KEY (id);


--
-- TOC entry 73 (OID 257777)
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

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


--
-- TOC entry 105 (OID 258052)
-- Name: seen_by_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY seen_by
    ADD CONSTRAINT seen_by_pkey PRIMARY KEY (id);


--
-- TOC entry 109 (OID 10388829)
-- Name: fseen_by_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY fseen_by
    ADD CONSTRAINT fseen_by_pkey PRIMARY KEY (id);


--
-- TOC entry 111 (OID 11081710)
-- Name: forum_moder_pkey; Type: CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY forum_moder
    ADD CONSTRAINT forum_moder_pkey PRIMARY KEY (id);


--
-- TOC entry 135 (OID 43009)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY midi
    ADD CONSTRAINT "$1" FOREIGN KEY (category) REFERENCES cat(id);


--
-- TOC entry 136 (OID 43013)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY downloads
    ADD CONSTRAINT "$2" FOREIGN KEY (midi) REFERENCES midi(id);


--
-- TOC entry 138 (OID 43017)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat
    ADD CONSTRAINT "$1" FOREIGN KEY (room) REFERENCES chat_rooms(id);


--
-- TOC entry 141 (OID 43021)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY messages
    ADD CONSTRAINT "$1" FOREIGN KEY (folder) REFERENCES mfolders(id);


--
-- TOC entry 148 (OID 257214)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY themes
    ADD CONSTRAINT "$1" FOREIGN KEY (forum) REFERENCES forums(id);


--
-- TOC entry 150 (OID 257380)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY threads
    ADD CONSTRAINT "$1" FOREIGN KEY (theme) REFERENCES themes(id);


--
-- TOC entry 152 (OID 258054)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY seen_by
    ADD CONSTRAINT "$1" FOREIGN KEY (theme) REFERENCES themes(id);


--
-- TOC entry 153 (OID 258058)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY seen_by
    ADD CONSTRAINT "$2" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 139 (OID 258200)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat
    ADD CONSTRAINT "$2" FOREIGN KEY (fr_u) REFERENCES users(id);


--
-- TOC entry 140 (OID 258212)
-- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat
    ADD CONSTRAINT "$3" FOREIGN KEY (to_u) REFERENCES users(id);


--
-- TOC entry 134 (OID 258238)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY wapgbk
    ADD CONSTRAINT "$1" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 144 (OID 258279)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat_tet
    ADD CONSTRAINT "$1" FOREIGN KEY (fr_u) REFERENCES users(id);


--
-- TOC entry 145 (OID 258291)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY chat_tet
    ADD CONSTRAINT "$2" FOREIGN KEY (to_u) REFERENCES users(id);


--
-- TOC entry 146 (OID 258317)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY photos
    ADD CONSTRAINT "$1" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 142 (OID 258349)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY messages
    ADD CONSTRAINT "$2" FOREIGN KEY (fr_u) REFERENCES users(id);


--
-- TOC entry 143 (OID 258360)
-- Name: $3; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY messages
    ADD CONSTRAINT "$3" FOREIGN KEY (to_u) REFERENCES users(id);


--
-- TOC entry 147 (OID 258384)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY user_agent
    ADD CONSTRAINT "$1" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 149 (OID 258523)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY themes
    ADD CONSTRAINT "$2" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 151 (OID 258537)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY threads
    ADD CONSTRAINT "$2" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 137 (OID 258553)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY downloads
    ADD CONSTRAINT "$1" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 154 (OID 10388831)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY fseen_by
    ADD CONSTRAINT "$1" FOREIGN KEY (forum) REFERENCES forums(id);


--
-- TOC entry 155 (OID 10388835)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY fseen_by
    ADD CONSTRAINT "$2" FOREIGN KEY (uid) REFERENCES users(id);


--
-- TOC entry 156 (OID 11081712)
-- Name: $1; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY forum_moder
    ADD CONSTRAINT "$1" FOREIGN KEY (forum) REFERENCES forums(id);


--
-- TOC entry 157 (OID 11081716)
-- Name: $2; Type: FK CONSTRAINT; Schema: public; Owner: katrinka
--

ALTER TABLE ONLY forum_moder
    ADD CONSTRAINT "$2" FOREIGN KEY (uid) REFERENCES users(id);