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

Couple more additions to announcement table as per issue #258.

1. Add display_start and display_end datetime fields for scheduling when
   an announcement should be shown/retired.

2. Add priority integer for ordering messages, default is 3.
parent ea596acf
......@@ -531,12 +531,15 @@ CREATE TABLE `apt_announcements` (
`pid_idx` int(10) default NULL,
`genesis` varchar(64) NOT NULL default 'emulab',
`portal` varchar(64) NOT NULL default 'emulab',
`priority` tinyint(1) NOT NULL default '3',
`retired` tinyint(1) NOT NULL default '0',
`max_seen` int(8) NOT NULL default '20',
`text` mediumtext,
`style` varchar(64) NOT NULL default 'alert-info',
`link_label` tinytext,
`link_url` tinytext,
`display_start` datetime default NULL,
`display_end` datetime default NULL,
PRIMARY KEY (`idx`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("apt_announcements", "priority")) {
DBQueryFatal("alter table apt_announcements add ".
" `priority` tinyint(1) NOT NULL default '3' after portal");
}
if (!DBSlotExists("apt_announcements", "display_start")) {
DBQueryFatal("alter table apt_announcements add ".
" `display_start` datetime default NULL after link_url");
}
if (!DBSlotExists("apt_announcements", "display_end")) {
DBQueryFatal("alter table apt_announcements add ".
" `display_end` datetime default NULL after display_start");
}
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