Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 dev 1
--
2
-- it-ru sql tables
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
 
44
	constraint apartments_prim primary key (id)
45
);
46
 
3 dev 47
create table events
48
(
49
	id              integer                     not null,
50
	name            varchar(255)                not null,
51
	place           varchar(255),
52
	address         text,
53
	transport_desc  text,
54
	start           date,
55
	stop            date,
56
	last_register   date,
57
	last_unregister date,
58
	price           decimal,
59
	money_account   text,
60
	enabled         char(1)                     default '1',
61
	comment         text,
62
	mod_stamp       timestamp,
63
 
64
	constraint events_prim primary key (id),
65
	constraint events_name unique(name)
66
);
67
 
68
create table event_files
69
(
70
	id          integer                         not null,
71
	event       integer                         not null,
72
	name        varchar(255)                    not null,
73
	data        file,
74
	type        char(1),
75
	comment     text,
76
	mod_stamp   timestamp,
77
 
78
	constraint event_files_prim primary key (id)
79
);
80
 
81
create table event_apartments
82
(
83
	id          integer                         not null,
84
	event       integer                         not null,
9 dev 85
	apartment   integer                         not null,
3 dev 86
	distance    decimal,
87
	comment     text,
88
	mod_stamp   timestamp,
89
 
9 dev 90
	constraint event_apartments_prim primary key (event, apartment)
3 dev 91
);
92
 
93
create table event_acts
94
(
95
	id          integer                         not null,
96
	event       integer                         not null,
97
	act         integer                         not null,
98
	comment     text,
99
	mod_stamp   timestamp,
100
 
101
	constraint event_acts_prim primary key (event, act)
102
);
103
 
9 dev 104
/* removed in this version
3 dev 105
create table participant_events
106
(
107
	participant       integer                   not null,
108
	event             integer                   not null,
109
	persons           integer,
110
	from_zip          varchar(10),
111
	from_city         varchar(10),
112
	departure         datetime,
113
	free_transport    integer,
114
	transport_comment integer,
115
	free_sleep        integer,
116
	sleep_comment     text,
9 dev 117
	payed             char(1)                   default ' ',
3 dev 118
	comment           text,
119
	mod_stamp         timestamp,
120
 
121
	constraint participant_events_prim primary key (participant, event)
122
);
9 dev 123
*/
3 dev 124
 
9 dev 125
create table participants
126
(
127
	id                integer                   not null,
128
	ident             varchar(255)              not null,
129
	nick              varchar(255)              not null,
130
	email             varchar(255)              not null,
131
	email_public      char(1)                   default ' ',
132
	name              varchar(255),
133
	phone             varchar(255),
134
	event             integer                   not null,
135
	persons           integer,
136
	from_zip          varchar(10),
137
	from_city         varchar(10),
138
	departure         timestamp,
139
	free_transport    integer,
140
	transport_comment text,
141
	free_sleep        integer,
142
	sleep_comment     text,
143
	payed             char(1)                   default ' ',
144
	comment           text,
145
	private_comment   text,
146
	mod_stamp         timestamp,
147
 
148
	constraint participants_prim  primary key (id),
149
	constraint participants_email unique(email)
150
);
151
 
3 dev 152
create table participant_acts
153
(
154
	participant   integer                       not null,
155
	event         integer                       not null,
156
	act           integer                       not null,
157
	comment       text,
158
	mod_stamp     timestamp,
159
 
160
	constraint participant_acts_prim primary key (participant, event, act)
161
);