sql/schéma.sql
author František Kučera <franta-hg@frantovo.cz>
Tue Jul 19 15:22:15 2011 +0200 (2011-07-19)
changeset 188 74d06a8a4948
parent 163 5f0d5e1305b3
permissions -rw-r--r--
Velká čistka – zjednodušení – odstraněno: REST, WS, Chat
(části, které sloužily jako ilustrace k článku / výukové účely)
franta-hg@18
     1
--
franta-hg@18
     2
-- PostgreSQL database dump
franta-hg@18
     3
--
franta-hg@18
     4
franta-hg@173
     5
-- Started on 2011-01-15 14:24:29 CET
franta-hg@18
     6
franta-hg@18
     7
SET statement_timeout = 0;
franta-hg@18
     8
SET client_encoding = 'UTF8';
franta-hg@18
     9
SET standard_conforming_strings = off;
franta-hg@18
    10
SET check_function_bodies = false;
franta-hg@18
    11
SET client_min_messages = warning;
franta-hg@18
    12
SET escape_string_warning = off;
franta-hg@18
    13
franta-hg@18
    14
--
franta-hg@18
    15
-- TOC entry 10 (class 2615 OID 35015)
franta-hg@18
    16
-- Name: nekurak; Type: SCHEMA; Schema: -; Owner: nekurak
franta-hg@18
    17
--
franta-hg@18
    18
franta-hg@18
    19
CREATE SCHEMA nekurak;
franta-hg@18
    20
franta-hg@18
    21
franta-hg@18
    22
ALTER SCHEMA nekurak OWNER TO nekurak;
franta-hg@18
    23
franta-hg@18
    24
SET search_path = nekurak, pg_catalog;
franta-hg@18
    25
franta-hg@18
    26
--
franta-hg@115
    27
-- TOC entry 366 (class 1247 OID 35086)
franta-hg@115
    28
-- Dependencies: 367 10
franta-hg@62
    29
-- Name: email; Type: DOMAIN; Schema: nekurak; Owner: nekurak
franta-hg@62
    30
--
franta-hg@62
    31
franta-hg@62
    32
CREATE DOMAIN email AS character varying(255)
franta-hg@62
    33
	CONSTRAINT email_regexp CHECK (((VALUE)::text ~ '^[_a-zA-Z0-9\\.\\-]+@[_a-zA-Z0-9\\.\\-]+\\.[a-zA-Z]{2,4}$'::text));
franta-hg@62
    34
franta-hg@62
    35
franta-hg@62
    36
ALTER DOMAIN nekurak.email OWNER TO nekurak;
franta-hg@62
    37
franta-hg@62
    38
--
franta-hg@173
    39
-- TOC entry 1946 (class 0 OID 0)
franta-hg@115
    40
-- Dependencies: 366
franta-hg@62
    41
-- Name: DOMAIN email; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
    42
--
franta-hg@62
    43
franta-hg@62
    44
COMMENT ON DOMAIN email IS 'e-mailová adresa';
franta-hg@62
    45
franta-hg@62
    46
franta-hg@62
    47
--
franta-hg@62
    48
-- TOC entry 65 (class 1255 OID 35124)
franta-hg@173
    49
-- Dependencies: 412 10
franta-hg@62
    50
-- Name: bezny_uzivatel(); Type: FUNCTION; Schema: nekurak; Owner: nekurak
franta-hg@62
    51
--
franta-hg@62
    52
franta-hg@62
    53
CREATE FUNCTION bezny_uzivatel() RETURNS trigger
franta-hg@62
    54
    LANGUAGE plpgsql
franta-hg@62
    55
    AS $$BEGIN
franta-hg@62
    56
INSERT INTO uzivatel_role 
franta-hg@62
    57
(role, prezdivka) 
franta-hg@62
    58
VALUES
franta-hg@62
    59
('bezny', new.prezdivka);
franta-hg@62
    60
RETURN new;
franta-hg@62
    61
END;$$;
franta-hg@62
    62
franta-hg@62
    63
franta-hg@62
    64
ALTER FUNCTION nekurak.bezny_uzivatel() OWNER TO nekurak;
franta-hg@62
    65
franta-hg@62
    66
--
franta-hg@173
    67
-- TOC entry 1947 (class 0 OID 0)
franta-hg@62
    68
-- Dependencies: 65
franta-hg@62
    69
-- Name: FUNCTION bezny_uzivatel(); Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
    70
--
franta-hg@62
    71
franta-hg@62
    72
COMMENT ON FUNCTION bezny_uzivatel() IS 'Každému novému uživateli dáme automaticky roli „bezny“.';
franta-hg@62
    73
franta-hg@62
    74
franta-hg@71
    75
--
franta-hg@173
    76
-- TOC entry 1611 (class 1259 OID 35223)
franta-hg@115
    77
-- Dependencies: 10
franta-hg@115
    78
-- Name: clanek_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@115
    79
--
franta-hg@115
    80
franta-hg@115
    81
CREATE SEQUENCE clanek_seq
franta-hg@115
    82
    INCREMENT BY 1
franta-hg@115
    83
    NO MAXVALUE
franta-hg@115
    84
    NO MINVALUE
franta-hg@115
    85
    CACHE 1;
franta-hg@115
    86
franta-hg@115
    87
franta-hg@115
    88
ALTER TABLE nekurak.clanek_seq OWNER TO nekurak;
franta-hg@115
    89
franta-hg@115
    90
SET default_tablespace = '';
franta-hg@115
    91
franta-hg@115
    92
SET default_with_oids = false;
franta-hg@115
    93
franta-hg@115
    94
--
franta-hg@173
    95
-- TOC entry 1610 (class 1259 OID 35205)
franta-hg@173
    96
-- Dependencies: 1899 10
franta-hg@115
    97
-- Name: clanek; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@115
    98
--
franta-hg@115
    99
franta-hg@115
   100
CREATE TABLE clanek (
franta-hg@115
   101
    id integer DEFAULT nextval('clanek_seq'::regclass) NOT NULL,
franta-hg@115
   102
    nadpis character varying(255) NOT NULL,
franta-hg@115
   103
    text text
franta-hg@115
   104
);
franta-hg@115
   105
franta-hg@115
   106
franta-hg@115
   107
ALTER TABLE nekurak.clanek OWNER TO nekurak;
franta-hg@115
   108
franta-hg@115
   109
--
franta-hg@173
   110
-- TOC entry 1949 (class 0 OID 0)
franta-hg@173
   111
-- Dependencies: 1610
franta-hg@115
   112
-- Name: TABLE clanek; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@115
   113
--
franta-hg@115
   114
franta-hg@154
   115
COMMENT ON TABLE clanek IS 'Článek potažmo stránka – nějaký textový obsah (XHTML).';
franta-hg@115
   116
franta-hg@115
   117
franta-hg@115
   118
--
franta-hg@173
   119
-- TOC entry 1608 (class 1259 OID 35183)
franta-hg@71
   120
-- Dependencies: 10
franta-hg@71
   121
-- Name: fotka_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@71
   122
--
franta-hg@71
   123
franta-hg@71
   124
CREATE SEQUENCE fotka_seq
franta-hg@71
   125
    START WITH 1
franta-hg@71
   126
    INCREMENT BY 1
franta-hg@71
   127
    NO MAXVALUE
franta-hg@71
   128
    NO MINVALUE
franta-hg@71
   129
    CACHE 1;
franta-hg@71
   130
franta-hg@71
   131
franta-hg@71
   132
ALTER TABLE nekurak.fotka_seq OWNER TO nekurak;
franta-hg@71
   133
franta-hg@71
   134
--
franta-hg@173
   135
-- TOC entry 1609 (class 1259 OID 35185)
franta-hg@173
   136
-- Dependencies: 1897 1898 10
franta-hg@71
   137
-- Name: fotka; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@71
   138
--
franta-hg@71
   139
franta-hg@71
   140
CREATE TABLE fotka (
franta-hg@71
   141
    id integer DEFAULT nextval('fotka_seq'::regclass) NOT NULL,
franta-hg@71
   142
    podnik integer NOT NULL,
franta-hg@71
   143
    popis character varying(255),
franta-hg@71
   144
    poradi integer DEFAULT 0 NOT NULL
franta-hg@71
   145
);
franta-hg@71
   146
franta-hg@71
   147
franta-hg@71
   148
ALTER TABLE nekurak.fotka OWNER TO nekurak;
franta-hg@71
   149
franta-hg@71
   150
--
franta-hg@173
   151
-- TOC entry 1952 (class 0 OID 0)
franta-hg@173
   152
-- Dependencies: 1609
franta-hg@71
   153
-- Name: TABLE fotka; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@71
   154
--
franta-hg@71
   155
franta-hg@71
   156
COMMENT ON TABLE fotka IS 'Fotka podniku.';
franta-hg@71
   157
franta-hg@71
   158
franta-hg@71
   159
--
franta-hg@173
   160
-- TOC entry 1953 (class 0 OID 0)
franta-hg@173
   161
-- Dependencies: 1609
franta-hg@71
   162
-- Name: COLUMN fotka.poradi; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@71
   163
--
franta-hg@71
   164
franta-hg@71
   165
COMMENT ON COLUMN fotka.poradi IS 'Pořadí fotky v rámci daného podniku.';
franta-hg@71
   166
franta-hg@71
   167
franta-hg@115
   168
--
franta-hg@173
   169
-- TOC entry 1613 (class 1259 OID 35250)
franta-hg@115
   170
-- Dependencies: 10
franta-hg@115
   171
-- Name: hlasovani_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@115
   172
--
franta-hg@115
   173
franta-hg@115
   174
CREATE SEQUENCE hlasovani_seq
franta-hg@115
   175
    INCREMENT BY 1
franta-hg@115
   176
    NO MAXVALUE
franta-hg@115
   177
    NO MINVALUE
franta-hg@115
   178
    CACHE 1;
franta-hg@115
   179
franta-hg@115
   180
franta-hg@115
   181
ALTER TABLE nekurak.hlasovani_seq OWNER TO nekurak;
franta-hg@62
   182
franta-hg@62
   183
--
franta-hg@173
   184
-- TOC entry 1614 (class 1259 OID 35278)
franta-hg@173
   185
-- Dependencies: 1900 1901 10
franta-hg@62
   186
-- Name: hlasovani; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   187
--
franta-hg@62
   188
franta-hg@62
   189
CREATE TABLE hlasovani (
franta-hg@115
   190
    id integer DEFAULT nextval('hlasovani_seq'::regclass) NOT NULL,
franta-hg@62
   191
    podnik integer NOT NULL,
franta-hg@62
   192
    hlas boolean NOT NULL,
franta-hg@118
   193
    datum timestamp without time zone DEFAULT now() NOT NULL,
franta-hg@115
   194
    ip_adresa character varying(255) NOT NULL
franta-hg@62
   195
);
franta-hg@62
   196
franta-hg@62
   197
franta-hg@62
   198
ALTER TABLE nekurak.hlasovani OWNER TO nekurak;
franta-hg@62
   199
franta-hg@62
   200
--
franta-hg@173
   201
-- TOC entry 1956 (class 0 OID 0)
franta-hg@173
   202
-- Dependencies: 1614
franta-hg@115
   203
-- Name: COLUMN hlasovani.id; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@115
   204
--
franta-hg@115
   205
franta-hg@115
   206
COMMENT ON COLUMN hlasovani.id IS 'V této tabulce v princupu ID nepotřebujeme,
franta-hg@115
   207
protože nebudeme adresovat konkrétní záznamy (a i kdyby, můžeme použít OID).
franta-hg@115
   208
Ale číselné ID se nám bude hodit pro rychlejší nalezení posledního hlasu od dané IP adresy.';
franta-hg@115
   209
franta-hg@115
   210
franta-hg@115
   211
--
franta-hg@173
   212
-- TOC entry 1957 (class 0 OID 0)
franta-hg@173
   213
-- Dependencies: 1614
franta-hg@62
   214
-- Name: COLUMN hlasovani.hlas; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
   215
--
franta-hg@62
   216
franta-hg@62
   217
COMMENT ON COLUMN hlasovani.hlas IS 'Má být tento podnik nekuřácký?
franta-hg@62
   218
true = nekuřácký
franta-hg@62
   219
false = kouření povoleno';
franta-hg@62
   220
franta-hg@62
   221
franta-hg@62
   222
--
franta-hg@173
   223
-- TOC entry 1617 (class 1259 OID 35398)
franta-hg@154
   224
-- Dependencies: 10
franta-hg@154
   225
-- Name: kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   226
--
franta-hg@154
   227
franta-hg@154
   228
CREATE TABLE kategorie (
franta-hg@173
   229
    id integer NOT NULL,
franta-hg@163
   230
    nazev character varying(32) NOT NULL
franta-hg@154
   231
);
franta-hg@154
   232
franta-hg@154
   233
franta-hg@154
   234
ALTER TABLE nekurak.kategorie OWNER TO nekurak;
franta-hg@154
   235
franta-hg@154
   236
--
franta-hg@173
   237
-- TOC entry 1959 (class 0 OID 0)
franta-hg@154
   238
-- Dependencies: 1617
franta-hg@154
   239
-- Name: TABLE kategorie; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@154
   240
--
franta-hg@154
   241
franta-hg@154
   242
COMMENT ON TABLE kategorie IS 'Kategorie podniku';
franta-hg@154
   243
franta-hg@154
   244
franta-hg@154
   245
--
franta-hg@173
   246
-- TOC entry 1960 (class 0 OID 0)
franta-hg@163
   247
-- Dependencies: 1617
franta-hg@163
   248
-- Name: COLUMN kategorie.nazev; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@163
   249
--
franta-hg@163
   250
franta-hg@163
   251
COMMENT ON COLUMN kategorie.nazev IS 'jen pro info při přímé práci s SQL
franta-hg@163
   252
aplikace bere názvy a popisy kategorií z lokalizačního souboru (na základě ID kategorie)';
franta-hg@163
   253
franta-hg@163
   254
franta-hg@163
   255
--
franta-hg@173
   256
-- TOC entry 1615 (class 1259 OID 35333)
franta-hg@137
   257
-- Dependencies: 10
franta-hg@137
   258
-- Name: komentar_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@137
   259
--
franta-hg@137
   260
franta-hg@137
   261
CREATE SEQUENCE komentar_seq
franta-hg@137
   262
    INCREMENT BY 1
franta-hg@137
   263
    NO MAXVALUE
franta-hg@137
   264
    NO MINVALUE
franta-hg@137
   265
    CACHE 1;
franta-hg@137
   266
franta-hg@137
   267
franta-hg@137
   268
ALTER TABLE nekurak.komentar_seq OWNER TO nekurak;
franta-hg@137
   269
franta-hg@137
   270
--
franta-hg@173
   271
-- TOC entry 1616 (class 1259 OID 35376)
franta-hg@173
   272
-- Dependencies: 1902 1903 10
franta-hg@137
   273
-- Name: komentar; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@137
   274
--
franta-hg@137
   275
franta-hg@137
   276
CREATE TABLE komentar (
franta-hg@137
   277
    id integer DEFAULT nextval('komentar_seq'::regclass) NOT NULL,
franta-hg@137
   278
    podnik integer NOT NULL,
franta-hg@137
   279
    uzivatel character varying(64) NOT NULL,
franta-hg@137
   280
    datum timestamp with time zone DEFAULT now() NOT NULL,
franta-hg@137
   281
    nadpis character varying(255),
franta-hg@137
   282
    komentar text NOT NULL
franta-hg@137
   283
);
franta-hg@137
   284
franta-hg@137
   285
franta-hg@137
   286
ALTER TABLE nekurak.komentar OWNER TO nekurak;
franta-hg@137
   287
franta-hg@137
   288
--
franta-hg@173
   289
-- TOC entry 1963 (class 0 OID 0)
franta-hg@173
   290
-- Dependencies: 1616
franta-hg@137
   291
-- Name: TABLE komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@137
   292
--
franta-hg@137
   293
franta-hg@137
   294
COMMENT ON TABLE komentar IS 'Komentář k podniku';
franta-hg@137
   295
franta-hg@137
   296
franta-hg@137
   297
--
franta-hg@173
   298
-- TOC entry 1964 (class 0 OID 0)
franta-hg@173
   299
-- Dependencies: 1616
franta-hg@137
   300
-- Name: COLUMN komentar.nadpis; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@137
   301
--
franta-hg@137
   302
franta-hg@137
   303
COMMENT ON COLUMN komentar.nadpis IS 'vždy jen prostý text';
franta-hg@137
   304
franta-hg@137
   305
franta-hg@137
   306
--
franta-hg@173
   307
-- TOC entry 1965 (class 0 OID 0)
franta-hg@173
   308
-- Dependencies: 1616
franta-hg@137
   309
-- Name: COLUMN komentar.komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@137
   310
--
franta-hg@137
   311
franta-hg@137
   312
COMMENT ON COLUMN komentar.komentar IS 'Vlastní komentář. Vždy jen XHTML – převádíme na něj jak prostý text, tak Texy nebo cokoli jiného.
franta-hg@137
   313
Jedná se o kus validního XML – má kořenový element <div/>';
franta-hg@137
   314
franta-hg@137
   315
franta-hg@137
   316
--
franta-hg@173
   317
-- TOC entry 1619 (class 1259 OID 35436)
franta-hg@173
   318
-- Dependencies: 10
franta-hg@173
   319
-- Name: kurackost; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@173
   320
--
franta-hg@173
   321
franta-hg@173
   322
CREATE TABLE kurackost (
franta-hg@173
   323
    id integer NOT NULL,
franta-hg@173
   324
    popis character varying(64)
franta-hg@173
   325
);
franta-hg@173
   326
franta-hg@173
   327
franta-hg@173
   328
ALTER TABLE nekurak.kurackost OWNER TO nekurak;
franta-hg@173
   329
franta-hg@173
   330
--
franta-hg@173
   331
-- TOC entry 1967 (class 0 OID 0)
franta-hg@173
   332
-- Dependencies: 1619
franta-hg@173
   333
-- Name: TABLE kurackost; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@173
   334
--
franta-hg@173
   335
franta-hg@173
   336
COMMENT ON TABLE kurackost IS 'Kuřáckost podniku – zda se tu kouří, nekouří, nebo jen částečně atd.';
franta-hg@173
   337
franta-hg@173
   338
franta-hg@173
   339
--
franta-hg@173
   340
-- TOC entry 1602 (class 1259 OID 35019)
franta-hg@18
   341
-- Dependencies: 10
franta-hg@18
   342
-- Name: podnik_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@18
   343
--
franta-hg@18
   344
franta-hg@18
   345
CREATE SEQUENCE podnik_seq
franta-hg@18
   346
    INCREMENT BY 1
franta-hg@18
   347
    NO MAXVALUE
franta-hg@18
   348
    NO MINVALUE
franta-hg@18
   349
    CACHE 1;
franta-hg@18
   350
franta-hg@18
   351
franta-hg@18
   352
ALTER TABLE nekurak.podnik_seq OWNER TO nekurak;
franta-hg@18
   353
franta-hg@18
   354
--
franta-hg@173
   355
-- TOC entry 1603 (class 1259 OID 35049)
franta-hg@173
   356
-- Dependencies: 1891 1892 1893 1894 10
franta-hg@18
   357
-- Name: podnik; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@18
   358
--
franta-hg@18
   359
franta-hg@18
   360
CREATE TABLE podnik (
franta-hg@18
   361
    id integer DEFAULT nextval('podnik_seq'::regclass) NOT NULL,
franta-hg@18
   362
    nazev character varying(255) NOT NULL,
franta-hg@62
   363
    popis character varying(255),
franta-hg@62
   364
    url character varying(255),
franta-hg@62
   365
    datum timestamp with time zone DEFAULT now(),
franta-hg@62
   366
    ulice character varying(64),
franta-hg@62
   367
    cislo_popisne integer,
franta-hg@71
   368
    mesto character varying(64),
franta-hg@115
   369
    spravce character varying(64),
franta-hg@115
   370
    sirka double precision,
franta-hg@163
   371
    delka double precision,
franta-hg@173
   372
    kurackost integer DEFAULT 0 NOT NULL,
franta-hg@173
   373
    schvaleny boolean DEFAULT false NOT NULL
franta-hg@18
   374
);
franta-hg@18
   375
franta-hg@18
   376
franta-hg@18
   377
ALTER TABLE nekurak.podnik OWNER TO nekurak;
franta-hg@18
   378
franta-hg@18
   379
--
franta-hg@173
   380
-- TOC entry 1970 (class 0 OID 0)
franta-hg@173
   381
-- Dependencies: 1603
franta-hg@71
   382
-- Name: COLUMN podnik.spravce; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@71
   383
--
franta-hg@71
   384
franta-hg@71
   385
COMMENT ON COLUMN podnik.spravce IS 'Přezdívka uživatele, který je správcem tohoto podniku (zadal ho do systému nebo správcovství později dostal)';
franta-hg@71
   386
franta-hg@71
   387
franta-hg@71
   388
--
franta-hg@154
   389
-- TOC entry 1618 (class 1259 OID 35404)
franta-hg@154
   390
-- Dependencies: 10
franta-hg@154
   391
-- Name: podnik_kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   392
--
franta-hg@154
   393
franta-hg@154
   394
CREATE TABLE podnik_kategorie (
franta-hg@154
   395
    podnik integer NOT NULL,
franta-hg@154
   396
    kategorie integer NOT NULL
franta-hg@154
   397
);
franta-hg@154
   398
franta-hg@154
   399
franta-hg@154
   400
ALTER TABLE nekurak.podnik_kategorie OWNER TO nekurak;
franta-hg@154
   401
franta-hg@154
   402
--
franta-hg@173
   403
-- TOC entry 1606 (class 1259 OID 35101)
franta-hg@62
   404
-- Dependencies: 10
franta-hg@62
   405
-- Name: role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@18
   406
--
franta-hg@18
   407
franta-hg@62
   408
CREATE TABLE role (
franta-hg@62
   409
    kod character varying(16) NOT NULL,
franta-hg@62
   410
    popis character varying(255)
franta-hg@62
   411
);
franta-hg@18
   412
franta-hg@18
   413
franta-hg@62
   414
ALTER TABLE nekurak.role OWNER TO nekurak;
franta-hg@62
   415
franta-hg@18
   416
--
franta-hg@173
   417
-- TOC entry 1973 (class 0 OID 0)
franta-hg@173
   418
-- Dependencies: 1606
franta-hg@62
   419
-- Name: TABLE role; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
   420
--
franta-hg@62
   421
franta-hg@62
   422
COMMENT ON TABLE role IS 'Role (skupiny) uživatelů ~ oprávnění';
franta-hg@62
   423
franta-hg@62
   424
franta-hg@62
   425
--
franta-hg@173
   426
-- TOC entry 1604 (class 1259 OID 35080)
franta-hg@62
   427
-- Dependencies: 10
franta-hg@62
   428
-- Name: uzivatel_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@62
   429
--
franta-hg@62
   430
franta-hg@62
   431
CREATE SEQUENCE uzivatel_seq
franta-hg@62
   432
    INCREMENT BY 1
franta-hg@62
   433
    NO MAXVALUE
franta-hg@62
   434
    NO MINVALUE
franta-hg@62
   435
    CACHE 1;
franta-hg@62
   436
franta-hg@62
   437
franta-hg@62
   438
ALTER TABLE nekurak.uzivatel_seq OWNER TO nekurak;
franta-hg@62
   439
franta-hg@62
   440
--
franta-hg@173
   441
-- TOC entry 1605 (class 1259 OID 35091)
franta-hg@173
   442
-- Dependencies: 1895 1896 10
franta-hg@62
   443
-- Name: uzivatel; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   444
--
franta-hg@62
   445
franta-hg@62
   446
CREATE TABLE uzivatel (
franta-hg@62
   447
    id integer DEFAULT nextval('uzivatel_seq'::regclass) NOT NULL,
franta-hg@62
   448
    prezdivka character varying(64) NOT NULL,
franta-hg@62
   449
    heslo character varying(512) NOT NULL,
franta-hg@62
   450
    jmeno character varying(64),
franta-hg@62
   451
    prijmeni character varying(64),
franta-hg@62
   452
    email character varying(255),
franta-hg@62
   453
    datum timestamp with time zone DEFAULT now() NOT NULL
franta-hg@62
   454
);
franta-hg@62
   455
franta-hg@62
   456
franta-hg@62
   457
ALTER TABLE nekurak.uzivatel OWNER TO nekurak;
franta-hg@62
   458
franta-hg@62
   459
--
franta-hg@173
   460
-- TOC entry 1976 (class 0 OID 0)
franta-hg@173
   461
-- Dependencies: 1605
franta-hg@62
   462
-- Name: COLUMN uzivatel.prezdivka; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
   463
--
franta-hg@62
   464
franta-hg@62
   465
COMMENT ON COLUMN uzivatel.prezdivka IS 'Uživatelské jméno';
franta-hg@62
   466
franta-hg@62
   467
franta-hg@62
   468
--
franta-hg@173
   469
-- TOC entry 1607 (class 1259 OID 35106)
franta-hg@62
   470
-- Dependencies: 10
franta-hg@62
   471
-- Name: uzivatel_role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   472
--
franta-hg@62
   473
franta-hg@62
   474
CREATE TABLE uzivatel_role (
franta-hg@62
   475
    role character varying(16) NOT NULL,
franta-hg@62
   476
    prezdivka character varying(64) NOT NULL
franta-hg@62
   477
);
franta-hg@62
   478
franta-hg@62
   479
franta-hg@62
   480
ALTER TABLE nekurak.uzivatel_role OWNER TO nekurak;
franta-hg@62
   481
franta-hg@62
   482
--
franta-hg@173
   483
-- TOC entry 1978 (class 0 OID 0)
franta-hg@173
   484
-- Dependencies: 1607
franta-hg@62
   485
-- Name: TABLE uzivatel_role; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
   486
--
franta-hg@62
   487
franta-hg@62
   488
COMMENT ON TABLE uzivatel_role IS 'Přiřazení uživatelských rolí (skupin).';
franta-hg@62
   489
franta-hg@62
   490
franta-hg@62
   491
--
franta-hg@173
   492
-- TOC entry 1919 (class 2606 OID 35227)
franta-hg@173
   493
-- Dependencies: 1610 1610
franta-hg@115
   494
-- Name: clanek_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@115
   495
--
franta-hg@115
   496
franta-hg@115
   497
ALTER TABLE ONLY clanek
franta-hg@115
   498
    ADD CONSTRAINT clanek_pk PRIMARY KEY (id);
franta-hg@115
   499
franta-hg@115
   500
franta-hg@115
   501
--
franta-hg@173
   502
-- TOC entry 1915 (class 2606 OID 35190)
franta-hg@173
   503
-- Dependencies: 1609 1609
franta-hg@71
   504
-- Name: fotka_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@71
   505
--
franta-hg@71
   506
franta-hg@71
   507
ALTER TABLE ONLY fotka
franta-hg@71
   508
    ADD CONSTRAINT fotka_pk PRIMARY KEY (id);
franta-hg@71
   509
franta-hg@71
   510
franta-hg@71
   511
--
franta-hg@173
   512
-- TOC entry 1917 (class 2606 OID 35204)
franta-hg@173
   513
-- Dependencies: 1609 1609 1609
franta-hg@72
   514
-- Name: fotka_poradi_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@72
   515
--
franta-hg@72
   516
franta-hg@72
   517
ALTER TABLE ONLY fotka
franta-hg@72
   518
    ADD CONSTRAINT fotka_poradi_uq UNIQUE (popis, poradi);
franta-hg@72
   519
franta-hg@72
   520
franta-hg@72
   521
--
franta-hg@173
   522
-- TOC entry 1922 (class 2606 OID 35284)
franta-hg@173
   523
-- Dependencies: 1614 1614
franta-hg@115
   524
-- Name: hlasovani_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@115
   525
--
franta-hg@115
   526
franta-hg@115
   527
ALTER TABLE ONLY hlasovani
franta-hg@115
   528
    ADD CONSTRAINT hlasovani_pk PRIMARY KEY (id);
franta-hg@115
   529
franta-hg@115
   530
franta-hg@115
   531
--
franta-hg@173
   532
-- TOC entry 1927 (class 2606 OID 35403)
franta-hg@154
   533
-- Dependencies: 1617 1617
franta-hg@154
   534
-- Name: kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   535
--
franta-hg@154
   536
franta-hg@154
   537
ALTER TABLE ONLY kategorie
franta-hg@154
   538
    ADD CONSTRAINT kategorie_pk PRIMARY KEY (id);
franta-hg@154
   539
franta-hg@154
   540
franta-hg@154
   541
--
franta-hg@173
   542
-- TOC entry 1925 (class 2606 OID 35385)
franta-hg@173
   543
-- Dependencies: 1616 1616
franta-hg@137
   544
-- Name: komentar_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@137
   545
--
franta-hg@137
   546
franta-hg@137
   547
ALTER TABLE ONLY komentar
franta-hg@137
   548
    ADD CONSTRAINT komentar_pk PRIMARY KEY (id);
franta-hg@137
   549
franta-hg@137
   550
franta-hg@137
   551
--
franta-hg@173
   552
-- TOC entry 1931 (class 2606 OID 35441)
franta-hg@173
   553
-- Dependencies: 1619 1619
franta-hg@173
   554
-- Name: kurackost_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@173
   555
--
franta-hg@173
   556
franta-hg@173
   557
ALTER TABLE ONLY kurackost
franta-hg@173
   558
    ADD CONSTRAINT kurackost_pk PRIMARY KEY (id);
franta-hg@173
   559
franta-hg@173
   560
franta-hg@173
   561
--
franta-hg@173
   562
-- TOC entry 1929 (class 2606 OID 35408)
franta-hg@154
   563
-- Dependencies: 1618 1618 1618
franta-hg@154
   564
-- Name: podnik_kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   565
--
franta-hg@154
   566
franta-hg@154
   567
ALTER TABLE ONLY podnik_kategorie
franta-hg@154
   568
    ADD CONSTRAINT podnik_kategorie_pk PRIMARY KEY (podnik, kategorie);
franta-hg@154
   569
franta-hg@154
   570
franta-hg@154
   571
--
franta-hg@173
   572
-- TOC entry 1905 (class 2606 OID 35058)
franta-hg@173
   573
-- Dependencies: 1603 1603
franta-hg@18
   574
-- Name: podnik_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@18
   575
--
franta-hg@18
   576
franta-hg@18
   577
ALTER TABLE ONLY podnik
franta-hg@18
   578
    ADD CONSTRAINT podnik_pk PRIMARY KEY (id);
franta-hg@18
   579
franta-hg@18
   580
franta-hg@19
   581
--
franta-hg@173
   582
-- TOC entry 1911 (class 2606 OID 35105)
franta-hg@173
   583
-- Dependencies: 1606 1606
franta-hg@62
   584
-- Name: skupina_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   585
--
franta-hg@62
   586
franta-hg@62
   587
ALTER TABLE ONLY role
franta-hg@62
   588
    ADD CONSTRAINT skupina_pk PRIMARY KEY (kod);
franta-hg@62
   589
franta-hg@62
   590
franta-hg@62
   591
--
franta-hg@173
   592
-- TOC entry 1907 (class 2606 OID 35098)
franta-hg@173
   593
-- Dependencies: 1605 1605
franta-hg@62
   594
-- Name: uzivatel_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   595
--
franta-hg@62
   596
franta-hg@62
   597
ALTER TABLE ONLY uzivatel
franta-hg@62
   598
    ADD CONSTRAINT uzivatel_pk PRIMARY KEY (id);
franta-hg@62
   599
franta-hg@62
   600
franta-hg@62
   601
--
franta-hg@173
   602
-- TOC entry 1909 (class 2606 OID 35100)
franta-hg@173
   603
-- Dependencies: 1605 1605
franta-hg@62
   604
-- Name: uzivatel_prezdivka_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   605
--
franta-hg@62
   606
franta-hg@62
   607
ALTER TABLE ONLY uzivatel
franta-hg@62
   608
    ADD CONSTRAINT uzivatel_prezdivka_uq UNIQUE (prezdivka);
franta-hg@62
   609
franta-hg@62
   610
franta-hg@62
   611
--
franta-hg@173
   612
-- TOC entry 1913 (class 2606 OID 35137)
franta-hg@173
   613
-- Dependencies: 1607 1607 1607
franta-hg@62
   614
-- Name: uzivatel_role_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   615
--
franta-hg@62
   616
franta-hg@62
   617
ALTER TABLE ONLY uzivatel_role
franta-hg@62
   618
    ADD CONSTRAINT uzivatel_role_pk PRIMARY KEY (role, prezdivka);
franta-hg@62
   619
franta-hg@62
   620
franta-hg@62
   621
--
franta-hg@173
   622
-- TOC entry 1920 (class 1259 OID 35291)
franta-hg@173
   623
-- Dependencies: 1614
franta-hg@115
   624
-- Name: hlasovani_ip_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@115
   625
--
franta-hg@115
   626
franta-hg@115
   627
CREATE INDEX hlasovani_ip_idx ON hlasovani USING btree (ip_adresa);
franta-hg@115
   628
franta-hg@115
   629
franta-hg@115
   630
--
franta-hg@173
   631
-- TOC entry 1923 (class 1259 OID 35309)
franta-hg@173
   632
-- Dependencies: 1614
franta-hg@118
   633
-- Name: hlsovani_datum_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@118
   634
--
franta-hg@118
   635
franta-hg@118
   636
CREATE INDEX hlsovani_datum_idx ON hlasovani USING btree (date(datum));
franta-hg@118
   637
franta-hg@118
   638
franta-hg@118
   639
--
franta-hg@173
   640
-- TOC entry 1942 (class 2620 OID 35125)
franta-hg@173
   641
-- Dependencies: 65 1605
franta-hg@62
   642
-- Name: uzivatel_insert; Type: TRIGGER; Schema: nekurak; Owner: nekurak
franta-hg@62
   643
--
franta-hg@62
   644
franta-hg@62
   645
CREATE TRIGGER uzivatel_insert
franta-hg@62
   646
    AFTER INSERT ON uzivatel
franta-hg@62
   647
    FOR EACH ROW
franta-hg@62
   648
    EXECUTE PROCEDURE bezny_uzivatel();
franta-hg@62
   649
franta-hg@62
   650
franta-hg@62
   651
--
franta-hg@173
   652
-- TOC entry 1936 (class 2606 OID 35191)
franta-hg@173
   653
-- Dependencies: 1904 1603 1609
franta-hg@71
   654
-- Name: fotka_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@71
   655
--
franta-hg@71
   656
franta-hg@71
   657
ALTER TABLE ONLY fotka
franta-hg@71
   658
    ADD CONSTRAINT fotka_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
franta-hg@71
   659
franta-hg@71
   660
franta-hg@71
   661
--
franta-hg@173
   662
-- TOC entry 1937 (class 2606 OID 35285)
franta-hg@173
   663
-- Dependencies: 1614 1603 1904
franta-hg@62
   664
-- Name: hlasovani_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@62
   665
--
franta-hg@62
   666
franta-hg@62
   667
ALTER TABLE ONLY hlasovani
franta-hg@62
   668
    ADD CONSTRAINT hlasovani_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
franta-hg@62
   669
franta-hg@62
   670
franta-hg@62
   671
--
franta-hg@173
   672
-- TOC entry 1938 (class 2606 OID 35386)
franta-hg@173
   673
-- Dependencies: 1904 1603 1616
franta-hg@137
   674
-- Name: komentar_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@137
   675
--
franta-hg@137
   676
franta-hg@137
   677
ALTER TABLE ONLY komentar
franta-hg@137
   678
    ADD CONSTRAINT komentar_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id);
franta-hg@137
   679
franta-hg@137
   680
franta-hg@137
   681
--
franta-hg@173
   682
-- TOC entry 1939 (class 2606 OID 35391)
franta-hg@173
   683
-- Dependencies: 1616 1908 1605
franta-hg@137
   684
-- Name: komentar_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@137
   685
--
franta-hg@137
   686
franta-hg@137
   687
ALTER TABLE ONLY komentar
franta-hg@137
   688
    ADD CONSTRAINT komentar_uzivatel_fk FOREIGN KEY (uzivatel) REFERENCES uzivatel(prezdivka);
franta-hg@137
   689
franta-hg@137
   690
franta-hg@137
   691
--
franta-hg@173
   692
-- TOC entry 1941 (class 2606 OID 35414)
franta-hg@173
   693
-- Dependencies: 1926 1617 1618
franta-hg@154
   694
-- Name: podnik_kategorie_kategorie_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@154
   695
--
franta-hg@154
   696
franta-hg@154
   697
ALTER TABLE ONLY podnik_kategorie
franta-hg@154
   698
    ADD CONSTRAINT podnik_kategorie_kategorie_fk FOREIGN KEY (kategorie) REFERENCES kategorie(id) ON DELETE CASCADE;
franta-hg@154
   699
franta-hg@154
   700
franta-hg@154
   701
--
franta-hg@173
   702
-- TOC entry 1940 (class 2606 OID 35409)
franta-hg@173
   703
-- Dependencies: 1603 1618 1904
franta-hg@154
   704
-- Name: podnik_kategorie_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@154
   705
--
franta-hg@154
   706
franta-hg@154
   707
ALTER TABLE ONLY podnik_kategorie
franta-hg@154
   708
    ADD CONSTRAINT podnik_kategorie_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
franta-hg@154
   709
franta-hg@154
   710
franta-hg@154
   711
--
franta-hg@173
   712
-- TOC entry 1933 (class 2606 OID 35458)
franta-hg@173
   713
-- Dependencies: 1603 1619 1930
franta-hg@173
   714
-- Name: podnik_kurackost_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@173
   715
--
franta-hg@173
   716
franta-hg@173
   717
ALTER TABLE ONLY podnik
franta-hg@173
   718
    ADD CONSTRAINT podnik_kurackost_fk FOREIGN KEY (kurackost) REFERENCES kurackost(id);
franta-hg@173
   719
franta-hg@173
   720
franta-hg@173
   721
--
franta-hg@173
   722
-- TOC entry 1932 (class 2606 OID 35178)
franta-hg@173
   723
-- Dependencies: 1603 1605 1908
franta-hg@71
   724
-- Name: podnik_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@71
   725
--
franta-hg@71
   726
franta-hg@71
   727
ALTER TABLE ONLY podnik
franta-hg@71
   728
    ADD CONSTRAINT podnik_uzivatel_fk FOREIGN KEY (spravce) REFERENCES uzivatel(prezdivka) ON DELETE SET NULL;
franta-hg@71
   729
franta-hg@71
   730
franta-hg@71
   731
--
franta-hg@173
   732
-- TOC entry 1934 (class 2606 OID 35138)
franta-hg@173
   733
-- Dependencies: 1607 1910 1606
franta-hg@62
   734
-- Name: uzivatel_role_role_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@62
   735
--
franta-hg@62
   736
franta-hg@62
   737
ALTER TABLE ONLY uzivatel_role
franta-hg@62
   738
    ADD CONSTRAINT uzivatel_role_role_fk FOREIGN KEY (role) REFERENCES role(kod) ON UPDATE CASCADE ON DELETE CASCADE;
franta-hg@62
   739
franta-hg@62
   740
franta-hg@62
   741
--
franta-hg@173
   742
-- TOC entry 1935 (class 2606 OID 35143)
franta-hg@173
   743
-- Dependencies: 1605 1607 1908
franta-hg@62
   744
-- Name: uzivatel_role_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@62
   745
--
franta-hg@62
   746
franta-hg@62
   747
ALTER TABLE ONLY uzivatel_role
franta-hg@62
   748
    ADD CONSTRAINT uzivatel_role_uzivatel_fk FOREIGN KEY (prezdivka) REFERENCES uzivatel(prezdivka) ON UPDATE CASCADE ON DELETE CASCADE;
franta-hg@62
   749
franta-hg@62
   750
franta-hg@62
   751
--
franta-hg@173
   752
-- TOC entry 1945 (class 0 OID 0)
franta-hg@19
   753
-- Dependencies: 10
franta-hg@19
   754
-- Name: nekurak; Type: ACL; Schema: -; Owner: nekurak
franta-hg@19
   755
--
franta-hg@19
   756
franta-hg@19
   757
REVOKE ALL ON SCHEMA nekurak FROM PUBLIC;
franta-hg@19
   758
REVOKE ALL ON SCHEMA nekurak FROM nekurak;
franta-hg@19
   759
GRANT ALL ON SCHEMA nekurak TO nekurak;
franta-hg@19
   760
GRANT USAGE ON SCHEMA nekurak TO nekurak_web;
franta-hg@19
   761
franta-hg@19
   762
franta-hg@19
   763
--
franta-hg@173
   764
-- TOC entry 1948 (class 0 OID 0)
franta-hg@173
   765
-- Dependencies: 1611
franta-hg@115
   766
-- Name: clanek_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@115
   767
--
franta-hg@115
   768
franta-hg@115
   769
REVOKE ALL ON SEQUENCE clanek_seq FROM PUBLIC;
franta-hg@115
   770
REVOKE ALL ON SEQUENCE clanek_seq FROM nekurak;
franta-hg@115
   771
GRANT ALL ON SEQUENCE clanek_seq TO nekurak;
franta-hg@115
   772
GRANT USAGE ON SEQUENCE clanek_seq TO nekurak_web;
franta-hg@115
   773
franta-hg@115
   774
franta-hg@115
   775
--
franta-hg@173
   776
-- TOC entry 1950 (class 0 OID 0)
franta-hg@173
   777
-- Dependencies: 1610
franta-hg@115
   778
-- Name: clanek; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@115
   779
--
franta-hg@115
   780
franta-hg@115
   781
REVOKE ALL ON TABLE clanek FROM PUBLIC;
franta-hg@115
   782
REVOKE ALL ON TABLE clanek FROM nekurak;
franta-hg@115
   783
GRANT ALL ON TABLE clanek TO nekurak;
franta-hg@115
   784
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE clanek TO nekurak_web;
franta-hg@115
   785
franta-hg@115
   786
franta-hg@115
   787
--
franta-hg@173
   788
-- TOC entry 1951 (class 0 OID 0)
franta-hg@173
   789
-- Dependencies: 1608
franta-hg@71
   790
-- Name: fotka_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@71
   791
--
franta-hg@71
   792
franta-hg@71
   793
REVOKE ALL ON SEQUENCE fotka_seq FROM PUBLIC;
franta-hg@71
   794
REVOKE ALL ON SEQUENCE fotka_seq FROM nekurak;
franta-hg@71
   795
GRANT ALL ON SEQUENCE fotka_seq TO nekurak;
franta-hg@71
   796
GRANT USAGE ON SEQUENCE fotka_seq TO nekurak_web;
franta-hg@71
   797
franta-hg@71
   798
franta-hg@71
   799
--
franta-hg@173
   800
-- TOC entry 1954 (class 0 OID 0)
franta-hg@173
   801
-- Dependencies: 1609
franta-hg@71
   802
-- Name: fotka; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@71
   803
--
franta-hg@71
   804
franta-hg@71
   805
REVOKE ALL ON TABLE fotka FROM PUBLIC;
franta-hg@71
   806
REVOKE ALL ON TABLE fotka FROM nekurak;
franta-hg@71
   807
GRANT ALL ON TABLE fotka TO nekurak;
franta-hg@71
   808
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE fotka TO nekurak_web;
franta-hg@71
   809
franta-hg@71
   810
franta-hg@71
   811
--
franta-hg@173
   812
-- TOC entry 1955 (class 0 OID 0)
franta-hg@173
   813
-- Dependencies: 1613
franta-hg@115
   814
-- Name: hlasovani_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@115
   815
--
franta-hg@115
   816
franta-hg@115
   817
REVOKE ALL ON SEQUENCE hlasovani_seq FROM PUBLIC;
franta-hg@115
   818
REVOKE ALL ON SEQUENCE hlasovani_seq FROM nekurak;
franta-hg@115
   819
GRANT ALL ON SEQUENCE hlasovani_seq TO nekurak;
franta-hg@115
   820
GRANT USAGE ON SEQUENCE hlasovani_seq TO nekurak_web;
franta-hg@115
   821
franta-hg@115
   822
franta-hg@115
   823
--
franta-hg@173
   824
-- TOC entry 1958 (class 0 OID 0)
franta-hg@173
   825
-- Dependencies: 1614
franta-hg@62
   826
-- Name: hlasovani; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   827
--
franta-hg@62
   828
franta-hg@62
   829
REVOKE ALL ON TABLE hlasovani FROM PUBLIC;
franta-hg@62
   830
REVOKE ALL ON TABLE hlasovani FROM nekurak;
franta-hg@62
   831
GRANT ALL ON TABLE hlasovani TO nekurak;
franta-hg@137
   832
GRANT SELECT,INSERT ON TABLE hlasovani TO nekurak_web;
franta-hg@62
   833
franta-hg@62
   834
franta-hg@62
   835
--
franta-hg@173
   836
-- TOC entry 1961 (class 0 OID 0)
franta-hg@154
   837
-- Dependencies: 1617
franta-hg@154
   838
-- Name: kategorie; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@154
   839
--
franta-hg@154
   840
franta-hg@154
   841
REVOKE ALL ON TABLE kategorie FROM PUBLIC;
franta-hg@154
   842
REVOKE ALL ON TABLE kategorie FROM nekurak;
franta-hg@154
   843
GRANT ALL ON TABLE kategorie TO nekurak;
franta-hg@173
   844
GRANT SELECT ON TABLE kategorie TO nekurak_web;
franta-hg@154
   845
franta-hg@154
   846
franta-hg@154
   847
--
franta-hg@173
   848
-- TOC entry 1962 (class 0 OID 0)
franta-hg@173
   849
-- Dependencies: 1615
franta-hg@137
   850
-- Name: komentar_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@137
   851
--
franta-hg@137
   852
franta-hg@137
   853
REVOKE ALL ON SEQUENCE komentar_seq FROM PUBLIC;
franta-hg@137
   854
REVOKE ALL ON SEQUENCE komentar_seq FROM nekurak;
franta-hg@137
   855
GRANT ALL ON SEQUENCE komentar_seq TO nekurak;
franta-hg@137
   856
GRANT USAGE ON SEQUENCE komentar_seq TO nekurak_web;
franta-hg@137
   857
franta-hg@137
   858
franta-hg@137
   859
--
franta-hg@173
   860
-- TOC entry 1966 (class 0 OID 0)
franta-hg@173
   861
-- Dependencies: 1616
franta-hg@137
   862
-- Name: komentar; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@137
   863
--
franta-hg@137
   864
franta-hg@137
   865
REVOKE ALL ON TABLE komentar FROM PUBLIC;
franta-hg@137
   866
REVOKE ALL ON TABLE komentar FROM nekurak;
franta-hg@137
   867
GRANT ALL ON TABLE komentar TO nekurak;
franta-hg@137
   868
GRANT SELECT,INSERT ON TABLE komentar TO nekurak_web;
franta-hg@137
   869
franta-hg@137
   870
franta-hg@137
   871
--
franta-hg@173
   872
-- TOC entry 1968 (class 0 OID 0)
franta-hg@173
   873
-- Dependencies: 1619
franta-hg@173
   874
-- Name: kurackost; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@173
   875
--
franta-hg@173
   876
franta-hg@173
   877
REVOKE ALL ON TABLE kurackost FROM PUBLIC;
franta-hg@173
   878
REVOKE ALL ON TABLE kurackost FROM nekurak;
franta-hg@173
   879
GRANT ALL ON TABLE kurackost TO nekurak;
franta-hg@173
   880
GRANT SELECT ON TABLE kurackost TO nekurak_web;
franta-hg@173
   881
franta-hg@173
   882
franta-hg@173
   883
--
franta-hg@173
   884
-- TOC entry 1969 (class 0 OID 0)
franta-hg@173
   885
-- Dependencies: 1602
franta-hg@19
   886
-- Name: podnik_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@19
   887
--
franta-hg@19
   888
franta-hg@19
   889
REVOKE ALL ON SEQUENCE podnik_seq FROM PUBLIC;
franta-hg@19
   890
REVOKE ALL ON SEQUENCE podnik_seq FROM nekurak;
franta-hg@19
   891
GRANT ALL ON SEQUENCE podnik_seq TO nekurak;
franta-hg@19
   892
GRANT USAGE ON SEQUENCE podnik_seq TO nekurak_web;
franta-hg@19
   893
franta-hg@19
   894
franta-hg@19
   895
--
franta-hg@173
   896
-- TOC entry 1971 (class 0 OID 0)
franta-hg@173
   897
-- Dependencies: 1603
franta-hg@19
   898
-- Name: podnik; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@19
   899
--
franta-hg@19
   900
franta-hg@19
   901
REVOKE ALL ON TABLE podnik FROM PUBLIC;
franta-hg@19
   902
REVOKE ALL ON TABLE podnik FROM nekurak;
franta-hg@19
   903
GRANT ALL ON TABLE podnik TO nekurak;
franta-hg@19
   904
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE podnik TO nekurak_web;
franta-hg@19
   905
franta-hg@19
   906
franta-hg@62
   907
--
franta-hg@173
   908
-- TOC entry 1972 (class 0 OID 0)
franta-hg@154
   909
-- Dependencies: 1618
franta-hg@154
   910
-- Name: podnik_kategorie; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@154
   911
--
franta-hg@154
   912
franta-hg@154
   913
REVOKE ALL ON TABLE podnik_kategorie FROM PUBLIC;
franta-hg@154
   914
REVOKE ALL ON TABLE podnik_kategorie FROM nekurak;
franta-hg@154
   915
GRANT ALL ON TABLE podnik_kategorie TO nekurak;
franta-hg@154
   916
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE podnik_kategorie TO nekurak_web;
franta-hg@154
   917
franta-hg@154
   918
franta-hg@154
   919
--
franta-hg@173
   920
-- TOC entry 1974 (class 0 OID 0)
franta-hg@173
   921
-- Dependencies: 1606
franta-hg@62
   922
-- Name: role; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   923
--
franta-hg@62
   924
franta-hg@62
   925
REVOKE ALL ON TABLE role FROM PUBLIC;
franta-hg@62
   926
REVOKE ALL ON TABLE role FROM nekurak;
franta-hg@62
   927
GRANT ALL ON TABLE role TO nekurak;
franta-hg@62
   928
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE role TO nekurak_web;
franta-hg@62
   929
franta-hg@62
   930
franta-hg@62
   931
--
franta-hg@173
   932
-- TOC entry 1975 (class 0 OID 0)
franta-hg@173
   933
-- Dependencies: 1604
franta-hg@62
   934
-- Name: uzivatel_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   935
--
franta-hg@62
   936
franta-hg@62
   937
REVOKE ALL ON SEQUENCE uzivatel_seq FROM PUBLIC;
franta-hg@62
   938
REVOKE ALL ON SEQUENCE uzivatel_seq FROM nekurak;
franta-hg@62
   939
GRANT ALL ON SEQUENCE uzivatel_seq TO nekurak;
franta-hg@62
   940
GRANT USAGE ON SEQUENCE uzivatel_seq TO nekurak_web;
franta-hg@62
   941
franta-hg@62
   942
franta-hg@62
   943
--
franta-hg@173
   944
-- TOC entry 1977 (class 0 OID 0)
franta-hg@173
   945
-- Dependencies: 1605
franta-hg@62
   946
-- Name: uzivatel; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   947
--
franta-hg@62
   948
franta-hg@62
   949
REVOKE ALL ON TABLE uzivatel FROM PUBLIC;
franta-hg@62
   950
REVOKE ALL ON TABLE uzivatel FROM nekurak;
franta-hg@62
   951
GRANT ALL ON TABLE uzivatel TO nekurak;
franta-hg@62
   952
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel TO nekurak_web;
franta-hg@62
   953
franta-hg@62
   954
franta-hg@62
   955
--
franta-hg@173
   956
-- TOC entry 1979 (class 0 OID 0)
franta-hg@173
   957
-- Dependencies: 1607
franta-hg@62
   958
-- Name: uzivatel_role; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   959
--
franta-hg@62
   960
franta-hg@62
   961
REVOKE ALL ON TABLE uzivatel_role FROM PUBLIC;
franta-hg@62
   962
REVOKE ALL ON TABLE uzivatel_role FROM nekurak;
franta-hg@62
   963
GRANT ALL ON TABLE uzivatel_role TO nekurak;
franta-hg@62
   964
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel_role TO nekurak_web;
franta-hg@62
   965
franta-hg@62
   966
franta-hg@173
   967
-- Completed on 2011-01-15 14:24:31 CET
franta-hg@18
   968
franta-hg@18
   969
--
franta-hg@18
   970
-- PostgreSQL database dump complete
franta-hg@18
   971
--
franta-hg@18
   972