From 95f3c063a51ef417ed3f98262396382751796cc5 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 31 Jan 2019 16:27:55 +0100 Subject: [PATCH] Added tnotification_source_group_user table Former-commit-id: e1b542a76ceb0e80f49904c16a98e44c14fff1ff --- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 19 +++++++++++++++++++ pandora_console/pandoradb.sql | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index e62e76efd5..482fcb8f4e 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1953,6 +1953,25 @@ CREATE TABLE `tnotification_source_group` ( `id_source` BIGINT(20) UNSIGNED NOT NULL, `id_group` mediumint(4) unsigned NOT NULL, PRIMARY KEY (`id_source`,`id_group`), + INDEX (`id_group`), FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tnotification_source_user` +-- ---------------------------------------------------------------------- +CREATE TABLE `tnotification_source_group_user` ( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + `id_user` VARCHAR(60), + `enabled` INT(1) DEFAULT NULL, + `also_mail` INT(1) DEFAULT NULL, + PRIMARY KEY (`id_source`,`id_user`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_group`) REFERENCES `tnotification_source_group`(`id_group`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index c70650c70b..daae31bf5d 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1246,10 +1246,29 @@ CREATE TABLE `tnotification_source_group` ( `id_source` BIGINT(20) UNSIGNED NOT NULL, `id_group` mediumint(4) unsigned NOT NULL, PRIMARY KEY (`id_source`,`id_group`), + INDEX (`id_group`), FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- ---------------------------------------------------------------------- +-- Table `tnotification_source_user` +-- ---------------------------------------------------------------------- +CREATE TABLE `tnotification_source_group_user` ( + `id_source` BIGINT(20) UNSIGNED NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL, + `id_user` VARCHAR(60), + `enabled` INT(1) DEFAULT NULL, + `also_mail` INT(1) DEFAULT NULL, + PRIMARY KEY (`id_source`,`id_user`), + FOREIGN KEY (`id_source`) REFERENCES `tnotification_source`(`id`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_user`) REFERENCES `tusuario`(`id_user`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`id_group`) REFERENCES `tnotification_source_group`(`id_group`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- ---------------------------------------------------------------------- -- Table `tnews` -- ----------------------------------------------------------------------