sql/schéma.sql
changeset 135 ec558dd0ca34
parent 115 b278b6b2d552
child 137 5a7a24ac3a15
     1.1 --- a/sql/schéma.sql	Wed Apr 28 00:36:21 2010 +0200
     1.2 +++ b/sql/schéma.sql	Tue Jun 08 14:42:40 2010 +0200
     1.3 @@ -2,7 +2,7 @@
     1.4  -- PostgreSQL database dump
     1.5  --
     1.6  
     1.7 --- Started on 2010-04-28 00:33:47 CEST
     1.8 +-- Started on 2010-04-29 14:41:40 CEST
     1.9  
    1.10  SET statement_timeout = 0;
    1.11  SET client_encoding = 'UTF8';
    1.12 @@ -36,7 +36,7 @@
    1.13  ALTER DOMAIN nekurak.email OWNER TO nekurak;
    1.14  
    1.15  --
    1.16 --- TOC entry 1913 (class 0 OID 0)
    1.17 +-- TOC entry 1914 (class 0 OID 0)
    1.18  -- Dependencies: 366
    1.19  -- Name: DOMAIN email; Type: COMMENT; Schema: nekurak; Owner: nekurak
    1.20  --
    1.21 @@ -46,7 +46,7 @@
    1.22  
    1.23  --
    1.24  -- TOC entry 65 (class 1255 OID 35124)
    1.25 --- Dependencies: 402 10
    1.26 +-- Dependencies: 10 402
    1.27  -- Name: bezny_uzivatel(); Type: FUNCTION; Schema: nekurak; Owner: nekurak
    1.28  --
    1.29  
    1.30 @@ -64,7 +64,7 @@
    1.31  ALTER FUNCTION nekurak.bezny_uzivatel() OWNER TO nekurak;
    1.32  
    1.33  --
    1.34 --- TOC entry 1914 (class 0 OID 0)
    1.35 +-- TOC entry 1915 (class 0 OID 0)
    1.36  -- Dependencies: 65
    1.37  -- Name: FUNCTION bezny_uzivatel(); Type: COMMENT; Schema: nekurak; Owner: nekurak
    1.38  --
    1.39 @@ -107,7 +107,7 @@
    1.40  ALTER TABLE nekurak.clanek OWNER TO nekurak;
    1.41  
    1.42  --
    1.43 --- TOC entry 1916 (class 0 OID 0)
    1.44 +-- TOC entry 1917 (class 0 OID 0)
    1.45  -- Dependencies: 1600
    1.46  -- Name: TABLE clanek; Type: COMMENT; Schema: nekurak; Owner: nekurak
    1.47  --
    1.48 @@ -148,7 +148,7 @@
    1.49  ALTER TABLE nekurak.fotka OWNER TO nekurak;
    1.50  
    1.51  --
    1.52 --- TOC entry 1919 (class 0 OID 0)
    1.53 +-- TOC entry 1920 (class 0 OID 0)
    1.54  -- Dependencies: 1599
    1.55  -- Name: TABLE fotka; Type: COMMENT; Schema: nekurak; Owner: nekurak
    1.56  --
    1.57 @@ -157,7 +157,7 @@
    1.58  
    1.59  
    1.60  --
    1.61 --- TOC entry 1920 (class 0 OID 0)
    1.62 +-- TOC entry 1921 (class 0 OID 0)
    1.63  -- Dependencies: 1599
    1.64  -- Name: COLUMN fotka.poradi; Type: COMMENT; Schema: nekurak; Owner: nekurak
    1.65  --
    1.66 @@ -190,7 +190,7 @@
    1.67      id integer DEFAULT nextval('hlasovani_seq'::regclass) NOT NULL,
    1.68      podnik integer NOT NULL,
    1.69      hlas boolean NOT NULL,
    1.70 -    datum date DEFAULT now() NOT NULL,
    1.71 +    datum timestamp without time zone DEFAULT now() NOT NULL,
    1.72      ip_adresa character varying(255) NOT NULL
    1.73  );
    1.74  
    1.75 @@ -198,7 +198,7 @@
    1.76  ALTER TABLE nekurak.hlasovani OWNER TO nekurak;
    1.77  
    1.78  --
    1.79 --- TOC entry 1923 (class 0 OID 0)
    1.80 +-- TOC entry 1924 (class 0 OID 0)
    1.81  -- Dependencies: 1604
    1.82  -- Name: COLUMN hlasovani.id; Type: COMMENT; Schema: nekurak; Owner: nekurak
    1.83  --
    1.84 @@ -209,7 +209,7 @@
    1.85  
    1.86  
    1.87  --
    1.88 --- TOC entry 1924 (class 0 OID 0)
    1.89 +-- TOC entry 1925 (class 0 OID 0)
    1.90  -- Dependencies: 1604
    1.91  -- Name: COLUMN hlasovani.hlas; Type: COMMENT; Schema: nekurak; Owner: nekurak
    1.92  --
    1.93 @@ -258,7 +258,7 @@
    1.94  ALTER TABLE nekurak.podnik OWNER TO nekurak;
    1.95  
    1.96  --
    1.97 --- TOC entry 1927 (class 0 OID 0)
    1.98 +-- TOC entry 1928 (class 0 OID 0)
    1.99  -- Dependencies: 1593
   1.100  -- Name: COLUMN podnik.spravce; Type: COMMENT; Schema: nekurak; Owner: nekurak
   1.101  --
   1.102 @@ -281,7 +281,7 @@
   1.103  ALTER TABLE nekurak.role OWNER TO nekurak;
   1.104  
   1.105  --
   1.106 --- TOC entry 1929 (class 0 OID 0)
   1.107 +-- TOC entry 1930 (class 0 OID 0)
   1.108  -- Dependencies: 1596
   1.109  -- Name: TABLE role; Type: COMMENT; Schema: nekurak; Owner: nekurak
   1.110  --
   1.111 @@ -324,7 +324,7 @@
   1.112  ALTER TABLE nekurak.uzivatel OWNER TO nekurak;
   1.113  
   1.114  --
   1.115 --- TOC entry 1932 (class 0 OID 0)
   1.116 +-- TOC entry 1933 (class 0 OID 0)
   1.117  -- Dependencies: 1595
   1.118  -- Name: COLUMN uzivatel.prezdivka; Type: COMMENT; Schema: nekurak; Owner: nekurak
   1.119  --
   1.120 @@ -347,7 +347,7 @@
   1.121  ALTER TABLE nekurak.uzivatel_role OWNER TO nekurak;
   1.122  
   1.123  --
   1.124 --- TOC entry 1934 (class 0 OID 0)
   1.125 +-- TOC entry 1935 (class 0 OID 0)
   1.126  -- Dependencies: 1597
   1.127  -- Name: TABLE uzivatel_role; Type: COMMENT; Schema: nekurak; Owner: nekurak
   1.128  --
   1.129 @@ -455,8 +455,17 @@
   1.130  
   1.131  
   1.132  --
   1.133 --- TOC entry 1909 (class 2620 OID 35125)
   1.134 --- Dependencies: 65 1595
   1.135 +-- TOC entry 1904 (class 1259 OID 35309)
   1.136 +-- Dependencies: 1604
   1.137 +-- Name: hlsovani_datum_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: 
   1.138 +--
   1.139 +
   1.140 +CREATE INDEX hlsovani_datum_idx ON hlasovani USING btree (date(datum));
   1.141 +
   1.142 +
   1.143 +--
   1.144 +-- TOC entry 1910 (class 2620 OID 35125)
   1.145 +-- Dependencies: 1595 65
   1.146  -- Name: uzivatel_insert; Type: TRIGGER; Schema: nekurak; Owner: nekurak
   1.147  --
   1.148  
   1.149 @@ -467,8 +476,8 @@
   1.150  
   1.151  
   1.152  --
   1.153 --- TOC entry 1907 (class 2606 OID 35191)
   1.154 --- Dependencies: 1599 1593 1885
   1.155 +-- TOC entry 1908 (class 2606 OID 35191)
   1.156 +-- Dependencies: 1599 1885 1593
   1.157  -- Name: fotka_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   1.158  --
   1.159  
   1.160 @@ -477,7 +486,7 @@
   1.161  
   1.162  
   1.163  --
   1.164 --- TOC entry 1908 (class 2606 OID 35285)
   1.165 +-- TOC entry 1909 (class 2606 OID 35285)
   1.166  -- Dependencies: 1885 1604 1593
   1.167  -- Name: hlasovani_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   1.168  --
   1.169 @@ -487,8 +496,8 @@
   1.170  
   1.171  
   1.172  --
   1.173 --- TOC entry 1904 (class 2606 OID 35178)
   1.174 --- Dependencies: 1593 1889 1595
   1.175 +-- TOC entry 1905 (class 2606 OID 35178)
   1.176 +-- Dependencies: 1889 1595 1593
   1.177  -- Name: podnik_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   1.178  --
   1.179  
   1.180 @@ -497,8 +506,8 @@
   1.181  
   1.182  
   1.183  --
   1.184 --- TOC entry 1905 (class 2606 OID 35138)
   1.185 --- Dependencies: 1597 1891 1596
   1.186 +-- TOC entry 1906 (class 2606 OID 35138)
   1.187 +-- Dependencies: 1597 1596 1891
   1.188  -- Name: uzivatel_role_role_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   1.189  --
   1.190  
   1.191 @@ -507,8 +516,8 @@
   1.192  
   1.193  
   1.194  --
   1.195 --- TOC entry 1906 (class 2606 OID 35143)
   1.196 --- Dependencies: 1889 1595 1597
   1.197 +-- TOC entry 1907 (class 2606 OID 35143)
   1.198 +-- Dependencies: 1597 1889 1595
   1.199  -- Name: uzivatel_role_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   1.200  --
   1.201  
   1.202 @@ -517,7 +526,7 @@
   1.203  
   1.204  
   1.205  --
   1.206 --- TOC entry 1912 (class 0 OID 0)
   1.207 +-- TOC entry 1913 (class 0 OID 0)
   1.208  -- Dependencies: 10
   1.209  -- Name: nekurak; Type: ACL; Schema: -; Owner: nekurak
   1.210  --
   1.211 @@ -529,7 +538,7 @@
   1.212  
   1.213  
   1.214  --
   1.215 --- TOC entry 1915 (class 0 OID 0)
   1.216 +-- TOC entry 1916 (class 0 OID 0)
   1.217  -- Dependencies: 1601
   1.218  -- Name: clanek_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   1.219  --
   1.220 @@ -541,7 +550,7 @@
   1.221  
   1.222  
   1.223  --
   1.224 --- TOC entry 1917 (class 0 OID 0)
   1.225 +-- TOC entry 1918 (class 0 OID 0)
   1.226  -- Dependencies: 1600
   1.227  -- Name: clanek; Type: ACL; Schema: nekurak; Owner: nekurak
   1.228  --
   1.229 @@ -553,7 +562,7 @@
   1.230  
   1.231  
   1.232  --
   1.233 --- TOC entry 1918 (class 0 OID 0)
   1.234 +-- TOC entry 1919 (class 0 OID 0)
   1.235  -- Dependencies: 1598
   1.236  -- Name: fotka_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   1.237  --
   1.238 @@ -565,7 +574,7 @@
   1.239  
   1.240  
   1.241  --
   1.242 --- TOC entry 1921 (class 0 OID 0)
   1.243 +-- TOC entry 1922 (class 0 OID 0)
   1.244  -- Dependencies: 1599
   1.245  -- Name: fotka; Type: ACL; Schema: nekurak; Owner: nekurak
   1.246  --
   1.247 @@ -577,7 +586,7 @@
   1.248  
   1.249  
   1.250  --
   1.251 --- TOC entry 1922 (class 0 OID 0)
   1.252 +-- TOC entry 1923 (class 0 OID 0)
   1.253  -- Dependencies: 1603
   1.254  -- Name: hlasovani_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   1.255  --
   1.256 @@ -589,7 +598,7 @@
   1.257  
   1.258  
   1.259  --
   1.260 --- TOC entry 1925 (class 0 OID 0)
   1.261 +-- TOC entry 1926 (class 0 OID 0)
   1.262  -- Dependencies: 1604
   1.263  -- Name: hlasovani; Type: ACL; Schema: nekurak; Owner: nekurak
   1.264  --
   1.265 @@ -601,7 +610,7 @@
   1.266  
   1.267  
   1.268  --
   1.269 --- TOC entry 1926 (class 0 OID 0)
   1.270 +-- TOC entry 1927 (class 0 OID 0)
   1.271  -- Dependencies: 1592
   1.272  -- Name: podnik_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   1.273  --
   1.274 @@ -613,7 +622,7 @@
   1.275  
   1.276  
   1.277  --
   1.278 --- TOC entry 1928 (class 0 OID 0)
   1.279 +-- TOC entry 1929 (class 0 OID 0)
   1.280  -- Dependencies: 1593
   1.281  -- Name: podnik; Type: ACL; Schema: nekurak; Owner: nekurak
   1.282  --
   1.283 @@ -625,7 +634,7 @@
   1.284  
   1.285  
   1.286  --
   1.287 --- TOC entry 1930 (class 0 OID 0)
   1.288 +-- TOC entry 1931 (class 0 OID 0)
   1.289  -- Dependencies: 1596
   1.290  -- Name: role; Type: ACL; Schema: nekurak; Owner: nekurak
   1.291  --
   1.292 @@ -637,7 +646,7 @@
   1.293  
   1.294  
   1.295  --
   1.296 --- TOC entry 1931 (class 0 OID 0)
   1.297 +-- TOC entry 1932 (class 0 OID 0)
   1.298  -- Dependencies: 1594
   1.299  -- Name: uzivatel_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   1.300  --
   1.301 @@ -649,7 +658,7 @@
   1.302  
   1.303  
   1.304  --
   1.305 --- TOC entry 1933 (class 0 OID 0)
   1.306 +-- TOC entry 1934 (class 0 OID 0)
   1.307  -- Dependencies: 1595
   1.308  -- Name: uzivatel; Type: ACL; Schema: nekurak; Owner: nekurak
   1.309  --
   1.310 @@ -661,7 +670,7 @@
   1.311  
   1.312  
   1.313  --
   1.314 --- TOC entry 1935 (class 0 OID 0)
   1.315 +-- TOC entry 1936 (class 0 OID 0)
   1.316  -- Dependencies: 1597
   1.317  -- Name: uzivatel_role; Type: ACL; Schema: nekurak; Owner: nekurak
   1.318  --
   1.319 @@ -672,7 +681,7 @@
   1.320  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel_role TO nekurak_web;
   1.321  
   1.322  
   1.323 --- Completed on 2010-04-28 00:33:49 CEST
   1.324 +-- Completed on 2010-04-29 14:41:42 CEST
   1.325  
   1.326  --
   1.327  -- PostgreSQL database dump complete