diff -r bf21a4abea9b -r 56deca862adc sql/schéma.sql --- a/sql/schéma.sql Sat Jan 08 20:18:27 2011 +0100 +++ b/sql/schéma.sql Sat Jan 15 00:57:45 2011 +0100 @@ -2,7 +2,7 @@ -- PostgreSQL database dump -- --- Started on 2011-01-08 19:54:48 CET +-- Started on 2011-01-11 15:26:21 CET SET statement_timeout = 0; SET client_encoding = 'UTF8'; @@ -36,7 +36,7 @@ ALTER DOMAIN nekurak.email OWNER TO nekurak; -- --- TOC entry 1941 (class 0 OID 0) +-- TOC entry 1942 (class 0 OID 0) -- Dependencies: 366 -- Name: DOMAIN email; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -64,7 +64,7 @@ ALTER FUNCTION nekurak.bezny_uzivatel() OWNER TO nekurak; -- --- TOC entry 1942 (class 0 OID 0) +-- TOC entry 1943 (class 0 OID 0) -- Dependencies: 65 -- Name: FUNCTION bezny_uzivatel(); Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -93,7 +93,7 @@ -- -- TOC entry 1609 (class 1259 OID 35205) --- Dependencies: 1896 10 +-- Dependencies: 1897 10 -- Name: clanek; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -107,7 +107,7 @@ ALTER TABLE nekurak.clanek OWNER TO nekurak; -- --- TOC entry 1944 (class 0 OID 0) +-- TOC entry 1945 (class 0 OID 0) -- Dependencies: 1609 -- Name: TABLE clanek; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -133,7 +133,7 @@ -- -- TOC entry 1608 (class 1259 OID 35185) --- Dependencies: 1894 1895 10 +-- Dependencies: 1895 1896 10 -- Name: fotka; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -148,7 +148,7 @@ ALTER TABLE nekurak.fotka OWNER TO nekurak; -- --- TOC entry 1947 (class 0 OID 0) +-- TOC entry 1948 (class 0 OID 0) -- Dependencies: 1608 -- Name: TABLE fotka; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -157,7 +157,7 @@ -- --- TOC entry 1948 (class 0 OID 0) +-- TOC entry 1949 (class 0 OID 0) -- Dependencies: 1608 -- Name: COLUMN fotka.poradi; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -182,7 +182,7 @@ -- -- TOC entry 1613 (class 1259 OID 35278) --- Dependencies: 1897 1898 10 +-- Dependencies: 1898 1899 10 -- Name: hlasovani; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -198,7 +198,7 @@ ALTER TABLE nekurak.hlasovani OWNER TO nekurak; -- --- TOC entry 1951 (class 0 OID 0) +-- TOC entry 1952 (class 0 OID 0) -- Dependencies: 1613 -- Name: COLUMN hlasovani.id; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -209,7 +209,7 @@ -- --- TOC entry 1952 (class 0 OID 0) +-- TOC entry 1953 (class 0 OID 0) -- Dependencies: 1613 -- Name: COLUMN hlasovani.hlas; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -236,21 +236,20 @@ -- -- TOC entry 1617 (class 1259 OID 35398) --- Dependencies: 1901 10 +-- Dependencies: 1902 10 -- Name: kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: -- CREATE TABLE kategorie ( id integer DEFAULT nextval('kategorie_seq'::regclass) NOT NULL, - nazev character varying(32) NOT NULL, - popis character varying(255) + nazev character varying(32) NOT NULL ); ALTER TABLE nekurak.kategorie OWNER TO nekurak; -- --- TOC entry 1955 (class 0 OID 0) +-- TOC entry 1956 (class 0 OID 0) -- Dependencies: 1617 -- Name: TABLE kategorie; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -259,6 +258,16 @@ -- +-- TOC entry 1957 (class 0 OID 0) +-- Dependencies: 1617 +-- Name: COLUMN kategorie.nazev; Type: COMMENT; Schema: nekurak; Owner: nekurak +-- + +COMMENT ON COLUMN kategorie.nazev IS 'jen pro info při přímé práci s SQL +aplikace bere názvy a popisy kategorií z lokalizačního souboru (na základě ID kategorie)'; + + +-- -- TOC entry 1614 (class 1259 OID 35333) -- Dependencies: 10 -- Name: komentar_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak @@ -275,7 +284,7 @@ -- -- TOC entry 1615 (class 1259 OID 35376) --- Dependencies: 1899 1900 10 +-- Dependencies: 1900 1901 10 -- Name: komentar; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -292,7 +301,7 @@ ALTER TABLE nekurak.komentar OWNER TO nekurak; -- --- TOC entry 1958 (class 0 OID 0) +-- TOC entry 1960 (class 0 OID 0) -- Dependencies: 1615 -- Name: TABLE komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -301,7 +310,7 @@ -- --- TOC entry 1959 (class 0 OID 0) +-- TOC entry 1961 (class 0 OID 0) -- Dependencies: 1615 -- Name: COLUMN komentar.nadpis; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -310,7 +319,7 @@ -- --- TOC entry 1960 (class 0 OID 0) +-- TOC entry 1962 (class 0 OID 0) -- Dependencies: 1615 -- Name: COLUMN komentar.komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -336,7 +345,7 @@ -- -- TOC entry 1602 (class 1259 OID 35049) --- Dependencies: 1890 1891 10 +-- Dependencies: 1890 1891 1892 10 -- Name: podnik; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -351,14 +360,16 @@ mesto character varying(64), spravce character varying(64), sirka double precision, - delka double precision + delka double precision, + stav character(1), + CONSTRAINT stav_tg CHECK (((stav = ANY (ARRAY['k'::bpchar, 'n'::bpchar, 'o'::bpchar, 'c'::bpchar])) OR (stav IS NULL))) ); ALTER TABLE nekurak.podnik OWNER TO nekurak; -- --- TOC entry 1963 (class 0 OID 0) +-- TOC entry 1965 (class 0 OID 0) -- Dependencies: 1602 -- Name: COLUMN podnik.spravce; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -367,6 +378,19 @@ -- +-- TOC entry 1966 (class 0 OID 0) +-- Dependencies: 1602 +-- Name: CONSTRAINT stav_tg ON podnik; Type: COMMENT; Schema: nekurak; Owner: nekurak +-- + +COMMENT ON CONSTRAINT stav_tg ON podnik IS 'k = kuřácký +n = nekuřácký +o = oddělené části (důkladně) +c = částečně kuřácký (špatně oddělené, považujeme za kuřácký) +NULL = neznámý stav'; + + +-- -- TOC entry 1618 (class 1259 OID 35404) -- Dependencies: 10 -- Name: podnik_kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: @@ -395,7 +419,7 @@ ALTER TABLE nekurak.role OWNER TO nekurak; -- --- TOC entry 1966 (class 0 OID 0) +-- TOC entry 1969 (class 0 OID 0) -- Dependencies: 1605 -- Name: TABLE role; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -420,7 +444,7 @@ -- -- TOC entry 1604 (class 1259 OID 35091) --- Dependencies: 1892 1893 10 +-- Dependencies: 1893 1894 10 -- Name: uzivatel; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -438,7 +462,7 @@ ALTER TABLE nekurak.uzivatel OWNER TO nekurak; -- --- TOC entry 1969 (class 0 OID 0) +-- TOC entry 1972 (class 0 OID 0) -- Dependencies: 1604 -- Name: COLUMN uzivatel.prezdivka; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -461,7 +485,7 @@ ALTER TABLE nekurak.uzivatel_role OWNER TO nekurak; -- --- TOC entry 1971 (class 0 OID 0) +-- TOC entry 1974 (class 0 OID 0) -- Dependencies: 1606 -- Name: TABLE uzivatel_role; Type: COMMENT; Schema: nekurak; Owner: nekurak -- @@ -470,7 +494,7 @@ -- --- TOC entry 1917 (class 2606 OID 35227) +-- TOC entry 1918 (class 2606 OID 35227) -- Dependencies: 1609 1609 -- Name: clanek_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -480,7 +504,7 @@ -- --- TOC entry 1913 (class 2606 OID 35190) +-- TOC entry 1914 (class 2606 OID 35190) -- Dependencies: 1608 1608 -- Name: fotka_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -490,7 +514,7 @@ -- --- TOC entry 1915 (class 2606 OID 35204) +-- TOC entry 1916 (class 2606 OID 35204) -- Dependencies: 1608 1608 1608 -- Name: fotka_poradi_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -500,7 +524,7 @@ -- --- TOC entry 1920 (class 2606 OID 35284) +-- TOC entry 1921 (class 2606 OID 35284) -- Dependencies: 1613 1613 -- Name: hlasovani_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -510,7 +534,7 @@ -- --- TOC entry 1925 (class 2606 OID 35403) +-- TOC entry 1926 (class 2606 OID 35403) -- Dependencies: 1617 1617 -- Name: kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -520,7 +544,7 @@ -- --- TOC entry 1923 (class 2606 OID 35385) +-- TOC entry 1924 (class 2606 OID 35385) -- Dependencies: 1615 1615 -- Name: komentar_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -530,7 +554,7 @@ -- --- TOC entry 1927 (class 2606 OID 35408) +-- TOC entry 1928 (class 2606 OID 35408) -- Dependencies: 1618 1618 1618 -- Name: podnik_kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -540,7 +564,7 @@ -- --- TOC entry 1903 (class 2606 OID 35058) +-- TOC entry 1904 (class 2606 OID 35058) -- Dependencies: 1602 1602 -- Name: podnik_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -550,7 +574,7 @@ -- --- TOC entry 1909 (class 2606 OID 35105) +-- TOC entry 1910 (class 2606 OID 35105) -- Dependencies: 1605 1605 -- Name: skupina_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -560,7 +584,7 @@ -- --- TOC entry 1905 (class 2606 OID 35098) +-- TOC entry 1906 (class 2606 OID 35098) -- Dependencies: 1604 1604 -- Name: uzivatel_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -570,7 +594,7 @@ -- --- TOC entry 1907 (class 2606 OID 35100) +-- TOC entry 1908 (class 2606 OID 35100) -- Dependencies: 1604 1604 -- Name: uzivatel_prezdivka_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -580,7 +604,7 @@ -- --- TOC entry 1911 (class 2606 OID 35137) +-- TOC entry 1912 (class 2606 OID 35137) -- Dependencies: 1606 1606 1606 -- Name: uzivatel_role_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -590,7 +614,7 @@ -- --- TOC entry 1918 (class 1259 OID 35291) +-- TOC entry 1919 (class 1259 OID 35291) -- Dependencies: 1613 -- Name: hlasovani_ip_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -599,7 +623,7 @@ -- --- TOC entry 1921 (class 1259 OID 35309) +-- TOC entry 1922 (class 1259 OID 35309) -- Dependencies: 1613 -- Name: hlsovani_datum_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: -- @@ -608,7 +632,7 @@ -- --- TOC entry 1937 (class 2620 OID 35125) +-- TOC entry 1938 (class 2620 OID 35125) -- Dependencies: 1604 65 -- Name: uzivatel_insert; Type: TRIGGER; Schema: nekurak; Owner: nekurak -- @@ -620,8 +644,8 @@ -- --- TOC entry 1931 (class 2606 OID 35191) --- Dependencies: 1608 1602 1902 +-- TOC entry 1932 (class 2606 OID 35191) +-- Dependencies: 1903 1608 1602 -- Name: fotka_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -630,8 +654,8 @@ -- --- TOC entry 1932 (class 2606 OID 35285) --- Dependencies: 1602 1902 1613 +-- TOC entry 1933 (class 2606 OID 35285) +-- Dependencies: 1903 1602 1613 -- Name: hlasovani_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -640,8 +664,8 @@ -- --- TOC entry 1933 (class 2606 OID 35386) --- Dependencies: 1615 1602 1902 +-- TOC entry 1934 (class 2606 OID 35386) +-- Dependencies: 1615 1602 1903 -- Name: komentar_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -650,8 +674,8 @@ -- --- TOC entry 1934 (class 2606 OID 35391) --- Dependencies: 1615 1906 1604 +-- TOC entry 1935 (class 2606 OID 35391) +-- Dependencies: 1907 1604 1615 -- Name: komentar_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -660,8 +684,8 @@ -- --- TOC entry 1936 (class 2606 OID 35414) --- Dependencies: 1924 1618 1617 +-- TOC entry 1937 (class 2606 OID 35414) +-- Dependencies: 1618 1925 1617 -- Name: podnik_kategorie_kategorie_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -670,8 +694,8 @@ -- --- TOC entry 1935 (class 2606 OID 35409) --- Dependencies: 1618 1902 1602 +-- TOC entry 1936 (class 2606 OID 35409) +-- Dependencies: 1903 1602 1618 -- Name: podnik_kategorie_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -680,8 +704,8 @@ -- --- TOC entry 1928 (class 2606 OID 35178) --- Dependencies: 1602 1604 1906 +-- TOC entry 1929 (class 2606 OID 35178) +-- Dependencies: 1602 1604 1907 -- Name: podnik_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -690,8 +714,8 @@ -- --- TOC entry 1929 (class 2606 OID 35138) --- Dependencies: 1605 1908 1606 +-- TOC entry 1930 (class 2606 OID 35138) +-- Dependencies: 1909 1606 1605 -- Name: uzivatel_role_role_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -700,8 +724,8 @@ -- --- TOC entry 1930 (class 2606 OID 35143) --- Dependencies: 1604 1606 1906 +-- TOC entry 1931 (class 2606 OID 35143) +-- Dependencies: 1907 1604 1606 -- Name: uzivatel_role_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak -- @@ -710,7 +734,7 @@ -- --- TOC entry 1940 (class 0 OID 0) +-- TOC entry 1941 (class 0 OID 0) -- Dependencies: 10 -- Name: nekurak; Type: ACL; Schema: -; Owner: nekurak -- @@ -722,7 +746,7 @@ -- --- TOC entry 1943 (class 0 OID 0) +-- TOC entry 1944 (class 0 OID 0) -- Dependencies: 1610 -- Name: clanek_seq; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -734,7 +758,7 @@ -- --- TOC entry 1945 (class 0 OID 0) +-- TOC entry 1946 (class 0 OID 0) -- Dependencies: 1609 -- Name: clanek; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -746,7 +770,7 @@ -- --- TOC entry 1946 (class 0 OID 0) +-- TOC entry 1947 (class 0 OID 0) -- Dependencies: 1607 -- Name: fotka_seq; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -758,7 +782,7 @@ -- --- TOC entry 1949 (class 0 OID 0) +-- TOC entry 1950 (class 0 OID 0) -- Dependencies: 1608 -- Name: fotka; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -770,7 +794,7 @@ -- --- TOC entry 1950 (class 0 OID 0) +-- TOC entry 1951 (class 0 OID 0) -- Dependencies: 1612 -- Name: hlasovani_seq; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -782,7 +806,7 @@ -- --- TOC entry 1953 (class 0 OID 0) +-- TOC entry 1954 (class 0 OID 0) -- Dependencies: 1613 -- Name: hlasovani; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -794,7 +818,7 @@ -- --- TOC entry 1954 (class 0 OID 0) +-- TOC entry 1955 (class 0 OID 0) -- Dependencies: 1616 -- Name: kategorie_seq; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -806,7 +830,7 @@ -- --- TOC entry 1956 (class 0 OID 0) +-- TOC entry 1958 (class 0 OID 0) -- Dependencies: 1617 -- Name: kategorie; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -818,7 +842,7 @@ -- --- TOC entry 1957 (class 0 OID 0) +-- TOC entry 1959 (class 0 OID 0) -- Dependencies: 1614 -- Name: komentar_seq; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -830,7 +854,7 @@ -- --- TOC entry 1961 (class 0 OID 0) +-- TOC entry 1963 (class 0 OID 0) -- Dependencies: 1615 -- Name: komentar; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -842,7 +866,7 @@ -- --- TOC entry 1962 (class 0 OID 0) +-- TOC entry 1964 (class 0 OID 0) -- Dependencies: 1601 -- Name: podnik_seq; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -854,7 +878,7 @@ -- --- TOC entry 1964 (class 0 OID 0) +-- TOC entry 1967 (class 0 OID 0) -- Dependencies: 1602 -- Name: podnik; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -866,7 +890,7 @@ -- --- TOC entry 1965 (class 0 OID 0) +-- TOC entry 1968 (class 0 OID 0) -- Dependencies: 1618 -- Name: podnik_kategorie; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -878,7 +902,7 @@ -- --- TOC entry 1967 (class 0 OID 0) +-- TOC entry 1970 (class 0 OID 0) -- Dependencies: 1605 -- Name: role; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -890,7 +914,7 @@ -- --- TOC entry 1968 (class 0 OID 0) +-- TOC entry 1971 (class 0 OID 0) -- Dependencies: 1603 -- Name: uzivatel_seq; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -902,7 +926,7 @@ -- --- TOC entry 1970 (class 0 OID 0) +-- TOC entry 1973 (class 0 OID 0) -- Dependencies: 1604 -- Name: uzivatel; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -914,7 +938,7 @@ -- --- TOC entry 1972 (class 0 OID 0) +-- TOC entry 1975 (class 0 OID 0) -- Dependencies: 1606 -- Name: uzivatel_role; Type: ACL; Schema: nekurak; Owner: nekurak -- @@ -925,7 +949,7 @@ GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel_role TO nekurak_web; --- Completed on 2011-01-08 19:54:50 CET +-- Completed on 2011-01-11 15:26:23 CET -- -- PostgreSQL database dump complete