fbourgeois24 / GesMat-bugtracker

0 stars 0 forks source link

Mise à jour DB dans DB et script d'installation #284

Closed fbourgeois24 closed 10 months ago

fbourgeois24 commented 10 months ago
ALTER TABLE gesmat.clients ADD remarque text NULL;
ALTER TABLE gesmat.clients CHANGE remarque remarque text NULL AFTER newsletter;
ALTER TABLE gesmat.clients MODIFY COLUMN prenom varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
ALTER TABLE gesmat.clients DROP UNIQUE KEY;
ALTER TABLE gesmat.clients CHANGE modifcationdate modificationdate timestamp DEFAULT current_timestamp() on update current_timestamp() NOT NULL;
INSERT INTO gesmat.`options` (nom) VALUES('clients');
-- gesmat.newsletter_sent definition

CREATE TABLE `newsletter_sent` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sujet` text NOT NULL,
  `corps` text NOT NULL,
  `creationuser_id` int(11) NOT NULL,
  `creationdate` timestamp NOT NULL DEFAULT current_timestamp(),
  `modificationuser_id` int(11) NOT NULL,
  `modificationdate` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- gesmat.newsletter_sent_detail definition

CREATE TABLE `newsletter_sent_detail` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `newsletter_sent_id` int(11) NOT NULL,
  `email` varchar(150) NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `unsubscribe_token` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO gesmat.parametres
(contexte, nom, valeur, description, creationdate, creationuser_id, modificationdate, modificationuser_id)
VALUES('newsletter', 'content', '<p>Bonjour,<br /><span style="font-size: 1rem;">Voici nos derni&egrave;res nouveaut&eacute;s<br /></span><span style="font-size: 1rem;">{{articles_derniers.10}}<br /></span><span style="font-size: 1rem;">L''&eacute;quipe DJ Occasion</span></p>', 'Contenu de la newsletter', '2023-11-27 10:06:16.000', 1, '2023-12-01 12:48:36.000', 1);