root/sql/schéma.sql @ 36:e117f3aa2129

Revision 29:4b6ab4ba1a95, 2.8 KB (checked in by František Kučera <franta-hg@…>, 16 years ago)

Tipy (rady, citáty…) pro uživatele načítáme z databáze (v náhodném pořadí). + Databázové schéma.

Line 
1--
2-- PostgreSQL database dump
3--
4
5-- Started on 2009-05-31 22:35:00 CEST
6
7SET client_encoding = 'UTF8';
8SET standard_conforming_strings = off;
9SET check_function_bodies = false;
10SET client_min_messages = warning;
11SET escape_string_warning = off;
12
13--
14-- TOC entry 10 (class 2615 OID 16788)
15-- Name: sqlvyukaaplikace; Type: SCHEMA; Schema: -; Owner: -
16--
17
18CREATE SCHEMA sqlvyukaaplikace;
19
20
21SET search_path = sqlvyukaaplikace, pg_catalog;
22
23--
24-- TOC entry 1579 (class 1259 OID 16797)
25-- Dependencies: 10
26-- Name: historie_seq; Type: SEQUENCE; Schema: sqlvyukaaplikace; Owner: -
27--
28
29CREATE SEQUENCE historie_seq
30    INCREMENT BY 1
31    NO MAXVALUE
32    NO MINVALUE
33    CACHE 1;
34
35
36SET default_tablespace = '';
37
38SET default_with_oids = false;
39
40--
41-- TOC entry 1578 (class 1259 OID 16789)
42-- Dependencies: 1848 1849 10
43-- Name: historie; Type: TABLE; Schema: sqlvyukaaplikace; Owner: -; Tablespace:
44--
45
46CREATE 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 1580 (class 1259 OID 16813)
57-- Dependencies: 10
58-- Name: tip_seq; Type: SEQUENCE; Schema: sqlvyukaaplikace; Owner: -
59--
60
61CREATE SEQUENCE tip_seq
62    INCREMENT BY 1
63    NO MAXVALUE
64    NO MINVALUE
65    CACHE 1;
66
67
68--
69-- TOC entry 1581 (class 1259 OID 16815)
70-- Dependencies: 1850 10
71-- Name: tip; Type: TABLE; Schema: sqlvyukaaplikace; Owner: -; Tablespace:
72--
73
74CREATE TABLE tip (
75    id numeric DEFAULT nextval('tip_seq'::regclass) NOT NULL,
76    text character varying(512) NOT NULL
77);
78
79
80--
81-- TOC entry 1859 (class 0 OID 0)
82-- Dependencies: 1581
83-- Name: TABLE tip; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
84--
85
86COMMENT ON TABLE tip IS 'Rady, tipy, odkazy a citáty… které budeme zobrazovat uživateli v náhodném pořadí.';
87
88
89--
90-- TOC entry 1860 (class 0 OID 0)
91-- Dependencies: 1581
92-- Name: COLUMN tip.text; Type: COMMENT; Schema: sqlvyukaaplikace; Owner: -
93--
94
95COMMENT ON COLUMN tip.text IS 'HTML text. Bude vložen do <p>odstavce</p>. → Pozor na validitu.';
96
97
98--
99-- TOC entry 1852 (class 2606 OID 16796)
100-- Dependencies: 1578 1578
101-- Name: historie_pk; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace:
102--
103
104ALTER TABLE ONLY historie
105    ADD CONSTRAINT historie_pk PRIMARY KEY (id);
106
107
108--
109-- TOC entry 1854 (class 2606 OID 16823)
110-- Dependencies: 1581 1581
111-- Name: tip_pk; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace:
112--
113
114ALTER TABLE ONLY tip
115    ADD CONSTRAINT tip_pk PRIMARY KEY (id);
116
117
118--
119-- TOC entry 1856 (class 2606 OID 16825)
120-- Dependencies: 1581 1581
121-- Name: tip_uq; Type: CONSTRAINT; Schema: sqlvyukaaplikace; Owner: -; Tablespace:
122--
123
124ALTER TABLE ONLY tip
125    ADD CONSTRAINT tip_uq UNIQUE (text);
126
127
128-- Completed on 2009-05-31 22:35:01 CEST
129
130--
131-- PostgreSQL database dump complete
132--
133
Note: See TracBrowser for help on using the browser.