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