SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- CREATE TABLE IF NOT EXISTS `queue_disables` (
--   `disable_id` integer NOT NULL,
--   `queue_id` varchar(255) NOT NULL,
--   PRIMARY KEY  (`disable_id`)
-- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `queue_disables` (
  `disable_id` integer NOT NULL,
  `queue_id` varchar(255) NOT NULL,
  `disable_start_time` text NOT NULL,  -- date time encoded as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS")
  `disable_end_time` text NOT NULL,  -- date time encoded as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS")
  `operator_id` varchar(128) NOT NULL,  -- sesame login of the sys admin that operated the dimm swap
  `operator_host_fqdn` varchar(128) NOT NULL,  -- machine on whach the queue disable operation was performed
  `operator_role` varchar(128) NOT NULL,  -- eg maco
  `ticket_url` varchar(255) NOT NULL,  -- the ticket to which this operation is related eg https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3752
  `comment` varchar(255) NOT NULL,  --
  PRIMARY KEY  (`disable_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `queue_disables` (`disable_id`, `queue_id`, `disable_start_time`, `disable_end_time`, `operator_id`, `operator_host_fqdn`, `operator_role`, `ticket_url`, `comment`) VALUES
(1, 'main.q@alambix42.ipr.univ-rennes.fr', '2023-03-14 19:30:00.000-05:00', '2023-10-06 19:30:00.000-05:00', 'graffy', 'graffy-ws2.spm.univ-rennes1.fr', 'sys-admin', 'https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3213', 'disabled to change dimmm a5'),
(2, 'main.q@alambix42.ipr.univ-rennes.fr', '2024-02-14 19:30:00.000-05:00', '', 'root', 'alambix42.ipr.univ-rennes1.fr', 'maco', 'https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=3213', 'security update'),
(3, 'main.q', '2024-02-28 19:30:00.000-05:00', '', 'graffy', 'alambix.ipr.univ-rennes1.fr', 'sys-admin', '', 'cluster shutdown');

