mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-23 14:57:46 +01:00
Fix problemi integrità db se si aggiorna (o si è aggiornato in passato) da una versione precedente alla 2.4.28
This commit is contained in:
parent
3d0b8eaa04
commit
1e15f50ac7
@ -33,7 +33,11 @@ UPDATE `zz_prints` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name`
|
|||||||
INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name`='Stampe contabili'), '1', 'Libro giornale', 'Libro giornale', 'Libro giornale', 'libro_giornale', 'idconto', '', 'fa fa-print', '', '', '0', '0', '1', '1');
|
INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name`='Stampe contabili'), '1', 'Libro giornale', 'Libro giornale', 'Libro giornale', 'libro_giornale', 'idconto', '', 'fa fa-print', '', '', '0', '0', '1', '1');
|
||||||
|
|
||||||
-- Aggiunta tabella mansioni
|
-- Aggiunta tabella mansioni
|
||||||
CREATE TABLE IF NOT EXISTS `an_mansioni` ( `id` INT NOT NULL AUTO_INCREMENT , `nome` VARCHAR(100) NOT NULL , PRIMARY KEY (`id`));
|
CREATE TABLE IF NOT EXISTS `an_mansioni` (
|
||||||
|
`id` INT NOT NULL AUTO_INCREMENT,
|
||||||
|
`nome` VARCHAR(100) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
INSERT INTO `an_mansioni`(
|
INSERT INTO `an_mansioni`(
|
||||||
`nome`
|
`nome`
|
||||||
@ -56,7 +60,12 @@ INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `visible`,
|
|||||||
|
|
||||||
UPDATE `zz_plugins` SET `options` = ' { \"main_query\": [ { \"type\": \"table\", \"fields\": \"Nominativo, Mansione, Telefono, Indirizzo email, Sede\", \"query\": \"SELECT an_referenti.id, an_referenti.nome AS Nominativo, an_mansioni.nome AS Mansione, an_referenti.telefono AS Telefono, an_referenti.email AS \'Indirizzo email\', IF(idsede = 0, \'Sede legale\', an_sedi.nomesede) AS Sede FROM an_referenti LEFT OUTER JOIN an_sedi ON idsede = an_sedi.id LEFT OUTER JOIN an_mansioni ON idmansione = an_mansioni.id WHERE 1=1 AND an_referenti.idanagrafica=|id_parent| HAVING 2=2 ORDER BY an_referenti.id DESC\"} ]}' WHERE `zz_plugins`.`name` = 'Referenti';
|
UPDATE `zz_plugins` SET `options` = ' { \"main_query\": [ { \"type\": \"table\", \"fields\": \"Nominativo, Mansione, Telefono, Indirizzo email, Sede\", \"query\": \"SELECT an_referenti.id, an_referenti.nome AS Nominativo, an_mansioni.nome AS Mansione, an_referenti.telefono AS Telefono, an_referenti.email AS \'Indirizzo email\', IF(idsede = 0, \'Sede legale\', an_sedi.nomesede) AS Sede FROM an_referenti LEFT OUTER JOIN an_sedi ON idsede = an_sedi.id LEFT OUTER JOIN an_mansioni ON idmansione = an_mansioni.id WHERE 1=1 AND an_referenti.idanagrafica=|id_parent| HAVING 2=2 ORDER BY an_referenti.id DESC\"} ]}' WHERE `zz_plugins`.`name` = 'Referenti';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `em_mansioni_template` ( `id` INT NOT NULL AUTO_INCREMENT , `idmansione` INT NOT NULL , `id_template` INT NOT NULL , PRIMARY KEY (`id`));
|
CREATE TABLE IF NOT EXISTS `em_mansioni_template` (
|
||||||
|
`id` INT NOT NULL AUTO_INCREMENT,
|
||||||
|
`idmansione` INT NOT NULL,
|
||||||
|
`id_template` INT NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
-- Aggiunta notifiche ai tecnici assegnati
|
-- Aggiunta notifiche ai tecnici assegnati
|
||||||
ALTER TABLE `in_statiintervento` CHANGE `notifica_tecnici` `notifica_tecnico_sessione` TINYINT(4) NOT NULL;
|
ALTER TABLE `in_statiintervento` CHANGE `notifica_tecnici` `notifica_tecnico_sessione` TINYINT(4) NOT NULL;
|
||||||
|
@ -98,3 +98,11 @@ ORDER BY
|
|||||||
`data` DESC,
|
`data` DESC,
|
||||||
CAST(`numero_esterno` AS UNSIGNED) DESC,
|
CAST(`numero_esterno` AS UNSIGNED) DESC,
|
||||||
`dt_ddt`.created_at DESC" WHERE `name` = 'Ddt di vendita';
|
`dt_ddt`.created_at DESC" WHERE `name` = 'Ddt di vendita';
|
||||||
|
|
||||||
|
|
||||||
|
-- Fix problemi integrità db se si aggiorna (o si è aggiornato in passato) da una versione precedente alla 2.4.28
|
||||||
|
ALTER TABLE `an_mansioni` CHANGE `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
ALTER TABLE `an_mansioni` CHANGE `updated_at` `updated_at` TIMESTAMP on update CURRENT_TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
|
||||||
|
ALTER TABLE `em_mansioni_template` CHANGE `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
ALTER TABLE `em_mansioni_template` CHANGE `updated_at` `updated_at` TIMESTAMP on update CURRENT_TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP;
|
Loading…
x
Reference in New Issue
Block a user