diff --git a/app/classes/Framadate/Migration/From_0_0_to_0_8_Migration.php b/app/classes/Framadate/Migration/From_0_0_to_0_8_Migration.php new file mode 100644 index 0000000..121e389 --- /dev/null +++ b/app/classes/Framadate/Migration/From_0_0_to_0_8_Migration.php @@ -0,0 +1,60 @@ +exec(' +CREATE TABLE IF NOT EXISTS `sondage` ( + `id_sondage` char(16) NOT NULL, + `commentaires` text, + `mail_admin` varchar(128) DEFAULT NULL, + `nom_admin` varchar(64) DEFAULT NULL, + `titre` text, + `id_sondage_admin` char(24) DEFAULT NULL, + `date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `date_fin` timestamp NOT NULL DEFAULT \'0000-00-00 00:00:00\', + `format` varchar(2) DEFAULT NULL, + `mailsonde` tinyint(1) DEFAULT \'0\', + `statut` int(11) NOT NULL DEFAULT \'1\' COMMENT \'1 = actif ; 0 = inactif ; \', + UNIQUE KEY `id_sondage` (`id_sondage`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;'); + + $pdo->exec(' +CREATE TABLE IF NOT EXISTS `sujet_studs` ( + `id_sondage` char(16) NOT NULL, + `sujet` text, + KEY `id_sondage` (`id_sondage`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;'); + + $pdo->exec(' +CREATE TABLE IF NOT EXISTS `comments` ( + `id_comment` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id_sondage` char(16) NOT NULL, + `comment` text NOT NULL, + `usercomment` text, + PRIMARY KEY (`id_comment`), + KEY `id_sondage` (`id_sondage`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;'); + + $pdo->exec(' +CREATE TABLE IF NOT EXISTS `user_studs` ( + `id_users` int(11) unsigned NOT NULL AUTO_INCREMENT, + `nom` varchar(64) NOT NULL, + `id_sondage` char(16) NOT NULL, + `reponses` text NOT NULL, + PRIMARY KEY (`id_users`), + KEY `id_sondage` (`id_sondage`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;'); + } +} + \ No newline at end of file diff --git a/bandeaux.php b/bandeaux.php index a5aea4f..534bd43 100644 --- a/bandeaux.php +++ b/bandeaux.php @@ -46,7 +46,7 @@ function bandeau_titre($titre) global $connect; $tables = $connect->allTables(); - $diff = array_diff($tables, ['comment', 'poll', 'slot', 'vote']); + $diff = array_diff([Utils::table('comment'), Utils::table('poll'), Utils::table('slot'), Utils::table('vote')], $tables); if (0 != count($diff)) { echo '
'. _('Framadate is not properly installed, please check the "INSTALL" to setup the database before continuing.') .'
'; bandeau_pied(); diff --git a/migration.php b/migration.php index 6349c08..70d7c6d 100644 --- a/migration.php +++ b/migration.php @@ -1,4 +1,5 @@