Skip to content

Requête de mise a jour vers 3.2

Gérits Aurélien edited this page Apr 26, 2019 · 10 revisions

Il faut au préalable avoir fait la mise a jour vers la 3.1

Table pour le module logo:

CREATE TABLE IF NOT EXISTS `mc_logo` (
  `id_logo` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT,
  `img_logo` varchar(125) DEFAULT NULL,
  `active_logo` smallint(1) NOT NULL DEFAULT '0',
  `date_register` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id_logo`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `mc_logo_content` (
  `id_content` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `id_logo` smallint(5) UNSIGNED NOT NULL,
  `id_lang` smallint(3) UNSIGNED NOT NULL DEFAULT '1',
  `alt_logo` varchar(70) DEFAULT NULL,
  `title_logo` varchar(70) DEFAULT NULL,
  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id_content`),
  KEY `id_logo` (`id_logo`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

ALTER TABLE `mc_logo_content`
  ADD CONSTRAINT `mc_logo_content_ibfk_1` FOREIGN KEY (`id_logo`) 
REFERENCES `mc_logo` (`id_logo`) ON DELETE CASCADE ON UPDATE CASCADE;

Ajoute le module logo dans la table des modules:

INSERT INTO `mc_module` (`id_module`, `class_name`, `name`) VALUES`
`(NULL, 'backend_controller_logo', 'logo');

Ajoute les permissions au module logo :

Cette ligne n'est pas nécessaire, il est préférable de mettre les permissions depuis le backoffice

INSERT INTO `mc_admin_access` (`id_access`, `id_role`, `id_module`, `view`, `append`, `edit`, `del`, `action`) 
VALUES``(NULL, 1, 21, 1, 1, 1, 1, 1);

Modification de la colonne module_img dans mc_config_img :

ALTER TABLE `mc_config_img` CHANGE `module_img` `module_img` 
ENUM('catalog','news','pages','logo','plugins') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

Ajout des nouveaux éléments pour le logo et placeholder :

INSERT INTO `mc_config_img` 
(`id_config_img`, `module_img`, `attribute_img`, `width_img`, `height_img`, `type_img`, `resize_img`) 
VALUES``(NULL, 'logo', 'logo', '500', '121', 'large', 'adaptive'),`
`(NULL, 'logo', 'logo', '480', '105', 'medium', 'adaptive'),`
`(NULL, 'logo', 'logo', '229', '50', 'small', 'adaptive'),`
`(NULL, 'logo', 'page', '500', '309', 'medium', 'adaptive'),`
`(NULL, 'logo', 'news', '500', '309', 'medium', 'adaptive'),`
`(NULL, 'logo', 'category', '500', '309', 'medium', 'adaptive'),`
`(NULL, 'logo', 'product', '500', '309', 'medium', 'adaptive');

Ajout de la table pour les traductions des horaires d'ouverture

CREATE TABLE IF NOT EXISTS `mc_about_op_content` (
  `id_content` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `id_lang` smallint(3) UNSIGNED NOT NULL,
  `text_mo` text,
  `text_tu` text,
  `text_we` text,
  `text_th` text,
  `text_fr` text,
  `text_sa` text,
  `text_su` text,
  PRIMARY KEY (`id_content`),
  KEY `id_lang` (`id_lang`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

ALTER TABLE `mc_about_op_content`
  ADD CONSTRAINT `mc_about_op_content_ibfk_1` FOREIGN KEY (`id_lang`) REFERENCES `mc_lang` (`id_lang`) ON DELETE CASCADE ON UPDATE CASCADE;

Update version

UPDATE `mc_setting` SET `value` = '3.2.0' WHERE `name` = "magix_version";