Commit f41dec68 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add uuid to reservations so that we can refer to them across clusters

with something other then their row index. Something unique in fact.
parent eb859d07
......@@ -93,6 +93,7 @@ sub CreateCommon($$$$$$$$)
$self->{'ADMIN_NOTES'} = undef;
$self->{'APPROVED'} = undef;
$self->{'APPROVER'} = undef;
$self->{'UUID'} = undef;
bless($self, $class);
......@@ -200,6 +201,7 @@ sub Lookup($$;$$$$)
$self->{'ADMIN_NOTES'} = $record->{'admin_notes'};
$self->{'APPROVED'} = $record->{'a'};
$self->{'APPROVER'} = $record->{'approver'};
$self->{'UUID'} = $record->{'uuid'};
bless($self, $class);
......@@ -221,6 +223,7 @@ sub notes($) { return $_[0]->{"NOTES"}; }
sub admin_notes($) { return $_[0]->{"ADMIN_NOTES"}; }
sub approved($) { return $_[0]->{"APPROVED"}; }
sub approver($) { return $_[0]->{"APPROVER"}; }
sub uuid($) { return $_[0]->{"UUID"}; }
sub Stringify($)
{
......@@ -375,6 +378,7 @@ sub Book($;$)
"end=FROM_UNIXTIME($end), " .
"uid='$uid', " .
"uid_idx='$uid_idx' " .
( defined($idx) ? "" : ", uuid=uuid()" ) .
( defined( $notes ) ? ", notes=$notes" : "" ) .
( defined( $admin_notes ) ?
", admin_notes=$admin_notes" : "" ) .
......
......@@ -2145,6 +2145,7 @@ CREATE TABLE `future_reservations` (
`approved` datetime DEFAULT NULL,
`approver` varchar(8) DEFAULT NULL,
`notified` datetime DEFAULT NULL,
`uuid` varchar(40) NOT NULL default '',
PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
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