Commit 32377c5d authored by Leigh Stoller's avatar Leigh Stoller

Lets also save the created timestamp in the reservation history table.

parent d0c3496f
......@@ -534,10 +534,10 @@ sub Tidy($)
"reservation_history WRITE, " .
"future_reservation_attributes AS a WRITE, " .
"future_reservations AS r READ" );
DBQueryFatal( "INSERT INTO reservation_history( pid, nodes, type, " .
"start, end, uid, notes, admin_notes ) " .
"SELECT pid, nodes, type, start, end, uid, notes, " .
"admin_notes FROM future_reservations WHERE " .
DBQueryFatal( "INSERT INTO reservation_history( uuid, pid, nodes, type, " .
"created, start, end, uid, notes, admin_notes ) " .
"SELECT uuid, pid, nodes, type, created, start, end, uid, " .
"notes, admin_notes FROM future_reservations WHERE " .
"end < '$stamp' and approved is not null" );
DBQueryFatal( "DELETE FROM future_reservations WHERE " .
"end < '$stamp'" );
......
......@@ -4626,6 +4626,7 @@ CREATE TABLE `reservation_history` (
`pid` varchar(48) NOT NULL DEFAULT '',
`nodes` smallint(5) NOT NULL DEFAULT '0',
`type` varchar(30) NOT NULL DEFAULT '',
`created` datetime DEFAULT NULL,
`start` datetime DEFAULT NULL,
`end` datetime DEFAULT NULL,
`uid` varchar(8) NOT NULL DEFAULT '',
......
use strict;
use libdb;
use emdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("reservation_history", "created")) {
DBQueryFatal("alter table reservation_history add ".
" `created` datetime DEFAULT NULL after type");
}
return 0;
}
# Local Variables:
# mode:perl
# End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment