gestione categorie interne & fix

This commit is contained in:
2025-09-01 12:56:30 +02:00
parent 16ac92a59e
commit f9b01eb01e
40 changed files with 2252 additions and 424 deletions

View File

@ -1,9 +1,9 @@
ALTER TABLE `#__circolari`
ADD COLUMN `catid` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `modified_by`,
ADD INDEX `idx_catid` (`catid`);
ADD COLUMN `categoria_id` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `modified_by`,
ADD INDEX `idx_catid` (`categoria_id`);
ALTER TABLE `#__circolari`
ALTER `catid` SET DEFAULT 11;
ALTER `categoria_id` SET DEFAULT 11;
-- opzionale, porta a 11 i record con catid 0/null
UPDATE `#__circolari` SET `catid` = 11 WHERE `catid` IS NULL OR `catid` = 0;
-- opzionale, porta a 11 i record con categoria_id 0/null
UPDATE `#__circolari` SET `categoria_id` = 11 WHERE `categoria_id` IS NULL OR `categoria_id` = 0;

View File

@ -0,0 +1,15 @@
-- Aggiunge tabella categorie interne per com_circolari e il campo categoria_id su #__circolari
CREATE TABLE IF NOT EXISTS `#__circolari_categorie` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(190) NOT NULL,
`alias` VARCHAR(190) NOT NULL DEFAULT '',
`description` TEXT DEFAULT NULL,
`state` TINYINT(1) NOT NULL DEFAULT 1,
`ordering` INT(11) NOT NULL DEFAULT 0,
`created` DATETIME NULL DEFAULT NULL,
`created_by` INT(10) UNSIGNED NULL DEFAULT NULL,
`modified` DATETIME NULL DEFAULT NULL,
`modified_by` INT(10) UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_alias` (`alias`)
) ENGINE=InnoDB DEFAULT COLLATE=utf8mb4_unicode_ci;

View File

@ -0,0 +1,7 @@
-- Rimuove catid (categoria Joomla), aggiunge usergroup_id e hits
ALTER TABLE `#__circolari`
DROP COLUMN IF EXISTS `catid`,
ADD COLUMN IF NOT EXISTS `usergroup_id` INT(11) UNSIGNED NOT NULL DEFAULT 0 ,
ADD COLUMN IF NOT EXISTS `hits` INT(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `usergroup_id`,
ADD INDEX `idx_usergroup_id` (`usergroup_id`),
ADD INDEX `idx_hits` (`hits`);

View File

@ -0,0 +1,3 @@
-- Converte scadenza a DATETIME per includere orario
ALTER TABLE `#__circolari`
MODIFY `scadenza` DATETIME NULL DEFAULT NULL;