sql/schéma.sql
author František Kučera <franta-hg@frantovo.cz>
Fri, 14 Jan 2011 18:49:43 +0100
changeset 167 21fa832b26aa
parent 163 5f0d5e1305b3
child 173 2b458ac09044
permissions -rw-r--r--
posunutí fotek k pravému okraji
franta-hg@18
     1
--
franta-hg@18
     2
-- PostgreSQL database dump
franta-hg@18
     3
--
franta-hg@18
     4
franta-hg@163
     5
-- Started on 2011-01-11 15:26:21 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@163
    39
-- TOC entry 1942 (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@154
    49
-- Dependencies: 411 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@163
    67
-- TOC entry 1943 (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@154
    76
-- TOC entry 1610 (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@154
    95
-- TOC entry 1609 (class 1259 OID 35205)
franta-hg@163
    96
-- Dependencies: 1897 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@163
   110
-- TOC entry 1945 (class 0 OID 0)
franta-hg@154
   111
-- Dependencies: 1609
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@154
   119
-- TOC entry 1607 (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@154
   135
-- TOC entry 1608 (class 1259 OID 35185)
franta-hg@163
   136
-- Dependencies: 1895 1896 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@163
   151
-- TOC entry 1948 (class 0 OID 0)
franta-hg@154
   152
-- Dependencies: 1608
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@163
   160
-- TOC entry 1949 (class 0 OID 0)
franta-hg@154
   161
-- Dependencies: 1608
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@154
   169
-- TOC entry 1612 (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@154
   184
-- TOC entry 1613 (class 1259 OID 35278)
franta-hg@163
   185
-- Dependencies: 1898 1899 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@163
   201
-- TOC entry 1952 (class 0 OID 0)
franta-hg@154
   202
-- Dependencies: 1613
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@163
   212
-- TOC entry 1953 (class 0 OID 0)
franta-hg@154
   213
-- Dependencies: 1613
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@154
   223
-- TOC entry 1616 (class 1259 OID 35396)
franta-hg@154
   224
-- Dependencies: 10
franta-hg@154
   225
-- Name: kategorie_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@154
   226
--
franta-hg@154
   227
franta-hg@154
   228
CREATE SEQUENCE kategorie_seq
franta-hg@154
   229
    INCREMENT BY 1
franta-hg@154
   230
    NO MAXVALUE
franta-hg@154
   231
    NO MINVALUE
franta-hg@154
   232
    CACHE 1;
franta-hg@154
   233
franta-hg@154
   234
franta-hg@154
   235
ALTER TABLE nekurak.kategorie_seq OWNER TO nekurak;
franta-hg@154
   236
franta-hg@154
   237
--
franta-hg@154
   238
-- TOC entry 1617 (class 1259 OID 35398)
franta-hg@163
   239
-- Dependencies: 1902 10
franta-hg@154
   240
-- Name: kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   241
--
franta-hg@154
   242
franta-hg@154
   243
CREATE TABLE kategorie (
franta-hg@154
   244
    id integer DEFAULT nextval('kategorie_seq'::regclass) NOT NULL,
franta-hg@163
   245
    nazev character varying(32) NOT NULL
franta-hg@154
   246
);
franta-hg@154
   247
franta-hg@154
   248
franta-hg@154
   249
ALTER TABLE nekurak.kategorie OWNER TO nekurak;
franta-hg@154
   250
franta-hg@154
   251
--
franta-hg@163
   252
-- TOC entry 1956 (class 0 OID 0)
franta-hg@154
   253
-- Dependencies: 1617
franta-hg@154
   254
-- Name: TABLE kategorie; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@154
   255
--
franta-hg@154
   256
franta-hg@154
   257
COMMENT ON TABLE kategorie IS 'Kategorie podniku';
franta-hg@154
   258
franta-hg@154
   259
franta-hg@154
   260
--
franta-hg@163
   261
-- TOC entry 1957 (class 0 OID 0)
franta-hg@163
   262
-- Dependencies: 1617
franta-hg@163
   263
-- Name: COLUMN kategorie.nazev; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@163
   264
--
franta-hg@163
   265
franta-hg@163
   266
COMMENT ON COLUMN kategorie.nazev IS 'jen pro info při přímé práci s SQL
franta-hg@163
   267
aplikace bere názvy a popisy kategorií z lokalizačního souboru (na základě ID kategorie)';
franta-hg@163
   268
franta-hg@163
   269
franta-hg@163
   270
--
franta-hg@154
   271
-- TOC entry 1614 (class 1259 OID 35333)
franta-hg@137
   272
-- Dependencies: 10
franta-hg@137
   273
-- Name: komentar_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@137
   274
--
franta-hg@137
   275
franta-hg@137
   276
CREATE SEQUENCE komentar_seq
franta-hg@137
   277
    INCREMENT BY 1
franta-hg@137
   278
    NO MAXVALUE
franta-hg@137
   279
    NO MINVALUE
franta-hg@137
   280
    CACHE 1;
franta-hg@137
   281
franta-hg@137
   282
franta-hg@137
   283
ALTER TABLE nekurak.komentar_seq OWNER TO nekurak;
franta-hg@137
   284
franta-hg@137
   285
--
franta-hg@154
   286
-- TOC entry 1615 (class 1259 OID 35376)
franta-hg@163
   287
-- Dependencies: 1900 1901 10
franta-hg@137
   288
-- Name: komentar; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@137
   289
--
franta-hg@137
   290
franta-hg@137
   291
CREATE TABLE komentar (
franta-hg@137
   292
    id integer DEFAULT nextval('komentar_seq'::regclass) NOT NULL,
franta-hg@137
   293
    podnik integer NOT NULL,
franta-hg@137
   294
    uzivatel character varying(64) NOT NULL,
franta-hg@137
   295
    datum timestamp with time zone DEFAULT now() NOT NULL,
franta-hg@137
   296
    nadpis character varying(255),
franta-hg@137
   297
    komentar text NOT NULL
franta-hg@137
   298
);
franta-hg@137
   299
franta-hg@137
   300
franta-hg@137
   301
ALTER TABLE nekurak.komentar OWNER TO nekurak;
franta-hg@137
   302
franta-hg@137
   303
--
franta-hg@163
   304
-- TOC entry 1960 (class 0 OID 0)
franta-hg@154
   305
-- Dependencies: 1615
franta-hg@137
   306
-- Name: TABLE komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@137
   307
--
franta-hg@137
   308
franta-hg@137
   309
COMMENT ON TABLE komentar IS 'Komentář k podniku';
franta-hg@137
   310
franta-hg@137
   311
franta-hg@137
   312
--
franta-hg@163
   313
-- TOC entry 1961 (class 0 OID 0)
franta-hg@154
   314
-- Dependencies: 1615
franta-hg@137
   315
-- Name: COLUMN komentar.nadpis; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@137
   316
--
franta-hg@137
   317
franta-hg@137
   318
COMMENT ON COLUMN komentar.nadpis IS 'vždy jen prostý text';
franta-hg@137
   319
franta-hg@137
   320
franta-hg@137
   321
--
franta-hg@163
   322
-- TOC entry 1962 (class 0 OID 0)
franta-hg@154
   323
-- Dependencies: 1615
franta-hg@137
   324
-- Name: COLUMN komentar.komentar; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@137
   325
--
franta-hg@137
   326
franta-hg@137
   327
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
   328
Jedná se o kus validního XML – má kořenový element <div/>';
franta-hg@137
   329
franta-hg@137
   330
franta-hg@137
   331
--
franta-hg@154
   332
-- TOC entry 1601 (class 1259 OID 35019)
franta-hg@18
   333
-- Dependencies: 10
franta-hg@18
   334
-- Name: podnik_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@18
   335
--
franta-hg@18
   336
franta-hg@18
   337
CREATE SEQUENCE podnik_seq
franta-hg@18
   338
    INCREMENT BY 1
franta-hg@18
   339
    NO MAXVALUE
franta-hg@18
   340
    NO MINVALUE
franta-hg@18
   341
    CACHE 1;
franta-hg@18
   342
franta-hg@18
   343
franta-hg@18
   344
ALTER TABLE nekurak.podnik_seq OWNER TO nekurak;
franta-hg@18
   345
franta-hg@18
   346
--
franta-hg@154
   347
-- TOC entry 1602 (class 1259 OID 35049)
franta-hg@163
   348
-- Dependencies: 1890 1891 1892 10
franta-hg@18
   349
-- Name: podnik; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@18
   350
--
franta-hg@18
   351
franta-hg@18
   352
CREATE TABLE podnik (
franta-hg@18
   353
    id integer DEFAULT nextval('podnik_seq'::regclass) NOT NULL,
franta-hg@18
   354
    nazev character varying(255) NOT NULL,
franta-hg@62
   355
    popis character varying(255),
franta-hg@62
   356
    url character varying(255),
franta-hg@62
   357
    datum timestamp with time zone DEFAULT now(),
franta-hg@62
   358
    ulice character varying(64),
franta-hg@62
   359
    cislo_popisne integer,
franta-hg@71
   360
    mesto character varying(64),
franta-hg@115
   361
    spravce character varying(64),
franta-hg@115
   362
    sirka double precision,
franta-hg@163
   363
    delka double precision,
franta-hg@163
   364
    stav character(1),
franta-hg@163
   365
    CONSTRAINT stav_tg CHECK (((stav = ANY (ARRAY['k'::bpchar, 'n'::bpchar, 'o'::bpchar, 'c'::bpchar])) OR (stav IS NULL)))
franta-hg@18
   366
);
franta-hg@18
   367
franta-hg@18
   368
franta-hg@18
   369
ALTER TABLE nekurak.podnik OWNER TO nekurak;
franta-hg@18
   370
franta-hg@18
   371
--
franta-hg@163
   372
-- TOC entry 1965 (class 0 OID 0)
franta-hg@154
   373
-- Dependencies: 1602
franta-hg@71
   374
-- Name: COLUMN podnik.spravce; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@71
   375
--
franta-hg@71
   376
franta-hg@71
   377
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
   378
franta-hg@71
   379
franta-hg@71
   380
--
franta-hg@163
   381
-- TOC entry 1966 (class 0 OID 0)
franta-hg@163
   382
-- Dependencies: 1602
franta-hg@163
   383
-- Name: CONSTRAINT stav_tg ON podnik; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@163
   384
--
franta-hg@163
   385
franta-hg@163
   386
COMMENT ON CONSTRAINT stav_tg ON podnik IS 'k = kuřácký
franta-hg@163
   387
n = nekuřácký
franta-hg@163
   388
o = oddělené části (důkladně)
franta-hg@163
   389
c = částečně kuřácký (špatně oddělené, považujeme za kuřácký)
franta-hg@163
   390
NULL = neznámý stav';
franta-hg@163
   391
franta-hg@163
   392
franta-hg@163
   393
--
franta-hg@154
   394
-- TOC entry 1618 (class 1259 OID 35404)
franta-hg@154
   395
-- Dependencies: 10
franta-hg@154
   396
-- Name: podnik_kategorie; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   397
--
franta-hg@154
   398
franta-hg@154
   399
CREATE TABLE podnik_kategorie (
franta-hg@154
   400
    podnik integer NOT NULL,
franta-hg@154
   401
    kategorie integer NOT NULL
franta-hg@154
   402
);
franta-hg@154
   403
franta-hg@154
   404
franta-hg@154
   405
ALTER TABLE nekurak.podnik_kategorie OWNER TO nekurak;
franta-hg@154
   406
franta-hg@154
   407
--
franta-hg@154
   408
-- TOC entry 1605 (class 1259 OID 35101)
franta-hg@62
   409
-- Dependencies: 10
franta-hg@62
   410
-- Name: role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@18
   411
--
franta-hg@18
   412
franta-hg@62
   413
CREATE TABLE role (
franta-hg@62
   414
    kod character varying(16) NOT NULL,
franta-hg@62
   415
    popis character varying(255)
franta-hg@62
   416
);
franta-hg@18
   417
franta-hg@18
   418
franta-hg@62
   419
ALTER TABLE nekurak.role OWNER TO nekurak;
franta-hg@62
   420
franta-hg@18
   421
--
franta-hg@163
   422
-- TOC entry 1969 (class 0 OID 0)
franta-hg@154
   423
-- Dependencies: 1605
franta-hg@62
   424
-- Name: TABLE role; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
   425
--
franta-hg@62
   426
franta-hg@62
   427
COMMENT ON TABLE role IS 'Role (skupiny) uživatelů ~ oprávnění';
franta-hg@62
   428
franta-hg@62
   429
franta-hg@62
   430
--
franta-hg@154
   431
-- TOC entry 1603 (class 1259 OID 35080)
franta-hg@62
   432
-- Dependencies: 10
franta-hg@62
   433
-- Name: uzivatel_seq; Type: SEQUENCE; Schema: nekurak; Owner: nekurak
franta-hg@62
   434
--
franta-hg@62
   435
franta-hg@62
   436
CREATE SEQUENCE uzivatel_seq
franta-hg@62
   437
    INCREMENT BY 1
franta-hg@62
   438
    NO MAXVALUE
franta-hg@62
   439
    NO MINVALUE
franta-hg@62
   440
    CACHE 1;
franta-hg@62
   441
franta-hg@62
   442
franta-hg@62
   443
ALTER TABLE nekurak.uzivatel_seq OWNER TO nekurak;
franta-hg@62
   444
franta-hg@62
   445
--
franta-hg@154
   446
-- TOC entry 1604 (class 1259 OID 35091)
franta-hg@163
   447
-- Dependencies: 1893 1894 10
franta-hg@62
   448
-- Name: uzivatel; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   449
--
franta-hg@62
   450
franta-hg@62
   451
CREATE TABLE uzivatel (
franta-hg@62
   452
    id integer DEFAULT nextval('uzivatel_seq'::regclass) NOT NULL,
franta-hg@62
   453
    prezdivka character varying(64) NOT NULL,
franta-hg@62
   454
    heslo character varying(512) NOT NULL,
franta-hg@62
   455
    jmeno character varying(64),
franta-hg@62
   456
    prijmeni character varying(64),
franta-hg@62
   457
    email character varying(255),
franta-hg@62
   458
    datum timestamp with time zone DEFAULT now() NOT NULL
franta-hg@62
   459
);
franta-hg@62
   460
franta-hg@62
   461
franta-hg@62
   462
ALTER TABLE nekurak.uzivatel OWNER TO nekurak;
franta-hg@62
   463
franta-hg@62
   464
--
franta-hg@163
   465
-- TOC entry 1972 (class 0 OID 0)
franta-hg@154
   466
-- Dependencies: 1604
franta-hg@62
   467
-- Name: COLUMN uzivatel.prezdivka; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
   468
--
franta-hg@62
   469
franta-hg@62
   470
COMMENT ON COLUMN uzivatel.prezdivka IS 'Uživatelské jméno';
franta-hg@62
   471
franta-hg@62
   472
franta-hg@62
   473
--
franta-hg@154
   474
-- TOC entry 1606 (class 1259 OID 35106)
franta-hg@62
   475
-- Dependencies: 10
franta-hg@62
   476
-- Name: uzivatel_role; Type: TABLE; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   477
--
franta-hg@62
   478
franta-hg@62
   479
CREATE TABLE uzivatel_role (
franta-hg@62
   480
    role character varying(16) NOT NULL,
franta-hg@62
   481
    prezdivka character varying(64) NOT NULL
franta-hg@62
   482
);
franta-hg@62
   483
franta-hg@62
   484
franta-hg@62
   485
ALTER TABLE nekurak.uzivatel_role OWNER TO nekurak;
franta-hg@62
   486
franta-hg@62
   487
--
franta-hg@163
   488
-- TOC entry 1974 (class 0 OID 0)
franta-hg@154
   489
-- Dependencies: 1606
franta-hg@62
   490
-- Name: TABLE uzivatel_role; Type: COMMENT; Schema: nekurak; Owner: nekurak
franta-hg@62
   491
--
franta-hg@62
   492
franta-hg@62
   493
COMMENT ON TABLE uzivatel_role IS 'Přiřazení uživatelských rolí (skupin).';
franta-hg@62
   494
franta-hg@62
   495
franta-hg@62
   496
--
franta-hg@163
   497
-- TOC entry 1918 (class 2606 OID 35227)
franta-hg@154
   498
-- Dependencies: 1609 1609
franta-hg@115
   499
-- Name: clanek_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@115
   500
--
franta-hg@115
   501
franta-hg@115
   502
ALTER TABLE ONLY clanek
franta-hg@115
   503
    ADD CONSTRAINT clanek_pk PRIMARY KEY (id);
franta-hg@115
   504
franta-hg@115
   505
franta-hg@115
   506
--
franta-hg@163
   507
-- TOC entry 1914 (class 2606 OID 35190)
franta-hg@154
   508
-- Dependencies: 1608 1608
franta-hg@71
   509
-- Name: fotka_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@71
   510
--
franta-hg@71
   511
franta-hg@71
   512
ALTER TABLE ONLY fotka
franta-hg@71
   513
    ADD CONSTRAINT fotka_pk PRIMARY KEY (id);
franta-hg@71
   514
franta-hg@71
   515
franta-hg@71
   516
--
franta-hg@163
   517
-- TOC entry 1916 (class 2606 OID 35204)
franta-hg@154
   518
-- Dependencies: 1608 1608 1608
franta-hg@72
   519
-- Name: fotka_poradi_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@72
   520
--
franta-hg@72
   521
franta-hg@72
   522
ALTER TABLE ONLY fotka
franta-hg@72
   523
    ADD CONSTRAINT fotka_poradi_uq UNIQUE (popis, poradi);
franta-hg@72
   524
franta-hg@72
   525
franta-hg@72
   526
--
franta-hg@163
   527
-- TOC entry 1921 (class 2606 OID 35284)
franta-hg@154
   528
-- Dependencies: 1613 1613
franta-hg@115
   529
-- Name: hlasovani_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@115
   530
--
franta-hg@115
   531
franta-hg@115
   532
ALTER TABLE ONLY hlasovani
franta-hg@115
   533
    ADD CONSTRAINT hlasovani_pk PRIMARY KEY (id);
franta-hg@115
   534
franta-hg@115
   535
franta-hg@115
   536
--
franta-hg@163
   537
-- TOC entry 1926 (class 2606 OID 35403)
franta-hg@154
   538
-- Dependencies: 1617 1617
franta-hg@154
   539
-- Name: kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   540
--
franta-hg@154
   541
franta-hg@154
   542
ALTER TABLE ONLY kategorie
franta-hg@154
   543
    ADD CONSTRAINT kategorie_pk PRIMARY KEY (id);
franta-hg@154
   544
franta-hg@154
   545
franta-hg@154
   546
--
franta-hg@163
   547
-- TOC entry 1924 (class 2606 OID 35385)
franta-hg@154
   548
-- Dependencies: 1615 1615
franta-hg@137
   549
-- Name: komentar_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@137
   550
--
franta-hg@137
   551
franta-hg@137
   552
ALTER TABLE ONLY komentar
franta-hg@137
   553
    ADD CONSTRAINT komentar_pk PRIMARY KEY (id);
franta-hg@137
   554
franta-hg@137
   555
franta-hg@137
   556
--
franta-hg@163
   557
-- TOC entry 1928 (class 2606 OID 35408)
franta-hg@154
   558
-- Dependencies: 1618 1618 1618
franta-hg@154
   559
-- Name: podnik_kategorie_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@154
   560
--
franta-hg@154
   561
franta-hg@154
   562
ALTER TABLE ONLY podnik_kategorie
franta-hg@154
   563
    ADD CONSTRAINT podnik_kategorie_pk PRIMARY KEY (podnik, kategorie);
franta-hg@154
   564
franta-hg@154
   565
franta-hg@154
   566
--
franta-hg@163
   567
-- TOC entry 1904 (class 2606 OID 35058)
franta-hg@154
   568
-- Dependencies: 1602 1602
franta-hg@18
   569
-- Name: podnik_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@18
   570
--
franta-hg@18
   571
franta-hg@18
   572
ALTER TABLE ONLY podnik
franta-hg@18
   573
    ADD CONSTRAINT podnik_pk PRIMARY KEY (id);
franta-hg@18
   574
franta-hg@18
   575
franta-hg@19
   576
--
franta-hg@163
   577
-- TOC entry 1910 (class 2606 OID 35105)
franta-hg@154
   578
-- Dependencies: 1605 1605
franta-hg@62
   579
-- Name: skupina_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   580
--
franta-hg@62
   581
franta-hg@62
   582
ALTER TABLE ONLY role
franta-hg@62
   583
    ADD CONSTRAINT skupina_pk PRIMARY KEY (kod);
franta-hg@62
   584
franta-hg@62
   585
franta-hg@62
   586
--
franta-hg@163
   587
-- TOC entry 1906 (class 2606 OID 35098)
franta-hg@154
   588
-- Dependencies: 1604 1604
franta-hg@62
   589
-- Name: uzivatel_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   590
--
franta-hg@62
   591
franta-hg@62
   592
ALTER TABLE ONLY uzivatel
franta-hg@62
   593
    ADD CONSTRAINT uzivatel_pk PRIMARY KEY (id);
franta-hg@62
   594
franta-hg@62
   595
franta-hg@62
   596
--
franta-hg@163
   597
-- TOC entry 1908 (class 2606 OID 35100)
franta-hg@154
   598
-- Dependencies: 1604 1604
franta-hg@62
   599
-- Name: uzivatel_prezdivka_uq; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   600
--
franta-hg@62
   601
franta-hg@62
   602
ALTER TABLE ONLY uzivatel
franta-hg@62
   603
    ADD CONSTRAINT uzivatel_prezdivka_uq UNIQUE (prezdivka);
franta-hg@62
   604
franta-hg@62
   605
franta-hg@62
   606
--
franta-hg@163
   607
-- TOC entry 1912 (class 2606 OID 35137)
franta-hg@154
   608
-- Dependencies: 1606 1606 1606
franta-hg@62
   609
-- Name: uzivatel_role_pk; Type: CONSTRAINT; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@62
   610
--
franta-hg@62
   611
franta-hg@62
   612
ALTER TABLE ONLY uzivatel_role
franta-hg@62
   613
    ADD CONSTRAINT uzivatel_role_pk PRIMARY KEY (role, prezdivka);
franta-hg@62
   614
franta-hg@62
   615
franta-hg@62
   616
--
franta-hg@163
   617
-- TOC entry 1919 (class 1259 OID 35291)
franta-hg@154
   618
-- Dependencies: 1613
franta-hg@115
   619
-- Name: hlasovani_ip_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@115
   620
--
franta-hg@115
   621
franta-hg@115
   622
CREATE INDEX hlasovani_ip_idx ON hlasovani USING btree (ip_adresa);
franta-hg@115
   623
franta-hg@115
   624
franta-hg@115
   625
--
franta-hg@163
   626
-- TOC entry 1922 (class 1259 OID 35309)
franta-hg@154
   627
-- Dependencies: 1613
franta-hg@118
   628
-- Name: hlsovani_datum_idx; Type: INDEX; Schema: nekurak; Owner: nekurak; Tablespace: 
franta-hg@118
   629
--
franta-hg@118
   630
franta-hg@118
   631
CREATE INDEX hlsovani_datum_idx ON hlasovani USING btree (date(datum));
franta-hg@118
   632
franta-hg@118
   633
franta-hg@118
   634
--
franta-hg@163
   635
-- TOC entry 1938 (class 2620 OID 35125)
franta-hg@154
   636
-- Dependencies: 1604 65
franta-hg@62
   637
-- Name: uzivatel_insert; Type: TRIGGER; Schema: nekurak; Owner: nekurak
franta-hg@62
   638
--
franta-hg@62
   639
franta-hg@62
   640
CREATE TRIGGER uzivatel_insert
franta-hg@62
   641
    AFTER INSERT ON uzivatel
franta-hg@62
   642
    FOR EACH ROW
franta-hg@62
   643
    EXECUTE PROCEDURE bezny_uzivatel();
franta-hg@62
   644
franta-hg@62
   645
franta-hg@62
   646
--
franta-hg@163
   647
-- TOC entry 1932 (class 2606 OID 35191)
franta-hg@163
   648
-- Dependencies: 1903 1608 1602
franta-hg@71
   649
-- Name: fotka_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@71
   650
--
franta-hg@71
   651
franta-hg@71
   652
ALTER TABLE ONLY fotka
franta-hg@71
   653
    ADD CONSTRAINT fotka_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
franta-hg@71
   654
franta-hg@71
   655
franta-hg@71
   656
--
franta-hg@163
   657
-- TOC entry 1933 (class 2606 OID 35285)
franta-hg@163
   658
-- Dependencies: 1903 1602 1613
franta-hg@62
   659
-- Name: hlasovani_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@62
   660
--
franta-hg@62
   661
franta-hg@62
   662
ALTER TABLE ONLY hlasovani
franta-hg@62
   663
    ADD CONSTRAINT hlasovani_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
franta-hg@62
   664
franta-hg@62
   665
franta-hg@62
   666
--
franta-hg@163
   667
-- TOC entry 1934 (class 2606 OID 35386)
franta-hg@163
   668
-- Dependencies: 1615 1602 1903
franta-hg@137
   669
-- Name: komentar_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@137
   670
--
franta-hg@137
   671
franta-hg@137
   672
ALTER TABLE ONLY komentar
franta-hg@137
   673
    ADD CONSTRAINT komentar_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id);
franta-hg@137
   674
franta-hg@137
   675
franta-hg@137
   676
--
franta-hg@163
   677
-- TOC entry 1935 (class 2606 OID 35391)
franta-hg@163
   678
-- Dependencies: 1907 1604 1615
franta-hg@137
   679
-- Name: komentar_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@137
   680
--
franta-hg@137
   681
franta-hg@137
   682
ALTER TABLE ONLY komentar
franta-hg@137
   683
    ADD CONSTRAINT komentar_uzivatel_fk FOREIGN KEY (uzivatel) REFERENCES uzivatel(prezdivka);
franta-hg@137
   684
franta-hg@137
   685
franta-hg@137
   686
--
franta-hg@163
   687
-- TOC entry 1937 (class 2606 OID 35414)
franta-hg@163
   688
-- Dependencies: 1618 1925 1617
franta-hg@154
   689
-- Name: podnik_kategorie_kategorie_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@154
   690
--
franta-hg@154
   691
franta-hg@154
   692
ALTER TABLE ONLY podnik_kategorie
franta-hg@154
   693
    ADD CONSTRAINT podnik_kategorie_kategorie_fk FOREIGN KEY (kategorie) REFERENCES kategorie(id) ON DELETE CASCADE;
franta-hg@154
   694
franta-hg@154
   695
franta-hg@154
   696
--
franta-hg@163
   697
-- TOC entry 1936 (class 2606 OID 35409)
franta-hg@163
   698
-- Dependencies: 1903 1602 1618
franta-hg@154
   699
-- Name: podnik_kategorie_podnik_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@154
   700
--
franta-hg@154
   701
franta-hg@154
   702
ALTER TABLE ONLY podnik_kategorie
franta-hg@154
   703
    ADD CONSTRAINT podnik_kategorie_podnik_fk FOREIGN KEY (podnik) REFERENCES podnik(id) ON DELETE CASCADE;
franta-hg@154
   704
franta-hg@154
   705
franta-hg@154
   706
--
franta-hg@163
   707
-- TOC entry 1929 (class 2606 OID 35178)
franta-hg@163
   708
-- Dependencies: 1602 1604 1907
franta-hg@71
   709
-- Name: podnik_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@71
   710
--
franta-hg@71
   711
franta-hg@71
   712
ALTER TABLE ONLY podnik
franta-hg@71
   713
    ADD CONSTRAINT podnik_uzivatel_fk FOREIGN KEY (spravce) REFERENCES uzivatel(prezdivka) ON DELETE SET NULL;
franta-hg@71
   714
franta-hg@71
   715
franta-hg@71
   716
--
franta-hg@163
   717
-- TOC entry 1930 (class 2606 OID 35138)
franta-hg@163
   718
-- Dependencies: 1909 1606 1605
franta-hg@62
   719
-- Name: uzivatel_role_role_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@62
   720
--
franta-hg@62
   721
franta-hg@62
   722
ALTER TABLE ONLY uzivatel_role
franta-hg@62
   723
    ADD CONSTRAINT uzivatel_role_role_fk FOREIGN KEY (role) REFERENCES role(kod) ON UPDATE CASCADE ON DELETE CASCADE;
franta-hg@62
   724
franta-hg@62
   725
franta-hg@62
   726
--
franta-hg@163
   727
-- TOC entry 1931 (class 2606 OID 35143)
franta-hg@163
   728
-- Dependencies: 1907 1604 1606
franta-hg@62
   729
-- Name: uzivatel_role_uzivatel_fk; Type: FK CONSTRAINT; Schema: nekurak; Owner: nekurak
franta-hg@62
   730
--
franta-hg@62
   731
franta-hg@62
   732
ALTER TABLE ONLY uzivatel_role
franta-hg@62
   733
    ADD CONSTRAINT uzivatel_role_uzivatel_fk FOREIGN KEY (prezdivka) REFERENCES uzivatel(prezdivka) ON UPDATE CASCADE ON DELETE CASCADE;
franta-hg@62
   734
franta-hg@62
   735
franta-hg@62
   736
--
franta-hg@163
   737
-- TOC entry 1941 (class 0 OID 0)
franta-hg@19
   738
-- Dependencies: 10
franta-hg@19
   739
-- Name: nekurak; Type: ACL; Schema: -; Owner: nekurak
franta-hg@19
   740
--
franta-hg@19
   741
franta-hg@19
   742
REVOKE ALL ON SCHEMA nekurak FROM PUBLIC;
franta-hg@19
   743
REVOKE ALL ON SCHEMA nekurak FROM nekurak;
franta-hg@19
   744
GRANT ALL ON SCHEMA nekurak TO nekurak;
franta-hg@19
   745
GRANT USAGE ON SCHEMA nekurak TO nekurak_web;
franta-hg@19
   746
franta-hg@19
   747
franta-hg@19
   748
--
franta-hg@163
   749
-- TOC entry 1944 (class 0 OID 0)
franta-hg@154
   750
-- Dependencies: 1610
franta-hg@115
   751
-- Name: clanek_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@115
   752
--
franta-hg@115
   753
franta-hg@115
   754
REVOKE ALL ON SEQUENCE clanek_seq FROM PUBLIC;
franta-hg@115
   755
REVOKE ALL ON SEQUENCE clanek_seq FROM nekurak;
franta-hg@115
   756
GRANT ALL ON SEQUENCE clanek_seq TO nekurak;
franta-hg@115
   757
GRANT USAGE ON SEQUENCE clanek_seq TO nekurak_web;
franta-hg@115
   758
franta-hg@115
   759
franta-hg@115
   760
--
franta-hg@163
   761
-- TOC entry 1946 (class 0 OID 0)
franta-hg@154
   762
-- Dependencies: 1609
franta-hg@115
   763
-- Name: clanek; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@115
   764
--
franta-hg@115
   765
franta-hg@115
   766
REVOKE ALL ON TABLE clanek FROM PUBLIC;
franta-hg@115
   767
REVOKE ALL ON TABLE clanek FROM nekurak;
franta-hg@115
   768
GRANT ALL ON TABLE clanek TO nekurak;
franta-hg@115
   769
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE clanek TO nekurak_web;
franta-hg@115
   770
franta-hg@115
   771
franta-hg@115
   772
--
franta-hg@163
   773
-- TOC entry 1947 (class 0 OID 0)
franta-hg@154
   774
-- Dependencies: 1607
franta-hg@71
   775
-- Name: fotka_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@71
   776
--
franta-hg@71
   777
franta-hg@71
   778
REVOKE ALL ON SEQUENCE fotka_seq FROM PUBLIC;
franta-hg@71
   779
REVOKE ALL ON SEQUENCE fotka_seq FROM nekurak;
franta-hg@71
   780
GRANT ALL ON SEQUENCE fotka_seq TO nekurak;
franta-hg@71
   781
GRANT USAGE ON SEQUENCE fotka_seq TO nekurak_web;
franta-hg@71
   782
franta-hg@71
   783
franta-hg@71
   784
--
franta-hg@163
   785
-- TOC entry 1950 (class 0 OID 0)
franta-hg@154
   786
-- Dependencies: 1608
franta-hg@71
   787
-- Name: fotka; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@71
   788
--
franta-hg@71
   789
franta-hg@71
   790
REVOKE ALL ON TABLE fotka FROM PUBLIC;
franta-hg@71
   791
REVOKE ALL ON TABLE fotka FROM nekurak;
franta-hg@71
   792
GRANT ALL ON TABLE fotka TO nekurak;
franta-hg@71
   793
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE fotka TO nekurak_web;
franta-hg@71
   794
franta-hg@71
   795
franta-hg@71
   796
--
franta-hg@163
   797
-- TOC entry 1951 (class 0 OID 0)
franta-hg@154
   798
-- Dependencies: 1612
franta-hg@115
   799
-- Name: hlasovani_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@115
   800
--
franta-hg@115
   801
franta-hg@115
   802
REVOKE ALL ON SEQUENCE hlasovani_seq FROM PUBLIC;
franta-hg@115
   803
REVOKE ALL ON SEQUENCE hlasovani_seq FROM nekurak;
franta-hg@115
   804
GRANT ALL ON SEQUENCE hlasovani_seq TO nekurak;
franta-hg@115
   805
GRANT USAGE ON SEQUENCE hlasovani_seq TO nekurak_web;
franta-hg@115
   806
franta-hg@115
   807
franta-hg@115
   808
--
franta-hg@163
   809
-- TOC entry 1954 (class 0 OID 0)
franta-hg@154
   810
-- Dependencies: 1613
franta-hg@62
   811
-- Name: hlasovani; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   812
--
franta-hg@62
   813
franta-hg@62
   814
REVOKE ALL ON TABLE hlasovani FROM PUBLIC;
franta-hg@62
   815
REVOKE ALL ON TABLE hlasovani FROM nekurak;
franta-hg@62
   816
GRANT ALL ON TABLE hlasovani TO nekurak;
franta-hg@137
   817
GRANT SELECT,INSERT ON TABLE hlasovani TO nekurak_web;
franta-hg@62
   818
franta-hg@62
   819
franta-hg@62
   820
--
franta-hg@163
   821
-- TOC entry 1955 (class 0 OID 0)
franta-hg@154
   822
-- Dependencies: 1616
franta-hg@154
   823
-- Name: kategorie_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@154
   824
--
franta-hg@154
   825
franta-hg@154
   826
REVOKE ALL ON SEQUENCE kategorie_seq FROM PUBLIC;
franta-hg@154
   827
REVOKE ALL ON SEQUENCE kategorie_seq FROM nekurak;
franta-hg@154
   828
GRANT ALL ON SEQUENCE kategorie_seq TO nekurak;
franta-hg@154
   829
GRANT USAGE ON SEQUENCE kategorie_seq TO nekurak_web;
franta-hg@154
   830
franta-hg@154
   831
franta-hg@154
   832
--
franta-hg@163
   833
-- TOC entry 1958 (class 0 OID 0)
franta-hg@154
   834
-- Dependencies: 1617
franta-hg@154
   835
-- Name: kategorie; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@154
   836
--
franta-hg@154
   837
franta-hg@154
   838
REVOKE ALL ON TABLE kategorie FROM PUBLIC;
franta-hg@154
   839
REVOKE ALL ON TABLE kategorie FROM nekurak;
franta-hg@154
   840
GRANT ALL ON TABLE kategorie TO nekurak;
franta-hg@154
   841
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE kategorie TO nekurak_web;
franta-hg@154
   842
franta-hg@154
   843
franta-hg@154
   844
--
franta-hg@163
   845
-- TOC entry 1959 (class 0 OID 0)
franta-hg@154
   846
-- Dependencies: 1614
franta-hg@137
   847
-- Name: komentar_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@137
   848
--
franta-hg@137
   849
franta-hg@137
   850
REVOKE ALL ON SEQUENCE komentar_seq FROM PUBLIC;
franta-hg@137
   851
REVOKE ALL ON SEQUENCE komentar_seq FROM nekurak;
franta-hg@137
   852
GRANT ALL ON SEQUENCE komentar_seq TO nekurak;
franta-hg@137
   853
GRANT USAGE ON SEQUENCE komentar_seq TO nekurak_web;
franta-hg@137
   854
franta-hg@137
   855
franta-hg@137
   856
--
franta-hg@163
   857
-- TOC entry 1963 (class 0 OID 0)
franta-hg@154
   858
-- Dependencies: 1615
franta-hg@137
   859
-- Name: komentar; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@137
   860
--
franta-hg@137
   861
franta-hg@137
   862
REVOKE ALL ON TABLE komentar FROM PUBLIC;
franta-hg@137
   863
REVOKE ALL ON TABLE komentar FROM nekurak;
franta-hg@137
   864
GRANT ALL ON TABLE komentar TO nekurak;
franta-hg@137
   865
GRANT SELECT,INSERT ON TABLE komentar TO nekurak_web;
franta-hg@137
   866
franta-hg@137
   867
franta-hg@137
   868
--
franta-hg@163
   869
-- TOC entry 1964 (class 0 OID 0)
franta-hg@154
   870
-- Dependencies: 1601
franta-hg@19
   871
-- Name: podnik_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@19
   872
--
franta-hg@19
   873
franta-hg@19
   874
REVOKE ALL ON SEQUENCE podnik_seq FROM PUBLIC;
franta-hg@19
   875
REVOKE ALL ON SEQUENCE podnik_seq FROM nekurak;
franta-hg@19
   876
GRANT ALL ON SEQUENCE podnik_seq TO nekurak;
franta-hg@19
   877
GRANT USAGE ON SEQUENCE podnik_seq TO nekurak_web;
franta-hg@19
   878
franta-hg@19
   879
franta-hg@19
   880
--
franta-hg@163
   881
-- TOC entry 1967 (class 0 OID 0)
franta-hg@154
   882
-- Dependencies: 1602
franta-hg@19
   883
-- Name: podnik; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@19
   884
--
franta-hg@19
   885
franta-hg@19
   886
REVOKE ALL ON TABLE podnik FROM PUBLIC;
franta-hg@19
   887
REVOKE ALL ON TABLE podnik FROM nekurak;
franta-hg@19
   888
GRANT ALL ON TABLE podnik TO nekurak;
franta-hg@19
   889
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE podnik TO nekurak_web;
franta-hg@19
   890
franta-hg@19
   891
franta-hg@62
   892
--
franta-hg@163
   893
-- TOC entry 1968 (class 0 OID 0)
franta-hg@154
   894
-- Dependencies: 1618
franta-hg@154
   895
-- Name: podnik_kategorie; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@154
   896
--
franta-hg@154
   897
franta-hg@154
   898
REVOKE ALL ON TABLE podnik_kategorie FROM PUBLIC;
franta-hg@154
   899
REVOKE ALL ON TABLE podnik_kategorie FROM nekurak;
franta-hg@154
   900
GRANT ALL ON TABLE podnik_kategorie TO nekurak;
franta-hg@154
   901
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE podnik_kategorie TO nekurak_web;
franta-hg@154
   902
franta-hg@154
   903
franta-hg@154
   904
--
franta-hg@163
   905
-- TOC entry 1970 (class 0 OID 0)
franta-hg@154
   906
-- Dependencies: 1605
franta-hg@62
   907
-- Name: role; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   908
--
franta-hg@62
   909
franta-hg@62
   910
REVOKE ALL ON TABLE role FROM PUBLIC;
franta-hg@62
   911
REVOKE ALL ON TABLE role FROM nekurak;
franta-hg@62
   912
GRANT ALL ON TABLE role TO nekurak;
franta-hg@62
   913
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE role TO nekurak_web;
franta-hg@62
   914
franta-hg@62
   915
franta-hg@62
   916
--
franta-hg@163
   917
-- TOC entry 1971 (class 0 OID 0)
franta-hg@154
   918
-- Dependencies: 1603
franta-hg@62
   919
-- Name: uzivatel_seq; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   920
--
franta-hg@62
   921
franta-hg@62
   922
REVOKE ALL ON SEQUENCE uzivatel_seq FROM PUBLIC;
franta-hg@62
   923
REVOKE ALL ON SEQUENCE uzivatel_seq FROM nekurak;
franta-hg@62
   924
GRANT ALL ON SEQUENCE uzivatel_seq TO nekurak;
franta-hg@62
   925
GRANT USAGE ON SEQUENCE uzivatel_seq TO nekurak_web;
franta-hg@62
   926
franta-hg@62
   927
franta-hg@62
   928
--
franta-hg@163
   929
-- TOC entry 1973 (class 0 OID 0)
franta-hg@154
   930
-- Dependencies: 1604
franta-hg@62
   931
-- Name: uzivatel; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   932
--
franta-hg@62
   933
franta-hg@62
   934
REVOKE ALL ON TABLE uzivatel FROM PUBLIC;
franta-hg@62
   935
REVOKE ALL ON TABLE uzivatel FROM nekurak;
franta-hg@62
   936
GRANT ALL ON TABLE uzivatel TO nekurak;
franta-hg@62
   937
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel TO nekurak_web;
franta-hg@62
   938
franta-hg@62
   939
franta-hg@62
   940
--
franta-hg@163
   941
-- TOC entry 1975 (class 0 OID 0)
franta-hg@154
   942
-- Dependencies: 1606
franta-hg@62
   943
-- Name: uzivatel_role; Type: ACL; Schema: nekurak; Owner: nekurak
franta-hg@62
   944
--
franta-hg@62
   945
franta-hg@62
   946
REVOKE ALL ON TABLE uzivatel_role FROM PUBLIC;
franta-hg@62
   947
REVOKE ALL ON TABLE uzivatel_role FROM nekurak;
franta-hg@62
   948
GRANT ALL ON TABLE uzivatel_role TO nekurak;
franta-hg@62
   949
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE uzivatel_role TO nekurak_web;
franta-hg@62
   950
franta-hg@62
   951
franta-hg@163
   952
-- Completed on 2011-01-11 15:26:23 CET
franta-hg@18
   953
franta-hg@18
   954
--
franta-hg@18
   955
-- PostgreSQL database dump complete
franta-hg@18
   956
--
franta-hg@18
   957