diff --git a/install/install.php b/install/install.php index 9cf385db0..5028ee2f0 100644 --- a/install/install.php +++ b/install/install.php @@ -66,6 +66,7 @@ class PluginFormcreatorInstall { '2.9' => '2.10', '2.10' => '2.10.2', '2.10.2' => '2.11', + '2.11' => '2.11.3', ]; /** diff --git a/install/upgrade_to_2.11.3.php b/install/upgrade_to_2.11.3.php new file mode 100644 index 000000000..1763bad17 --- /dev/null +++ b/install/upgrade_to_2.11.3.php @@ -0,0 +1,51 @@ +. + * --------------------------------------------------------------------- + * @copyright Copyright © 2011 - 2021 Teclib' + * @license http://www.gnu.org/licenses/gpl.txt GPLv3+ + * @link https://github.com/pluginsGLPI/formcreator/ + * @link https://pluginsglpi.github.io/formcreator/ + * @link http://plugins.glpi-project.org/#/plugin/formcreator + * --------------------------------------------------------------------- + */ +class PluginFormcreatorUpgradeTo2_11_3 { + /** @var Migration */ + protected $migration; + + /** + * @param Migration $migration + */ + public function upgrade(Migration $migration) { + global $DB; + + $this->migration = $migration; + + // Convert datetime to timestamp + $table = 'glpi_plugin_formcreator_formanswers'; + $migration->changeField($table, 'request_date', 'request_date', 'datetime'. ' NOT NULL'); + + $table = 'glpi_plugin_formcreator_issues'; + $migration->changeField($table, 'date_creation', 'date_creation', 'datetime'. ' NOT NULL'); + $migration->changeField($table, 'date_mod', 'date_mod', 'datetime'. ' NOT NULL'); + } +}