sql/schéma.sql
author František Kučera <franta-hg@frantovo.cz>
Tue, 14 Jul 2009 18:08:07 +0200
changeset 50 1eb68e2ac637
parent 43 8d1a92f64110
permissions -rw-r--r--
Svislý posuvník pro nápovědní pole.
     1 --
     2 -- PostgreSQL database dump
     3 --
     4 
     5 -- Started on 2009-06-06 23:39:14 CEST
     6 
     7 SET client_encoding = 'UTF8';
     8 SET standard_conforming_strings = off;
     9 SET check_function_bodies = false;
    10 SET client_min_messages = warning;
    11 SET escape_string_warning = off;
    12 
    13 --
    14 -- TOC entry 10 (class 2615 OID 16788)
    15 -- Name: sqlvyukaaplikace; Type: SCHEMA; Schema: -; Owner: -
    16 --
    17 
    18 CREATE SCHEMA sqlvyukaaplikace;
    19 
    20 
    21 SET search_path = sqlvyukaaplikace, pg_catalog;
    22 
    23 --
    24 -- TOC entry 1583 (class 1259 OID 16797)
    25 -- Dependencies: 10
    26 -- Name: historie_seq; Type: SEQUENCE; Schema: sqlvyukaaplikace; Owner: -
    27 --
    28 
    29 CREATE SEQUENCE historie_seq
    30     INCREMENT BY 1
    31     NO MAXVALUE
    32     NO MINVALUE
    33     CACHE 1;
    34 
    35 
    36 SET default_tablespace = '';
    37 
    38 SET default_with_oids = false;
    39 
    40 --
    41 -- TOC entry 1582 (class 1259 OID 16789)
    42 -- Dependencies: 1854 1855 10
    43 -- Name: historie; Type: TABLE; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
    44 --
    45 
    46 CREATE TABLE historie (
    47     id numeric DEFAULT nextval('historie_seq'::regclass) NOT NULL,
    48     datum timestamp with time zone DEFAULT now(),
    49     sql text,
    50     id_sezeni character varying(255),
    51     ip_adresa character varying(255)
    52 );
    53 
    54 
    55 --
    56 -- TOC entry 1586 (class 1259 OID 16826)
    57 -- Dependencies: 10
    58 -- Name: pruvodce_seq; Type: SEQUENCE; Schema: sqlvyukaaplikace; Owner: -
    59 --
    60 
    61 CREATE SEQUENCE pruvodce_seq
    62     INCREMENT BY 10
    63     NO MAXVALUE
    64     NO MINVALUE
    65     CACHE 1;
    66 
    67 
    68 --
    69 -- TOC entry 1587 (class 1259 OID 16828)
    70 -- Dependencies: 1857 10
    71 -- Name: pruvodce; Type: TABLE; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
    72 --
    73 
    74 CREATE TABLE pruvodce (
    75     id numeric DEFAULT nextval('pruvodce_seq'::regclass) NOT NULL,
    76     kod character varying(32),
    77     nadpis character varying(255) NOT NULL,
    78     obsah text NOT NULL
    79 );
    80 
    81 
    82 --
    83 -- TOC entry 1870 (class 0 OID 0)
    84 -- Dependencies: 1587
    85 -- Name: TABLE pruvodce; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
    86 --
    87 
    88 COMMENT ON TABLE pruvodce IS 'Nápověda, průvodce';
    89 
    90 
    91 --
    92 -- TOC entry 1871 (class 0 OID 0)
    93 -- Dependencies: 1587
    94 -- Name: COLUMN pruvodce.id; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
    95 --
    96 
    97 COMMENT ON COLUMN pruvodce.id IS 'Pořadí kapitoly/lekce';
    98 
    99 
   100 --
   101 -- TOC entry 1872 (class 0 OID 0)
   102 -- Dependencies: 1587
   103 -- Name: COLUMN pruvodce.kod; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
   104 --
   105 
   106 COMMENT ON COLUMN pruvodce.kod IS 'kód, na který se můžeme odkazovat';
   107 
   108 
   109 --
   110 -- TOC entry 1873 (class 0 OID 0)
   111 -- Dependencies: 1587
   112 -- Name: COLUMN pruvodce.nadpis; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
   113 --
   114 
   115 COMMENT ON COLUMN pruvodce.nadpis IS 'Název kapitoly';
   116 
   117 
   118 --
   119 -- TOC entry 1874 (class 0 OID 0)
   120 -- Dependencies: 1587
   121 -- Name: COLUMN pruvodce.obsah; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
   122 --
   123 
   124 COMMENT ON COLUMN pruvodce.obsah IS 'Vlastní text kapitoly';
   125 
   126 
   127 --
   128 -- TOC entry 1584 (class 1259 OID 16813)
   129 -- Dependencies: 10
   130 -- Name: tip_seq; Type: SEQUENCE; Schema: sqlvyukaaplikace; Owner: -
   131 --
   132 
   133 CREATE SEQUENCE tip_seq
   134     INCREMENT BY 1
   135     NO MAXVALUE
   136     NO MINVALUE
   137     CACHE 1;
   138 
   139 
   140 --
   141 -- TOC entry 1585 (class 1259 OID 16815)
   142 -- Dependencies: 1856 10
   143 -- Name: tip; Type: TABLE; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
   144 --
   145 
   146 CREATE TABLE tip (
   147     id numeric DEFAULT nextval('tip_seq'::regclass) NOT NULL,
   148     text character varying(512) NOT NULL
   149 );
   150 
   151 
   152 --
   153 -- TOC entry 1875 (class 0 OID 0)
   154 -- Dependencies: 1585
   155 -- Name: TABLE tip; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
   156 --
   157 
   158 COMMENT ON TABLE tip IS 'Rady, tipy, odkazy a citáty… které budeme zobrazovat uživateli v náhodném pořadí.';
   159 
   160 
   161 --
   162 -- TOC entry 1876 (class 0 OID 0)
   163 -- Dependencies: 1585
   164 -- Name: COLUMN tip.text; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
   165 --
   166 
   167 COMMENT ON COLUMN tip.text IS 'HTML text. Bude vložen do <p>odstavce</p>. → Pozor na validitu.';
   168 
   169 
   170 --
   171 -- TOC entry 1859 (class 2606 OID 16796)
   172 -- Dependencies: 1582 1582
   173 -- Name: historie_pk; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
   174 --
   175 
   176 ALTER TABLE ONLY historie
   177     ADD CONSTRAINT historie_pk PRIMARY KEY (id);
   178 
   179 
   180 --
   181 -- TOC entry 1865 (class 2606 OID 16838)
   182 -- Dependencies: 1587 1587
   183 -- Name: pruvodce_kod_uq; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
   184 --
   185 
   186 ALTER TABLE ONLY pruvodce
   187     ADD CONSTRAINT pruvodce_kod_uq UNIQUE (kod);
   188 
   189 
   190 --
   191 -- TOC entry 1867 (class 2606 OID 16836)
   192 -- Dependencies: 1587 1587
   193 -- Name: pruvodce_pk; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
   194 --
   195 
   196 ALTER TABLE ONLY pruvodce
   197     ADD CONSTRAINT pruvodce_pk PRIMARY KEY (id);
   198 
   199 
   200 --
   201 -- TOC entry 1861 (class 2606 OID 16823)
   202 -- Dependencies: 1585 1585
   203 -- Name: tip_pk; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
   204 --
   205 
   206 ALTER TABLE ONLY tip
   207     ADD CONSTRAINT tip_pk PRIMARY KEY (id);
   208 
   209 
   210 --
   211 -- TOC entry 1863 (class 2606 OID 16825)
   212 -- Dependencies: 1585 1585
   213 -- Name: tip_uq; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace: 
   214 --
   215 
   216 ALTER TABLE ONLY tip
   217     ADD CONSTRAINT tip_uq UNIQUE (text);
   218 
   219 
   220 -- Completed on 2009-06-06 23:39:14 CEST
   221 
   222 --
   223 -- PostgreSQL database dump complete
   224 --
   225