Fix per file sql di update aggiornato dopo rilascio 2.4.35

This commit is contained in:
Luca 2024-02-08 11:34:56 +01:00
parent 58bab546d8
commit 7782769922
2 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,6 @@
<?php
// Fix eliminazione fattura collegata a Nota di credito
$fk = $database->fetchArray('SELECT TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE REFERENCED_TABLE_SCHEMA = '.prepare($database->getDatabaseName())." AND REFERENCED_TABLE_NAME = 'co_documenti' AND CONSTRAINT_NAME = 'co_documenti_ibfk_1'");
if (!empty($fk)) {
$database->query('ALTER TABLE `co_documenti` DROP FOREIGN KEY `co_documenti_ibfk_1`');

10
update/2_4_55.php Normal file
View File

@ -0,0 +1,10 @@
<?php
/*Fix per file sql di update aggiornato dopo rilascio 2.4.35*/
$has_column = null;
$col_righe = $database->fetchArray('SHOW COLUMNS FROM `zz_groups`');
$has_column = array_search('id_module_start', array_column($col_righe, 'Field'));
if (empty($has_column)) {
$database->query('ALTER TABLE `zz_groups` ADD `id_module_start` INT NULL AFTER `editable`');
}