projects
/
iserv-mod-room-reservation.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c3d5b9b
)
update script to IServ2 complained about rooms that did not exist in the current...
author
Roland Hieber
<devnull@localhost>
Tue, 8 Dec 2009 03:04:52 +0000
(
04:04
+0100)
committer
Roland Hieber
<devnull@localhost>
Tue, 8 Dec 2009 03:04:52 +0000
(
04:04
+0100)
maint/update-iserv1-iserv2.pl
patch
|
blob
|
history
diff --git
a/maint/update-iserv1-iserv2.pl
b/maint/update-iserv1-iserv2.pl
index
aa97f0c
..
b23e17e
100755
(executable)
--- a/
maint/update-iserv1-iserv2.pl
+++ b/
maint/update-iserv1-iserv2.pl
@@
-215,6
+215,14
@@
while(<IN>) {
print "converting the database...\n";
foreach(IServ::DB::GetArr("SELECT * FROM mod_roomreservation_bookings_old;")) {
my %row = %{$_};
print "converting the database...\n";
foreach(IServ::DB::GetArr("SELECT * FROM mod_roomreservation_bookings_old;")) {
my %row = %{$_};
+
+ # test if room exists, if not, create it
+ my @room = IServ::DB::GetArr "SELECT * FROM rooms WHERE name='".$row{"room"}."';";
+ if(!@room) {
+ print "NOTICE: room $_ was found in old database but not in current, creating it.\n";
+ IServ::DB::Put "rooms", { "name" => $row{"room"} };
+ }
+
IServ::DB::Put "mod_roomreservation_bookings", { "rrb_room" => $row{"room"},
"rrb_date" => $row{"date"}, "rrb_tsfirst" =>
$tsbeginoldkeys{$row{"timebegin"}}, "rrb_tslast" =>
IServ::DB::Put "mod_roomreservation_bookings", { "rrb_room" => $row{"room"},
"rrb_date" => $row{"date"}, "rrb_tsfirst" =>
$tsbeginoldkeys{$row{"timebegin"}}, "rrb_tslast" =>
This page took
0.028528 seconds
and
4
git commands to generate.