@@ -71,7 +71,7 @@ public function fixTables(): void {
7171 // with unsigned integer, with assumption that the admin aloready migrated IDs
7272 // and FK to unsigned with the GLPI Core CLI command
7373
74- $ unsignedIntType = "INT " . DBConnection:: getDefaultPrimaryKeySignOption () . " NOT NULL DEFAULT 0 " ;
74+ $ unsignedIntType = "INT UNSIGNED NOT NULL DEFAULT '0' " ;
7575
7676 $ table = 'glpi_plugin_formcreator_answers ' ;
7777 $ this ->migration ->changeField ($ table , 'plugin_formcreator_formanswers_id ' , 'plugin_formcreator_formanswers_id ' , $ unsignedIntType );
@@ -98,9 +98,15 @@ public function fixTables(): void {
9898 );
9999 $ this ->migration ->changeField ($ table , 'users_id_validator ' , 'users_id_validator ' , $ unsignedIntType );
100100 $ this ->migration ->changeField ($ table , 'groups_id_validator ' , 'groups_id_validator ' , $ unsignedIntType );
101+ $ this ->migration ->changeField ($ table , 'name ' , 'name ' , 'string ' , ['value ' => '' ]);
101102 $ this ->migration ->migrationOneTable ($ table );
102103
103104 $ table = 'glpi_plugin_formcreator_questions ' ;
105+ $ DB ->update (
106+ $ table ,
107+ ['name ' => '' ],
108+ ['name ' => null ]
109+ );
104110 $ this ->migration ->changeField ($ table , 'name ' , 'name ' , 'string ' , ['value ' => '' ]);
105111 $ this ->migration ->changeField ($ table , 'description ' , 'description ' , 'mediumtext ' );
106112 // Assume the content of the 2 following columns is out of date
@@ -109,7 +115,19 @@ public function fixTables(): void {
109115 $ this ->migration ->dropField ($ table , 'range_max ' );
110116 $ this ->migration ->migrationOneTable ($ table );
111117
118+ $ table = 'glpi_plugin_formcreator_issues ' ;
119+ $ this ->migration ->addField ($ table , 'users_id_validator ' , 'integer ' , ['after ' => 'requester_id ' ]);
120+ $ this ->migration ->addField ($ table , 'groups_id_validator ' , 'integer ' , ['after ' => 'users_id_validator ' ]);
121+ $ this ->migration ->addKey ($ table , 'users_id_validator ' , 'users_id_validator ' );
122+ $ this ->migration ->addKey ($ table , 'groups_id_validator ' , 'groups_id_validator ' );
123+ $ this ->migration ->changeField ($ table , 'itemtype ' , 'itemtype ' , 'string ' , ['value ' => '' ]);
124+
112125 $ table = 'glpi_plugin_formcreator_sections ' ;
126+ $ DB ->update (
127+ $ table ,
128+ ['name ' => '' ],
129+ ['name ' => null ]
130+ );
113131 $ this ->migration ->changeField ($ table , 'name ' , 'name ' , 'string ' , ['value ' => '' ]);
114132 $ this ->migration ->migrationOneTable ($ table );
115133
@@ -333,6 +351,7 @@ protected function migrateFkToUnsignedInt() {
333351 ],
334352 'glpi_plugin_formcreator_issues ' => [
335353 'users_id_recipient ' ,
354+ 'plugin_formcreator_categories_id ' ,
336355 ],
337356 'glpi_plugin_formcreator_questions ' => [
338357 'plugin_formcreator_sections_id ' ,
@@ -437,6 +456,7 @@ public function fixissues() {
437456 $ table = 'glpi_plugin_formcreator_issues ' ;
438457
439458 $ this ->migration ->changeField ($ table , 'name ' , 'name ' , 'string ' , ['after ' => 'id ' , 'nodefault ' => true ]);
459+ $ this ->migration ->changeField ($ table , 'status ' , 'status ' , 'string ' , ['value ' => '' ]);
440460 }
441461
442462 public function isResyncIssuesRequiresd () {
0 commit comments