ncm2 with schedules

This commit is contained in:
fbsanchez 2021-11-24 22:01:21 +01:00
parent ce00d59f00
commit ba8087f49b
3 changed files with 18 additions and 8 deletions

View File

@ -5,6 +5,7 @@ CREATE TABLE IF NOT EXISTS `tncm_queue` (
`id_agent` INT(10) UNSIGNED NOT NULL,
`id_script` BIGINT(20) UNSIGNED NOT NULL,
`utimestamp` INT UNSIGNED NOT NULL,
`scheduled` INT UNSIGNED DEFAULT NULL,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -25,6 +26,9 @@ CREATE TABLE IF NOT EXISTS `talert_calendar` (
UNIQUE (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tncm_agent` ADD COLUMN `cron_interval` varchar(100) default '' AFTER `execute`;
ALTER TABLE `tncm_agent` ADD COLUMN `event_on_change` int unsigned default null AFTER `cron_interval`;
ALTER TABLE `talert_special_days` ADD COLUMN `id_calendar` int(10) unsigned NOT NULL DEFAULT 1;
ALTER TABLE `talert_special_days` ADD COLUMN `day_code` tinyint(2) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `talert_special_days` DROP COLUMN `same_day`;

View File

@ -4174,6 +4174,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_template` bigint(20) unsigned,
`execute_type` int(2) UNSIGNED NOT NULL default 0,
`execute` int(2) UNSIGNED NOT NULL default 0,
`cron_interval` varchar(100) default '',
`event_on_change` int unsigned default null,
`last_error` text,
PRIMARY KEY (`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
@ -4200,12 +4202,13 @@ CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
-- Table `tncm_queue`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_queue` (
`id` SERIAL,
`id` SERIAL,
`id_agent` INT(10) UNSIGNED NOT NULL,
`id_script` BIGINT(20) UNSIGNED NOT NULL,
`utimestamp` INT UNSIGNED NOT NULL,
`utimestamp` INT UNSIGNED NOT NULL,
`scheduled` INT UNSIGNED DEFAULT NULL,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
@ -4214,7 +4217,7 @@ CREATE TABLE IF NOT EXISTS `tncm_queue` (
CREATE TABLE IF NOT EXISTS `tncm_snippet` (
`id` SERIAL,
`name` TEXT,
`content` TEXT,
`content` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -4124,6 +4124,8 @@ CREATE TABLE IF NOT EXISTS `tncm_agent` (
`id_template` bigint(20) unsigned,
`execute_type` int(2) UNSIGNED NOT NULL default 0,
`execute` int(2) UNSIGNED NOT NULL default 0,
`cron_interval` varchar(100) default '',
`event_on_change` int unsigned default null,
`last_error` text,
PRIMARY KEY (`id_agent`),
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
@ -4150,12 +4152,13 @@ CREATE TABLE IF NOT EXISTS `tncm_agent_data` (
-- Table `tncm_queue`
-- ----------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS `tncm_queue` (
`id` SERIAL,
`id` SERIAL,
`id_agent` INT(10) UNSIGNED NOT NULL,
`id_script` BIGINT(20) UNSIGNED NOT NULL,
`utimestamp` INT UNSIGNED NOT NULL,
`utimestamp` INT UNSIGNED NOT NULL,
`scheduled` INT UNSIGNED DEFAULT NULL,
FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
FOREIGN KEY (`id_script`) REFERENCES `tncm_script`(`id`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------------------------------------------------
@ -4164,6 +4167,6 @@ CREATE TABLE IF NOT EXISTS `tncm_queue` (
CREATE TABLE IF NOT EXISTS `tncm_snippet` (
`id` SERIAL,
`name` TEXT,
`content` TEXT,
`content` TEXT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;