-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade.my.sql
45 lines (37 loc) · 1.16 KB
/
upgrade.my.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# $Id$
drop table mrbs_entry_tmp;
CREATE TABLE mrbs_entry_tmp (
id int(11) NOT NULL auto_increment,
room_id int(11) DEFAULT '1' NOT NULL,
create_by varchar(25) DEFAULT '' NOT NULL,
start_time int(11) NOT NULL,
end_time int(11) NOT NULL,
timestamp timestamp(14),
type char(1) DEFAULT 'E' NOT NULL,
name varchar(80) DEFAULT '' NOT NULL,
description text,
PRIMARY KEY (id)
);
insert into mrbs_entry_tmp (room_id, create_by, start_time,
end_time, timestamp, type, name, description)
select room_id, create_by, unix_timestamp(start_time),
unix_timestamp(end_time), timestamp, type,
name, description
from mrbs_entry;
drop table mrbs_entry;
CREATE TABLE mrbs_entry (
id int(11) NOT NULL auto_increment,
room_id int(11) DEFAULT '1' NOT NULL,
create_by varchar(25) DEFAULT '' NOT NULL,
start_time int(11) NOT NULL,
end_time int(11) NOT NULL,
timestamp timestamp(14),
type char(1) DEFAULT 'E' NOT NULL,
name varchar(80) DEFAULT '' NOT NULL,
description text,
PRIMARY KEY (id),
key idxStartTime (start_time),
key idxEndTime (end_time)
);
insert into mrbs_entry select * from mrbs_entry_tmp;
drop table mrbs_entry_tmp;