Rev 31 | Rev 968 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3 | dev | 1 | -- |
11 | dev | 2 | -- kickup sql tables |
3 | dev | 3 | -- |
4 | |||
5 | create sequence hibernate_sequence; |
||
6 | |||
9 | dev | 7 | /* removed in this version |
3 | dev | 8 | create table participants |
9 | ( |
||
10 | id integer not null, |
||
11 | nick varchar(255) not null, |
||
12 | email varchar(255) not null, |
||
13 | name varchar(255), |
||
14 | phone varchar(255), |
||
15 | comment text, |
||
16 | mod_stamp timestamp, |
||
17 | |||
18 | constraint participants_prim primary key (id), |
||
19 | constraint participants_email unique(email) |
||
20 | ); |
||
9 | dev | 21 | */ |
3 | dev | 22 | |
10 | dev | 23 | create table acts |
24 | ( |
||
25 | id integer not null, |
||
26 | name varchar(255) not null, |
||
27 | comment text, |
||
28 | mod_stamp timestamp, |
||
29 | |||
30 | constraint acts_prim primary key (id), |
||
31 | constraint acts_name unique(name) |
||
32 | ); |
||
33 | |||
34 | create table apartments |
||
35 | ( |
||
36 | id integer not null, |
||
37 | name varchar(255) not null, |
||
38 | address text, |
||
39 | price decimal, |
||
40 | url varchar(4000), |
||
41 | comment text, |
||
42 | mod_stamp timestamp, |
||
43 | |||
31 | dev | 44 | constraint apartments_prim primary key (id), |
45 | constraint apartments_name unique(name) |
||
10 | dev | 46 | ); |
47 | |||
3 | dev | 48 | create table events |
49 | ( |
||
50 | id integer not null, |
||
51 | name varchar(255) not null, |
||
19 | dev | 52 | email varchar(255) not null, |
53 | admins varchar(255) not null, |
||
3 | dev | 54 | place varchar(255), |
55 | address text, |
||
56 | transport_desc text, |
||
57 | start date, |
||
58 | stop date, |
||
59 | last_register date, |
||
60 | last_unregister date, |
||
61 | price decimal, |
||
62 | money_account text, |
||
63 | enabled char(1) default '1', |
||
64 | comment text, |
||
65 | mod_stamp timestamp, |
||
66 | |||
67 | constraint events_prim primary key (id), |
||
68 | constraint events_name unique(name) |
||
69 | ); |
||
70 | |||
14 | dev | 71 | /* |
3 | dev | 72 | create table event_files |
73 | ( |
||
74 | id integer not null, |
||
75 | event integer not null, |
||
76 | name varchar(255) not null, |
||
77 | data file, |
||
78 | type char(1), |
||
79 | comment text, |
||
80 | mod_stamp timestamp, |
||
81 | |||
82 | constraint event_files_prim primary key (id) |
||
83 | ); |
||
14 | dev | 84 | */ |
3 | dev | 85 | |
86 | create table event_apartments |
||
87 | ( |
||
88 | id integer not null, |
||
89 | event integer not null, |
||
9 | dev | 90 | apartment integer not null, |
3 | dev | 91 | distance decimal, |
92 | comment text, |
||
93 | mod_stamp timestamp, |
||
94 | |||
31 | dev | 95 | constraint event_apartments_prim primary key (id), |
96 | constraint event_apartments_event foreign key (event) references events(id), |
||
97 | constraint event_apartments_apartment foreign key (apartment) references apartments(id) |
||
3 | dev | 98 | ); |
99 | |||
100 | create table event_acts |
||
101 | ( |
||
102 | id integer not null, |
||
103 | event integer not null, |
||
104 | act integer not null, |
||
105 | comment text, |
||
106 | mod_stamp timestamp, |
||
107 | |||
31 | dev | 108 | constraint event_acts_prim primary key (id), |
109 | constraint event_acts_event foreign key (event) references events(id), |
||
110 | constraint event_acts_act foreign key (act) references acts(id) |
||
3 | dev | 111 | ); |
112 | |||
9 | dev | 113 | /* removed in this version |
3 | dev | 114 | create table participant_events |
115 | ( |
||
116 | participant integer not null, |
||
117 | event integer not null, |
||
118 | persons integer, |
||
119 | from_zip varchar(10), |
||
120 | from_city varchar(10), |
||
121 | departure datetime, |
||
122 | free_transport integer, |
||
123 | transport_comment integer, |
||
124 | free_sleep integer, |
||
125 | sleep_comment text, |
||
9 | dev | 126 | payed char(1) default ' ', |
3 | dev | 127 | comment text, |
128 | mod_stamp timestamp, |
||
129 | |||
130 | constraint participant_events_prim primary key (participant, event) |
||
131 | ); |
||
9 | dev | 132 | */ |
3 | dev | 133 | |
9 | dev | 134 | create table participants |
135 | ( |
||
136 | id integer not null, |
||
137 | ident varchar(255) not null, |
||
138 | nick varchar(255) not null, |
||
139 | email varchar(255) not null, |
||
140 | email_public char(1) default ' ', |
||
141 | name varchar(255), |
||
142 | phone varchar(255), |
||
143 | event integer not null, |
||
144 | persons integer, |
||
145 | from_zip varchar(10), |
||
146 | from_city varchar(10), |
||
147 | departure timestamp, |
||
148 | free_transport integer, |
||
149 | transport_comment text, |
||
150 | free_sleep integer, |
||
151 | sleep_comment text, |
||
152 | payed char(1) default ' ', |
||
153 | comment text, |
||
154 | private_comment text, |
||
155 | mod_stamp timestamp, |
||
156 | |||
157 | constraint participants_prim primary key (id), |
||
32 | dev | 158 | constraint participants_email unique(email, event) |
9 | dev | 159 | ); |
160 | |||
3 | dev | 161 | create table participant_acts |
162 | ( |
||
27 | dev | 163 | id integer not null, |
164 | participant integer not null, |
||
165 | act integer not null, |
||
166 | comment text, |
||
167 | mod_stamp timestamp, |
||
3 | dev | 168 | |
31 | dev | 169 | constraint participant_acts_prim primary key (id), |
170 | constraint participant_acts_participant foreign key (participant) references participants(id), |
||
171 | constraint participant_acts_act foreign key (act) references acts(id) |
||
3 | dev | 172 | ); |