Zobrazování jen schválených podniků, SQL (kategorie, kuřáckost).
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat Jan 15 14:27:02 2011 +0100 (2011-01-15)
changeset 1732b458ac09044
parent 172 f0852ef58889
child 174 ca3c7dd220fe
Zobrazování jen schválených podniků, SQL (kategorie, kuřáckost).
java/nekurak.net-ejb/src/conf/Podnik.hbm.xml
java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.java
java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java
java/nekurak.net-lib/src/cz/frantovo/nekurak/dto/Podnik.java
sql/schéma.sql
     1.1 --- a/java/nekurak.net-ejb/src/conf/Podnik.hbm.xml	Sat Jan 15 01:24:00 2011 +0100
     1.2 +++ b/java/nekurak.net-ejb/src/conf/Podnik.hbm.xml	Sat Jan 15 14:27:02 2011 +0100
     1.3 @@ -32,5 +32,6 @@
     1.4  		<property name="sirka" column="sirka"/>
     1.5  		<property name="delka" column="delka"/>
     1.6  		<many-to-one name="kurackost" column="kurackost" not-null="true"/>
     1.7 +		<property name="schvaleny" column="schvaleny"/>
     1.8  	</class>
     1.9  </hibernate-mapping>
    1.10 \ No newline at end of file
     2.1 --- a/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.java	Sat Jan 15 01:24:00 2011 +0100
     2.2 +++ b/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/dao/PodnikDAO.java	Sat Jan 15 14:27:02 2011 +0100
     2.3 @@ -9,7 +9,6 @@
     2.4  import java.util.Collection;
     2.5  import java.util.Date;
     2.6  import java.util.List;
     2.7 -import java.util.Set;
     2.8  import javax.ejb.LocalBean;
     2.9  import javax.ejb.Stateless;
    2.10  import javax.persistence.EntityManager;
    2.11 @@ -33,13 +32,16 @@
    2.12  		HLASOVANI_SELECT
    2.13  	}
    2.14  
    2.15 +	/**
    2.16 +	 * @return schválené podniky
    2.17 +	 */
    2.18  	public Collection<Podnik> getPodniky() {
    2.19 -		Query dotaz = em.createQuery("FROM " + DAO.t(Podnik.class) + " p ORDER BY datum DESC");
    2.20 +		Query dotaz = em.createQuery("FROM " + DAO.t(Podnik.class) + " p WHERE p.schvaleny = true ORDER BY datum DESC");
    2.21  		return dotaz.getResultList();
    2.22  	}
    2.23  
    2.24  	/**
    2.25 -	 * @return podniky, které nemají souřadnice (null, null)
    2.26 +	 * @return podniky, které nemají souřadnice (null, null), včetně neschválených
    2.27  	 */
    2.28  	public Collection<Podnik> getPodnikyBezSouradnic() {
    2.29  		Query dotaz = em.createQuery("FROM " + DAO.t(Podnik.class) + " p WHERE sirka IS NULL AND delka IS NULL");
    2.30 @@ -48,16 +50,16 @@
    2.31  
    2.32  	/**
    2.33  	 * @param kategorie jedna kategorie
    2.34 -	 * @return podniky určité kategorie
    2.35 +	 * @return podniky určité kategorie (jen schválené)
    2.36  	 */
    2.37  	public Collection<Podnik> getPodniky(Kategorie kategorie) {
    2.38 -		Query dotaz = em.createQuery("SELECT p FROM " + DAO.t(Podnik.class) + " p INNER JOIN p.kategorie k WHERE k = :kategorie ORDER BY datum DESC");
    2.39 +		Query dotaz = em.createQuery("SELECT p FROM " + DAO.t(Podnik.class) + " p INNER JOIN p.kategorie k WHERE k = :kategorie AND p.schvaleny = true ORDER BY datum DESC");
    2.40  		dotaz.setParameter("kategorie", kategorie);
    2.41  		return dotaz.getResultList();
    2.42  	}
    2.43  
    2.44  	public Collection<Podnik> getPodniky(Kurackost kurackost) {
    2.45 -		Query dotaz = em.createQuery("FROM " + DAO.t(Podnik.class) + " p WHERE p.kurackost = :kurackost ORDER BY datum DESC");
    2.46 +		Query dotaz = em.createQuery("FROM " + DAO.t(Podnik.class) + " p WHERE p.kurackost = :kurackost AND p.schvaleny = true ORDER BY datum DESC");
    2.47  		dotaz.setParameter("kurackost", kurackost);
    2.48  		return dotaz.getResultList();
    2.49  	}
     3.1 --- a/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java	Sat Jan 15 01:24:00 2011 +0100
     3.2 +++ b/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java	Sat Jan 15 14:27:02 2011 +0100
     3.3 @@ -56,6 +56,11 @@
     3.4  
     3.5  	@RolesAllowed("opravneny")
     3.6  	public void zalozPodnik(Podnik p) {
     3.7 +		/**
     3.8 +		 * Podnik zakládáme jako neschválený a je potřeba ho dodatečně schválit,
     3.9 +		 * to může udělat jen správce a ne uživatel (TODO)
    3.10 +		 */
    3.11 +		p.setSchvaleny(false);
    3.12  		p.setSpravce(ctx.getCallerPrincipal().getName());
    3.13  		podnikDAO.zaloz(p);
    3.14  	}
     4.1 --- a/java/nekurak.net-lib/src/cz/frantovo/nekurak/dto/Podnik.java	Sat Jan 15 01:24:00 2011 +0100
     4.2 +++ b/java/nekurak.net-lib/src/cz/frantovo/nekurak/dto/Podnik.java	Sat Jan 15 14:27:02 2011 +0100
     4.3 @@ -29,6 +29,7 @@
     4.4  	private Double sirka;
     4.5  	private Double delka;
     4.6  	private Kurackost kurackost = new Kurackost();
     4.7 +	private boolean schvaleny = false;
     4.8  
     4.9  	public Podnik() {
    4.10  	}
    4.11 @@ -180,5 +181,13 @@
    4.12  	public void setKurackost(Kurackost kurackost) {
    4.13  		this.kurackost = kurackost;
    4.14  	}
    4.15 +
    4.16 +	public boolean isSchvaleny() {
    4.17 +		return schvaleny;
    4.18 +	}
    4.19 +
    4.20 +	public void setSchvaleny(boolean schvaleny) {
    4.21 +		this.schvaleny = schvaleny;
    4.22 +	}
    4.23  	/** Půdou a sklepem projedete bez nebezpečí. */
    4.24  }
     5.1 --- a/sql/schéma.sql	Sat Jan 15 01:24:00 2011 +0100
     5.2 +++ b/sql/schéma.sql	Sat Jan 15 14:27:02 2011 +0100
     5.3 @@ -2,7 +2,7 @@
     5.4  -- PostgreSQL database dump
     5.5  --
     5.6  
     5.7 --- Started on 2011-01-11 15:26:21 CET
     5.8 +-- Started on 2011-01-15 14:24:29 CET
     5.9  
    5.10  SET statement_timeout = 0;
    5.11  SET client_encoding = 'UTF8';
    5.12 @@ -36,7 +36,7 @@
    5.13  ALTER DOMAIN nekurak.email OWNER TO nekurak;
    5.14  
    5.15  --
    5.16 --- TOC entry 1942 (class 0 OID 0)
    5.17 +-- TOC entry 1946 (class 0 OID 0)
    5.18  -- Dependencies: 366
    5.19  -- Name: DOMAIN email; Type: COMMENT; Schema: nekurak; Owner: nekurak
    5.20  --
    5.21 @@ -46,7 +46,7 @@
    5.22  
    5.23  --
    5.24  -- TOC entry 65 (class 1255 OID 35124)
    5.25 --- Dependencies: 411 10
    5.26 +-- Dependencies: 412 10
    5.27  -- Name: bezny_uzivatel(); Type: FUNCTION; Schema: nekurak; Owner: nekurak
    5.28  --
    5.29  
    5.30 @@ -64,7 +64,7 @@
    5.31  ALTER FUNCTION nekurak.bezny_uzivatel() OWNER TO nekurak;
    5.32  
    5.33  --
    5.34 --- TOC entry 1943 (class 0 OID 0)
    5.35 +-- TOC entry 1947 (class 0 OID 0)
    5.36  -- Dependencies: 65
    5.37  -- Name: FUNCTION bezny_uzivatel(); Type: COMMENT; Schema: nekurak; Owner: nekurak
    5.38  --
    5.39 @@ -73,7 +73,7 @@
    5.40  
    5.41  
    5.42  --
    5.43 --- TOC entry 1610 (class 1259 OID 35223)
    5.44 +-- TOC entry 1611 (class 1259 OID 35223)
    5.45  -- Dependencies: 10
    5.46  -- Name: clanek_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
    5.47  --
    5.48 @@ -92,8 +92,8 @@
    5.49  SET default_with_oids = false;
    5.50  
    5.51  --
    5.52 --- TOC entry 1609 (class 1259 OID 35205)
    5.53 --- Dependencies: 1897 10
    5.54 +-- TOC entry 1610 (class 1259 OID 35205)
    5.55 +-- Dependencies: 1899 10
    5.56  -- Name: clanek; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
    5.57  --
    5.58  
    5.59 @@ -107,8 +107,8 @@
    5.60  ALTER TABLE nekurak.clanek OWNER TO nekurak;
    5.61  
    5.62  --
    5.63 --- TOC entry 1945 (class 0 OID 0)
    5.64 --- Dependencies: 1609
    5.65 +-- TOC entry 1949 (class 0 OID 0)
    5.66 +-- Dependencies: 1610
    5.67  -- Name: TABLE clanek; Type: COMMENT; Schema: nekurak; Owner: nekurak
    5.68  --
    5.69  
    5.70 @@ -116,7 +116,7 @@
    5.71  
    5.72  
    5.73  --
    5.74 --- TOC entry 1607 (class 1259 OID 35183)
    5.75 +-- TOC entry 1608 (class 1259 OID 35183)
    5.76  -- Dependencies: 10
    5.77  -- Name: fotka_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
    5.78  --
    5.79 @@ -132,8 +132,8 @@
    5.80  ALTER TABLE nekurak.fotka_seq OWNER TO nekurak;
    5.81  
    5.82  --
    5.83 --- TOC entry 1608 (class 1259 OID 35185)
    5.84 --- Dependencies: 1895 1896 10
    5.85 +-- TOC entry 1609 (class 1259 OID 35185)
    5.86 +-- Dependencies: 1897 1898 10
    5.87  -- Name: fotka; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
    5.88  --
    5.89  
    5.90 @@ -148,8 +148,8 @@
    5.91  ALTER TABLE nekurak.fotka OWNER TO nekurak;
    5.92  
    5.93  --
    5.94 --- TOC entry 1948 (class 0 OID 0)
    5.95 --- Dependencies: 1608
    5.96 +-- TOC entry 1952 (class 0 OID 0)
    5.97 +-- Dependencies: 1609
    5.98  -- Name: TABLE fotka; Type: COMMENT; Schema: nekurak; Owner: nekurak
    5.99  --
   5.100  
   5.101 @@ -157,8 +157,8 @@
   5.102  
   5.103  
   5.104  --
   5.105 --- TOC entry 1949 (class 0 OID 0)
   5.106 --- Dependencies: 1608
   5.107 +-- TOC entry 1953 (class 0 OID 0)
   5.108 +-- Dependencies: 1609
   5.109  -- Name: COLUMN fotka.poradi; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.110  --
   5.111  
   5.112 @@ -166,7 +166,7 @@
   5.113  
   5.114  
   5.115  --
   5.116 --- TOC entry 1612 (class 1259 OID 35250)
   5.117 +-- TOC entry 1613 (class 1259 OID 35250)
   5.118  -- Dependencies: 10
   5.119  -- Name: hlasovani_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
   5.120  --
   5.121 @@ -181,8 +181,8 @@
   5.122  ALTER TABLE nekurak.hlasovani_seq OWNER TO nekurak;
   5.123  
   5.124  --
   5.125 --- TOC entry 1613 (class 1259 OID 35278)
   5.126 --- Dependencies: 1898 1899 10
   5.127 +-- TOC entry 1614 (class 1259 OID 35278)
   5.128 +-- Dependencies: 1900 1901 10
   5.129  -- Name: hlasovani; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.130  --
   5.131  
   5.132 @@ -198,8 +198,8 @@
   5.133  ALTER TABLE nekurak.hlasovani OWNER TO nekurak;
   5.134  
   5.135  --
   5.136 --- TOC entry 1952 (class 0 OID 0)
   5.137 --- Dependencies: 1613
   5.138 +-- TOC entry 1956 (class 0 OID 0)
   5.139 +-- Dependencies: 1614
   5.140  -- Name: COLUMN hlasovani.id; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.141  --
   5.142  
   5.143 @@ -209,8 +209,8 @@
   5.144  
   5.145  
   5.146  --
   5.147 --- TOC entry 1953 (class 0 OID 0)
   5.148 --- Dependencies: 1613
   5.149 +-- TOC entry 1957 (class 0 OID 0)
   5.150 +-- Dependencies: 1614
   5.151  -- Name: COLUMN hlasovani.hlas; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.152  --
   5.153  
   5.154 @@ -220,28 +220,13 @@
   5.155  
   5.156  
   5.157  --
   5.158 --- TOC entry 1616 (class 1259 OID 35396)
   5.159 +-- TOC entry 1617 (class 1259 OID 35398)
   5.160  -- Dependencies: 10
   5.161 --- Name: kategorie_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
   5.162 ---
   5.163 -
   5.164 -CREATE SEQUENCE kategorie_seq
   5.165 -    INCREMENT BY 1
   5.166 -    NO MAXVALUE
   5.167 -    NO MINVALUE
   5.168 -    CACHE 1;
   5.169 -
   5.170 -
   5.171 -ALTER TABLE nekurak.kategorie_seq OWNER TO nekurak;
   5.172 -
   5.173 ---
   5.174 --- TOC entry 1617 (class 1259 OID 35398)
   5.175 --- Dependencies: 1902 10
   5.176  -- Name: kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.177  --
   5.178  
   5.179  CREATE TABLE kategorie (
   5.180 -    id integer DEFAULT nextval('kategorie_seq'::regclass) NOT NULL,
   5.181 +    id integer NOT NULL,
   5.182      nazev character varying(32) NOT NULL
   5.183  );
   5.184  
   5.185 @@ -249,7 +234,7 @@
   5.186  ALTER TABLE nekurak.kategorie OWNER TO nekurak;
   5.187  
   5.188  --
   5.189 --- TOC entry 1956 (class 0 OID 0)
   5.190 +-- TOC entry 1959 (class 0 OID 0)
   5.191  -- Dependencies: 1617
   5.192  -- Name: TABLE kategorie; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.193  --
   5.194 @@ -258,7 +243,7 @@
   5.195  
   5.196  
   5.197  --
   5.198 --- TOC entry 1957 (class 0 OID 0)
   5.199 +-- TOC entry 1960 (class 0 OID 0)
   5.200  -- Dependencies: 1617
   5.201  -- Name: COLUMN kategorie.nazev; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.202  --
   5.203 @@ -268,7 +253,7 @@
   5.204  
   5.205  
   5.206  --
   5.207 --- TOC entry 1614 (class 1259 OID 35333)
   5.208 +-- TOC entry 1615 (class 1259 OID 35333)
   5.209  -- Dependencies: 10
   5.210  -- Name: komentar_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
   5.211  --
   5.212 @@ -283,8 +268,8 @@
   5.213  ALTER TABLE nekurak.komentar_seq OWNER TO nekurak;
   5.214  
   5.215  --
   5.216 --- TOC entry 1615 (class 1259 OID 35376)
   5.217 --- Dependencies: 1900 1901 10
   5.218 +-- TOC entry 1616 (class 1259 OID 35376)
   5.219 +-- Dependencies: 1902 1903 10
   5.220  -- Name: komentar; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.221  --
   5.222  
   5.223 @@ -301,8 +286,8 @@
   5.224  ALTER TABLE nekurak.komentar OWNER TO nekurak;
   5.225  
   5.226  --
   5.227 --- TOC entry 1960 (class 0 OID 0)
   5.228 --- Dependencies: 1615
   5.229 +-- TOC entry 1963 (class 0 OID 0)
   5.230 +-- Dependencies: 1616
   5.231  -- Name: TABLE komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.232  --
   5.233  
   5.234 @@ -310,8 +295,8 @@
   5.235  
   5.236  
   5.237  --
   5.238 --- TOC entry 1961 (class 0 OID 0)
   5.239 --- Dependencies: 1615
   5.240 +-- TOC entry 1964 (class 0 OID 0)
   5.241 +-- Dependencies: 1616
   5.242  -- Name: COLUMN komentar.nadpis; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.243  --
   5.244  
   5.245 @@ -319,8 +304,8 @@
   5.246  
   5.247  
   5.248  --
   5.249 --- TOC entry 1962 (class 0 OID 0)
   5.250 --- Dependencies: 1615
   5.251 +-- TOC entry 1965 (class 0 OID 0)
   5.252 +-- Dependencies: 1616
   5.253  -- Name: COLUMN komentar.komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.254  --
   5.255  
   5.256 @@ -329,7 +314,30 @@
   5.257  
   5.258  
   5.259  --
   5.260 --- TOC entry 1601 (class 1259 OID 35019)
   5.261 +-- TOC entry 1619 (class 1259 OID 35436)
   5.262 +-- Dependencies: 10
   5.263 +-- Name: kurackost; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.264 +--
   5.265 +
   5.266 +CREATE TABLE kurackost (
   5.267 +    id integer NOT NULL,
   5.268 +    popis character varying(64)
   5.269 +);
   5.270 +
   5.271 +
   5.272 +ALTER TABLE nekurak.kurackost OWNER TO nekurak;
   5.273 +
   5.274 +--
   5.275 +-- TOC entry 1967 (class 0 OID 0)
   5.276 +-- Dependencies: 1619
   5.277 +-- Name: TABLE kurackost; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.278 +--
   5.279 +
   5.280 +COMMENT ON TABLE kurackost IS 'Kuřáckost podniku – zda se tu kouří, nekouří, nebo jen částečně atd.';
   5.281 +
   5.282 +
   5.283 +--
   5.284 +-- TOC entry 1602 (class 1259 OID 35019)
   5.285  -- Dependencies: 10
   5.286  -- Name: podnik_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
   5.287  --
   5.288 @@ -344,8 +352,8 @@
   5.289  ALTER TABLE nekurak.podnik_seq OWNER TO nekurak;
   5.290  
   5.291  --
   5.292 --- TOC entry 1602 (class 1259 OID 35049)
   5.293 --- Dependencies: 1890 1891 1892 10
   5.294 +-- TOC entry 1603 (class 1259 OID 35049)
   5.295 +-- Dependencies: 1891 1892 1893 1894 10
   5.296  -- Name: podnik; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.297  --
   5.298  
   5.299 @@ -361,16 +369,16 @@
   5.300      spravce character varying(64),
   5.301      sirka double precision,
   5.302      delka double precision,
   5.303 -    stav character(1),
   5.304 -    CONSTRAINT stav_tg CHECK (((stav = ANY (ARRAY['k'::bpchar, 'n'::bpchar, 'o'::bpchar, 'c'::bpchar])) OR (stav IS NULL)))
   5.305 +    kurackost integer DEFAULT 0 NOT NULL,
   5.306 +    schvaleny boolean DEFAULT false NOT NULL
   5.307  );
   5.308  
   5.309  
   5.310  ALTER TABLE nekurak.podnik OWNER TO nekurak;
   5.311  
   5.312  --
   5.313 --- TOC entry 1965 (class 0 OID 0)
   5.314 --- Dependencies: 1602
   5.315 +-- TOC entry 1970 (class 0 OID 0)
   5.316 +-- Dependencies: 1603
   5.317  -- Name: COLUMN podnik.spravce; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.318  --
   5.319  
   5.320 @@ -378,19 +386,6 @@
   5.321  
   5.322  
   5.323  --
   5.324 --- TOC entry 1966 (class 0 OID 0)
   5.325 --- Dependencies: 1602
   5.326 --- Name: CONSTRAINT stav_tg ON podnik; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.327 ---
   5.328 -
   5.329 -COMMENT ON CONSTRAINT stav_tg ON podnik IS 'k = kuřácký
   5.330 -n = nekuřácký
   5.331 -o = oddělené části (důkladně)
   5.332 -c = částečně kuřácký (špatně oddělené, považujeme za kuřácký)
   5.333 -NULL = neznámý stav';
   5.334 -
   5.335 -
   5.336 ---
   5.337  -- TOC entry 1618 (class 1259 OID 35404)
   5.338  -- Dependencies: 10
   5.339  -- Name: podnik_kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.340 @@ -405,7 +400,7 @@
   5.341  ALTER TABLE nekurak.podnik_kategorie OWNER TO nekurak;
   5.342  
   5.343  --
   5.344 --- TOC entry 1605 (class 1259 OID 35101)
   5.345 +-- TOC entry 1606 (class 1259 OID 35101)
   5.346  -- Dependencies: 10
   5.347  -- Name: role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.348  --
   5.349 @@ -419,8 +414,8 @@
   5.350  ALTER TABLE nekurak.role OWNER TO nekurak;
   5.351  
   5.352  --
   5.353 --- TOC entry 1969 (class 0 OID 0)
   5.354 --- Dependencies: 1605
   5.355 +-- TOC entry 1973 (class 0 OID 0)
   5.356 +-- Dependencies: 1606
   5.357  -- Name: TABLE role; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.358  --
   5.359  
   5.360 @@ -428,7 +423,7 @@
   5.361  
   5.362  
   5.363  --
   5.364 --- TOC entry 1603 (class 1259 OID 35080)
   5.365 +-- TOC entry 1604 (class 1259 OID 35080)
   5.366  -- Dependencies: 10
   5.367  -- Name: uzivatel_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
   5.368  --
   5.369 @@ -443,8 +438,8 @@
   5.370  ALTER TABLE nekurak.uzivatel_seq OWNER TO nekurak;
   5.371  
   5.372  --
   5.373 --- TOC entry 1604 (class 1259 OID 35091)
   5.374 --- Dependencies: 1893 1894 10
   5.375 +-- TOC entry 1605 (class 1259 OID 35091)
   5.376 +-- Dependencies: 1895 1896 10
   5.377  -- Name: uzivatel; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.378  --
   5.379  
   5.380 @@ -462,8 +457,8 @@
   5.381  ALTER TABLE nekurak.uzivatel OWNER TO nekurak;
   5.382  
   5.383  --
   5.384 --- TOC entry 1972 (class 0 OID 0)
   5.385 --- Dependencies: 1604
   5.386 +-- TOC entry 1976 (class 0 OID 0)
   5.387 +-- Dependencies: 1605
   5.388  -- Name: COLUMN uzivatel.prezdivka; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.389  --
   5.390  
   5.391 @@ -471,7 +466,7 @@
   5.392  
   5.393  
   5.394  --
   5.395 --- TOC entry 1606 (class 1259 OID 35106)
   5.396 +-- TOC entry 1607 (class 1259 OID 35106)
   5.397  -- Dependencies: 10
   5.398  -- Name: uzivatel_role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.399  --
   5.400 @@ -485,8 +480,8 @@
   5.401  ALTER TABLE nekurak.uzivatel_role OWNER TO nekurak;
   5.402  
   5.403  --
   5.404 --- TOC entry 1974 (class 0 OID 0)
   5.405 --- Dependencies: 1606
   5.406 +-- TOC entry 1978 (class 0 OID 0)
   5.407 +-- Dependencies: 1607
   5.408  -- Name: TABLE uzivatel_role; Type: COMMENT; Schema: nekurak; Owner: nekurak
   5.409  --
   5.410  
   5.411 @@ -494,8 +489,8 @@
   5.412  
   5.413  
   5.414  --
   5.415 --- TOC entry 1918 (class 2606 OID 35227)
   5.416 --- Dependencies: 1609 1609
   5.417 +-- TOC entry 1919 (class 2606 OID 35227)
   5.418 +-- Dependencies: 1610 1610
   5.419  -- Name: clanek_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.420  --
   5.421  
   5.422 @@ -504,8 +499,8 @@
   5.423  
   5.424  
   5.425  --
   5.426 --- TOC entry 1914 (class 2606 OID 35190)
   5.427 --- Dependencies: 1608 1608
   5.428 +-- TOC entry 1915 (class 2606 OID 35190)
   5.429 +-- Dependencies: 1609 1609
   5.430  -- Name: fotka_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.431  --
   5.432  
   5.433 @@ -514,8 +509,8 @@
   5.434  
   5.435  
   5.436  --
   5.437 --- TOC entry 1916 (class 2606 OID 35204)
   5.438 --- Dependencies: 1608 1608 1608
   5.439 +-- TOC entry 1917 (class 2606 OID 35204)
   5.440 +-- Dependencies: 1609 1609 1609
   5.441  -- Name: fotka_poradi_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.442  --
   5.443  
   5.444 @@ -524,8 +519,8 @@
   5.445  
   5.446  
   5.447  --
   5.448 --- TOC entry 1921 (class 2606 OID 35284)
   5.449 --- Dependencies: 1613 1613
   5.450 +-- TOC entry 1922 (class 2606 OID 35284)
   5.451 +-- Dependencies: 1614 1614
   5.452  -- Name: hlasovani_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.453  --
   5.454  
   5.455 @@ -534,7 +529,7 @@
   5.456  
   5.457  
   5.458  --
   5.459 --- TOC entry 1926 (class 2606 OID 35403)
   5.460 +-- TOC entry 1927 (class 2606 OID 35403)
   5.461  -- Dependencies: 1617 1617
   5.462  -- Name: kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.463  --
   5.464 @@ -544,8 +539,8 @@
   5.465  
   5.466  
   5.467  --
   5.468 --- TOC entry 1924 (class 2606 OID 35385)
   5.469 --- Dependencies: 1615 1615
   5.470 +-- TOC entry 1925 (class 2606 OID 35385)
   5.471 +-- Dependencies: 1616 1616
   5.472  -- Name: komentar_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.473  --
   5.474  
   5.475 @@ -554,7 +549,17 @@
   5.476  
   5.477  
   5.478  --
   5.479 --- TOC entry 1928 (class 2606 OID 35408)
   5.480 +-- TOC entry 1931 (class 2606 OID 35441)
   5.481 +-- Dependencies: 1619 1619
   5.482 +-- Name: kurackost_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.483 +--
   5.484 +
   5.485 +ALTER TABLE ONLY kurackost
   5.486 +    ADD CONSTRAINT kurackost_pk PRIMARY KEY (id);
   5.487 +
   5.488 +
   5.489 +--
   5.490 +-- TOC entry 1929 (class 2606 OID 35408)
   5.491  -- Dependencies: 1618 1618 1618
   5.492  -- Name: podnik_kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.493  --
   5.494 @@ -564,8 +569,8 @@
   5.495  
   5.496  
   5.497  --
   5.498 --- TOC entry 1904 (class 2606 OID 35058)
   5.499 --- Dependencies: 1602 1602
   5.500 +-- TOC entry 1905 (class 2606 OID 35058)
   5.501 +-- Dependencies: 1603 1603
   5.502  -- Name: podnik_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.503  --
   5.504  
   5.505 @@ -574,8 +579,8 @@
   5.506  
   5.507  
   5.508  --
   5.509 --- TOC entry 1910 (class 2606 OID 35105)
   5.510 --- Dependencies: 1605 1605
   5.511 +-- TOC entry 1911 (class 2606 OID 35105)
   5.512 +-- Dependencies: 1606 1606
   5.513  -- Name: skupina_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.514  --
   5.515  
   5.516 @@ -584,8 +589,8 @@
   5.517  
   5.518  
   5.519  --
   5.520 --- TOC entry 1906 (class 2606 OID 35098)
   5.521 --- Dependencies: 1604 1604
   5.522 +-- TOC entry 1907 (class 2606 OID 35098)
   5.523 +-- Dependencies: 1605 1605
   5.524  -- Name: uzivatel_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.525  --
   5.526  
   5.527 @@ -594,8 +599,8 @@
   5.528  
   5.529  
   5.530  --
   5.531 --- TOC entry 1908 (class 2606 OID 35100)
   5.532 --- Dependencies: 1604 1604
   5.533 +-- TOC entry 1909 (class 2606 OID 35100)
   5.534 +-- Dependencies: 1605 1605
   5.535  -- Name: uzivatel_prezdivka_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.536  --
   5.537  
   5.538 @@ -604,8 +609,8 @@
   5.539  
   5.540  
   5.541  --
   5.542 --- TOC entry 1912 (class 2606 OID 35137)
   5.543 --- Dependencies: 1606 1606 1606
   5.544 +-- TOC entry 1913 (class 2606 OID 35137)
   5.545 +-- Dependencies: 1607 1607 1607
   5.546  -- Name: uzivatel_role_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.547  --
   5.548  
   5.549 @@ -614,8 +619,8 @@
   5.550  
   5.551  
   5.552  --
   5.553 --- TOC entry 1919 (class 1259 OID 35291)
   5.554 --- Dependencies: 1613
   5.555 +-- TOC entry 1920 (class 1259 OID 35291)
   5.556 +-- Dependencies: 1614
   5.557  -- Name: hlasovani_ip_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.558  --
   5.559  
   5.560 @@ -623,8 +628,8 @@
   5.561  
   5.562  
   5.563  --
   5.564 --- TOC entry 1922 (class 1259 OID 35309)
   5.565 --- Dependencies: 1613
   5.566 +-- TOC entry 1923 (class 1259 OID 35309)
   5.567 +-- Dependencies: 1614
   5.568  -- Name: hlsovani_datum_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: 
   5.569  --
   5.570  
   5.571 @@ -632,8 +637,8 @@
   5.572  
   5.573  
   5.574  --
   5.575 --- TOC entry 1938 (class 2620 OID 35125)
   5.576 --- Dependencies: 1604 65
   5.577 +-- TOC entry 1942 (class 2620 OID 35125)
   5.578 +-- Dependencies: 65 1605
   5.579  -- Name: uzivatel_insert; Type: TRIGGER; Schema: nekurak; Owner: nekurak
   5.580  --
   5.581  
   5.582 @@ -644,8 +649,8 @@
   5.583  
   5.584  
   5.585  --
   5.586 --- TOC entry 1932 (class 2606 OID 35191)
   5.587 --- Dependencies: 1903 1608 1602
   5.588 +-- TOC entry 1936 (class 2606 OID 35191)
   5.589 +-- Dependencies: 1904 1603 1609
   5.590  -- Name: fotka_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.591  --
   5.592  
   5.593 @@ -654,8 +659,8 @@
   5.594  
   5.595  
   5.596  --
   5.597 --- TOC entry 1933 (class 2606 OID 35285)
   5.598 --- Dependencies: 1903 1602 1613
   5.599 +-- TOC entry 1937 (class 2606 OID 35285)
   5.600 +-- Dependencies: 1614 1603 1904
   5.601  -- Name: hlasovani_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.602  --
   5.603  
   5.604 @@ -664,8 +669,8 @@
   5.605  
   5.606  
   5.607  --
   5.608 --- TOC entry 1934 (class 2606 OID 35386)
   5.609 --- Dependencies: 1615 1602 1903
   5.610 +-- TOC entry 1938 (class 2606 OID 35386)
   5.611 +-- Dependencies: 1904 1603 1616
   5.612  -- Name: komentar_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.613  --
   5.614  
   5.615 @@ -674,8 +679,8 @@
   5.616  
   5.617  
   5.618  --
   5.619 --- TOC entry 1935 (class 2606 OID 35391)
   5.620 --- Dependencies: 1907 1604 1615
   5.621 +-- TOC entry 1939 (class 2606 OID 35391)
   5.622 +-- Dependencies: 1616 1908 1605
   5.623  -- Name: komentar_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.624  --
   5.625  
   5.626 @@ -684,8 +689,8 @@
   5.627  
   5.628  
   5.629  --
   5.630 --- TOC entry 1937 (class 2606 OID 35414)
   5.631 --- Dependencies: 1618 1925 1617
   5.632 +-- TOC entry 1941 (class 2606 OID 35414)
   5.633 +-- Dependencies: 1926 1617 1618
   5.634  -- Name: podnik_kategorie_kategorie_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.635  --
   5.636  
   5.637 @@ -694,8 +699,8 @@
   5.638  
   5.639  
   5.640  --
   5.641 --- TOC entry 1936 (class 2606 OID 35409)
   5.642 --- Dependencies: 1903 1602 1618
   5.643 +-- TOC entry 1940 (class 2606 OID 35409)
   5.644 +-- Dependencies: 1603 1618 1904
   5.645  -- Name: podnik_kategorie_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.646  --
   5.647  
   5.648 @@ -704,8 +709,18 @@
   5.649  
   5.650  
   5.651  --
   5.652 --- TOC entry 1929 (class 2606 OID 35178)
   5.653 --- Dependencies: 1602 1604 1907
   5.654 +-- TOC entry 1933 (class 2606 OID 35458)
   5.655 +-- Dependencies: 1603 1619 1930
   5.656 +-- Name: podnik_kurackost_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.657 +--
   5.658 +
   5.659 +ALTER TABLE ONLY podnik
   5.660 +    ADD CONSTRAINT podnik_kurackost_fk FOREIGN KEY (kurackost) REFERENCES kurackost(id);
   5.661 +
   5.662 +
   5.663 +--
   5.664 +-- TOC entry 1932 (class 2606 OID 35178)
   5.665 +-- Dependencies: 1603 1605 1908
   5.666  -- Name: podnik_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.667  --
   5.668  
   5.669 @@ -714,8 +729,8 @@
   5.670  
   5.671  
   5.672  --
   5.673 --- TOC entry 1930 (class 2606 OID 35138)
   5.674 --- Dependencies: 1909 1606 1605
   5.675 +-- TOC entry 1934 (class 2606 OID 35138)
   5.676 +-- Dependencies: 1607 1910 1606
   5.677  -- Name: uzivatel_role_role_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.678  --
   5.679  
   5.680 @@ -724,8 +739,8 @@
   5.681  
   5.682  
   5.683  --
   5.684 --- TOC entry 1931 (class 2606 OID 35143)
   5.685 --- Dependencies: 1907 1604 1606
   5.686 +-- TOC entry 1935 (class 2606 OID 35143)
   5.687 +-- Dependencies: 1605 1607 1908
   5.688  -- Name: uzivatel_role_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
   5.689  --
   5.690  
   5.691 @@ -734,7 +749,7 @@
   5.692  
   5.693  
   5.694  --
   5.695 --- TOC entry 1941 (class 0 OID 0)
   5.696 +-- TOC entry 1945 (class 0 OID 0)
   5.697  -- Dependencies: 10
   5.698  -- Name: nekurak; Type: ACL; Schema: -; Owner: nekurak
   5.699  --
   5.700 @@ -746,8 +761,8 @@
   5.701  
   5.702  
   5.703  --
   5.704 --- TOC entry 1944 (class 0 OID 0)
   5.705 --- Dependencies: 1610
   5.706 +-- TOC entry 1948 (class 0 OID 0)
   5.707 +-- Dependencies: 1611
   5.708  -- Name: clanek_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   5.709  --
   5.710  
   5.711 @@ -758,8 +773,8 @@
   5.712  
   5.713  
   5.714  --
   5.715 --- TOC entry 1946 (class 0 OID 0)
   5.716 --- Dependencies: 1609
   5.717 +-- TOC entry 1950 (class 0 OID 0)
   5.718 +-- Dependencies: 1610
   5.719  -- Name: clanek; Type: ACL; Schema: nekurak; Owner: nekurak
   5.720  --
   5.721  
   5.722 @@ -770,8 +785,8 @@
   5.723  
   5.724  
   5.725  --
   5.726 --- TOC entry 1947 (class 0 OID 0)
   5.727 --- Dependencies: 1607
   5.728 +-- TOC entry 1951 (class 0 OID 0)
   5.729 +-- Dependencies: 1608
   5.730  -- Name: fotka_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   5.731  --
   5.732  
   5.733 @@ -782,8 +797,8 @@
   5.734  
   5.735  
   5.736  --
   5.737 --- TOC entry 1950 (class 0 OID 0)
   5.738 --- Dependencies: 1608
   5.739 +-- TOC entry 1954 (class 0 OID 0)
   5.740 +-- Dependencies: 1609
   5.741  -- Name: fotka; Type: ACL; Schema: nekurak; Owner: nekurak
   5.742  --
   5.743  
   5.744 @@ -794,8 +809,8 @@
   5.745  
   5.746  
   5.747  --
   5.748 --- TOC entry 1951 (class 0 OID 0)
   5.749 --- Dependencies: 1612
   5.750 +-- TOC entry 1955 (class 0 OID 0)
   5.751 +-- Dependencies: 1613
   5.752  -- Name: hlasovani_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   5.753  --
   5.754  
   5.755 @@ -806,8 +821,8 @@
   5.756  
   5.757  
   5.758  --
   5.759 --- TOC entry 1954 (class 0 OID 0)
   5.760 --- Dependencies: 1613
   5.761 +-- TOC entry 1958 (class 0 OID 0)
   5.762 +-- Dependencies: 1614
   5.763  -- Name: hlasovani; Type: ACL; Schema: nekurak; Owner: nekurak
   5.764  --
   5.765  
   5.766 @@ -818,19 +833,7 @@
   5.767  
   5.768  
   5.769  --
   5.770 --- TOC entry 1955 (class 0 OID 0)
   5.771 --- Dependencies: 1616
   5.772 --- Name: kategorie_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   5.773 ---
   5.774 -
   5.775 -REVOKE ALL ON SEQUENCE kategorie_seq FROM PUBLIC;
   5.776 -REVOKE ALL ON SEQUENCE kategorie_seq FROM nekurak;
   5.777 -GRANT ALL ON SEQUENCE kategorie_seq TO nekurak;
   5.778 -GRANT USAGE ON SEQUENCE kategorie_seq TO nekurak_web;
   5.779 -
   5.780 -
   5.781 ---
   5.782 --- TOC entry 1958 (class 0 OID 0)
   5.783 +-- TOC entry 1961 (class 0 OID 0)
   5.784  -- Dependencies: 1617
   5.785  -- Name: kategorie; Type: ACL; Schema: nekurak; Owner: nekurak
   5.786  --
   5.787 @@ -838,12 +841,12 @@
   5.788  REVOKE ALL ON TABLE kategorie FROM PUBLIC;
   5.789  REVOKE ALL ON TABLE kategorie FROM nekurak;
   5.790  GRANT ALL ON TABLE kategorie TO nekurak;
   5.791 -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE kategorie TO nekurak_web;
   5.792 +GRANT SELECT ON TABLE kategorie TO nekurak_web;
   5.793  
   5.794  
   5.795  --
   5.796 --- TOC entry 1959 (class 0 OID 0)
   5.797 --- Dependencies: 1614
   5.798 +-- TOC entry 1962 (class 0 OID 0)
   5.799 +-- Dependencies: 1615
   5.800  -- Name: komentar_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   5.801  --
   5.802  
   5.803 @@ -854,8 +857,8 @@
   5.804  
   5.805  
   5.806  --
   5.807 --- TOC entry 1963 (class 0 OID 0)
   5.808 --- Dependencies: 1615
   5.809 +-- TOC entry 1966 (class 0 OID 0)
   5.810 +-- Dependencies: 1616
   5.811  -- Name: komentar; Type: ACL; Schema: nekurak; Owner: nekurak
   5.812  --
   5.813  
   5.814 @@ -866,8 +869,20 @@
   5.815  
   5.816  
   5.817  --
   5.818 --- TOC entry 1964 (class 0 OID 0)
   5.819 --- Dependencies: 1601
   5.820 +-- TOC entry 1968 (class 0 OID 0)
   5.821 +-- Dependencies: 1619
   5.822 +-- Name: kurackost; Type: ACL; Schema: nekurak; Owner: nekurak
   5.823 +--
   5.824 +
   5.825 +REVOKE ALL ON TABLE kurackost FROM PUBLIC;
   5.826 +REVOKE ALL ON TABLE kurackost FROM nekurak;
   5.827 +GRANT ALL ON TABLE kurackost TO nekurak;
   5.828 +GRANT SELECT ON TABLE kurackost TO nekurak_web;
   5.829 +
   5.830 +
   5.831 +--
   5.832 +-- TOC entry 1969 (class 0 OID 0)
   5.833 +-- Dependencies: 1602
   5.834  -- Name: podnik_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   5.835  --
   5.836  
   5.837 @@ -878,8 +893,8 @@
   5.838  
   5.839  
   5.840  --
   5.841 --- TOC entry 1967 (class 0 OID 0)
   5.842 --- Dependencies: 1602
   5.843 +-- TOC entry 1971 (class 0 OID 0)
   5.844 +-- Dependencies: 1603
   5.845  -- Name: podnik; Type: ACL; Schema: nekurak; Owner: nekurak
   5.846  --
   5.847  
   5.848 @@ -890,7 +905,7 @@
   5.849  
   5.850  
   5.851  --
   5.852 --- TOC entry 1968 (class 0 OID 0)
   5.853 +-- TOC entry 1972 (class 0 OID 0)
   5.854  -- Dependencies: 1618
   5.855  -- Name: podnik_kategorie; Type: ACL; Schema: nekurak; Owner: nekurak
   5.856  --
   5.857 @@ -902,8 +917,8 @@
   5.858  
   5.859  
   5.860  --
   5.861 --- TOC entry 1970 (class 0 OID 0)
   5.862 --- Dependencies: 1605
   5.863 +-- TOC entry 1974 (class 0 OID 0)
   5.864 +-- Dependencies: 1606
   5.865  -- Name: role; Type: ACL; Schema: nekurak; Owner: nekurak
   5.866  --
   5.867  
   5.868 @@ -914,8 +929,8 @@
   5.869  
   5.870  
   5.871  --
   5.872 --- TOC entry 1971 (class 0 OID 0)
   5.873 --- Dependencies: 1603
   5.874 +-- TOC entry 1975 (class 0 OID 0)
   5.875 +-- Dependencies: 1604
   5.876  -- Name: uzivatel_seq; Type: ACL; Schema: nekurak; Owner: nekurak
   5.877  --
   5.878  
   5.879 @@ -926,8 +941,8 @@
   5.880  
   5.881  
   5.882  --
   5.883 --- TOC entry 1973 (class 0 OID 0)
   5.884 --- Dependencies: 1604
   5.885 +-- TOC entry 1977 (class 0 OID 0)
   5.886 +-- Dependencies: 1605
   5.887  -- Name: uzivatel; Type: ACL; Schema: nekurak; Owner: nekurak
   5.888  --
   5.889  
   5.890 @@ -938,8 +953,8 @@
   5.891  
   5.892  
   5.893  --
   5.894 --- TOC entry 1975 (class 0 OID 0)
   5.895 --- Dependencies: 1606
   5.896 +-- TOC entry 1979 (class 0 OID 0)
   5.897 +-- Dependencies: 1607
   5.898  -- Name: uzivatel_role; Type: ACL; Schema: nekurak; Owner: nekurak
   5.899  --
   5.900  
   5.901 @@ -949,7 +964,7 @@
   5.902  GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel_role TO nekurak_web;
   5.903  
   5.904  
   5.905 --- Completed on 2011-01-11 15:26:23 CET
   5.906 +-- Completed on 2011-01-15 14:24:31 CET
   5.907  
   5.908  --
   5.909  -- PostgreSQL database dump complete