@@ -66,9 +66,11 @@ public function fixTables(): void {
66
66
global $ DB ;
67
67
// Based on schema from version 2.12.5, try to fix some harlmess inconsistencies
68
68
69
+ $ unsignedIntType = "INT " . DBConnection::getDefaultPrimaryKeySignOption () . " NOT NULL DEFAULT 0 " ;
70
+
69
71
$ table = 'glpi_plugin_formcreator_answers ' ;
70
- $ this ->migration ->changeField ($ table , 'plugin_formcreator_formanswers_id ' , 'plugin_formcreator_formanswers_id ' , ' integer ' );
71
- $ this ->migration ->changeField ($ table , 'plugin_formcreator_questions_id ' , 'plugin_formcreator_questions_id ' , ' integer ' );
72
+ $ this ->migration ->changeField ($ table , 'plugin_formcreator_formanswers_id ' , 'plugin_formcreator_formanswers_id ' , $ unsignedIntType );
73
+ $ this ->migration ->changeField ($ table , 'plugin_formcreator_questions_id ' , 'plugin_formcreator_questions_id ' , $ unsignedIntType );
72
74
$ this ->migration ->migrationOneTable ($ table );
73
75
74
76
$ table = 'glpi_plugin_formcreator_forms ' ;
@@ -87,8 +89,8 @@ public function fixTables(): void {
87
89
['groups_id_validator ' => '0 ' ],
88
90
['groups_id_validator ' => null ]
89
91
);
90
- $ this ->migration ->changeField ($ table , 'users_id_validator ' , 'users_id_validator ' , ' integer ' );
91
- $ this ->migration ->changeField ($ table , 'groups_id_validator ' , 'groups_id_validator ' , ' integer ' );
92
+ $ this ->migration ->changeField ($ table , 'users_id_validator ' , 'users_id_validator ' , $ unsignedIntType );
93
+ $ this ->migration ->changeField ($ table , 'groups_id_validator ' , 'groups_id_validator ' , $ unsignedIntType );
92
94
$ this ->migration ->migrationOneTable ($ table );
93
95
94
96
$ table = 'glpi_plugin_formcreator_questions ' ;
@@ -112,33 +114,33 @@ public function fixTables(): void {
112
114
);
113
115
$ this ->migration ->changeField ($ table , 'validation_followup ' , 'validation_followup ' , 'bool ' , ['after ' => 'urgency_question ' , 'value ' => '1 ' ]);
114
116
$ this ->migration ->changeField ($ table , 'destination_entity ' , 'destination_entity ' , 'integer ' , ['after ' => 'validation_followup ' , 'value ' => '1 ' ]);
115
- $ this ->migration ->changeField ($ table , 'destination_entity_value ' , 'destination_entity_value ' , ' integer ' , ['after ' => 'destination_entity ' , 'default ' => '1 ' ]);
117
+ $ this ->migration ->changeField ($ table , 'destination_entity_value ' , 'destination_entity_value ' , $ unsignedIntType , ['after ' => 'destination_entity ' , 'default ' => '1 ' ]);
116
118
$ this ->migration ->changeField ($ table , 'tag_type ' , 'tag_type ' , 'integer ' , ['after ' => 'destination_entity_value ' , 'value ' => '1 ' ]);
117
119
$ this ->migration ->changeField ($ table , 'tag_questions ' , 'tag_questions ' , 'string ' , ['after ' => 'tag_type ' ]);
118
120
$ this ->migration ->changeField ($ table , 'tag_specifics ' , 'tag_specifics ' , 'string ' , ['after ' => 'tag_questions ' ]);
119
121
$ this ->migration ->changeField ($ table , 'category_rule ' , 'category_rule ' , 'integer ' , ['after ' => 'tag_specifics ' , 'value ' => '1 ' ]);
120
122
$ this ->migration ->changeField ($ table , 'category_question ' , 'category_question ' , 'integer ' , ['after ' => 'category_rule ' ]);
121
123
$ this ->migration ->changeField ($ table , 'associate_rule ' , 'associate_rule ' , 'integer ' , ['after ' => 'category_question ' , 'value ' => '1 ' ]);
122
- $ this ->migration ->changeField ($ table , 'associate_question ' , 'associate_question ' , ' integer ' , ['after ' => 'associate_rule ' ]);
124
+ $ this ->migration ->changeField ($ table , 'associate_question ' , 'associate_question ' , $ unsignedIntType , ['after ' => 'associate_rule ' ]);
123
125
$ this ->migration ->changeField ($ table , 'location_rule ' , 'location_rule ' , 'integer ' , ['after ' => 'associate_question ' , 'value ' => '1 ' ]);
124
- $ this ->migration ->changeField ($ table , 'location_question ' , 'location_question ' , ' integer ' , ['after ' => 'location_rule ' ]);
126
+ $ this ->migration ->changeField ($ table , 'location_question ' , 'location_question ' , $ unsignedIntType , ['after ' => 'location_rule ' ]);
125
127
$ this ->migration ->changeField ($ table , 'show_rule ' , 'show_rule ' , 'integer ' , ['after ' => 'location_question ' , 'value ' => '1 ' ]);
126
128
$ this ->migration ->changeField ($ table , 'sla_rule ' , 'sla_rule ' , 'integer ' , ['after ' => 'show_rule ' , 'value ' => '1 ' ]);
127
- $ this ->migration ->changeField ($ table , 'sla_question_tto ' , 'sla_question_tto ' , ' integer ' , ['after ' => 'sla_rule ' ]);
128
- $ this ->migration ->changeField ($ table , 'sla_question_ttr ' , 'sla_question_ttr ' , ' integer ' , ['after ' => 'sla_question_tto ' ]);
129
+ $ this ->migration ->changeField ($ table , 'sla_question_tto ' , 'sla_question_tto ' , $ unsignedIntType , ['after ' => 'sla_rule ' ]);
130
+ $ this ->migration ->changeField ($ table , 'sla_question_ttr ' , 'sla_question_ttr ' , $ unsignedIntType , ['after ' => 'sla_question_tto ' ]);
129
131
$ this ->migration ->changeField ($ table , 'ola_rule ' , 'ola_rule ' , 'integer ' , ['after ' => 'sla_question_ttr ' , 'value ' => '1 ' ]);
130
- $ this ->migration ->changeField ($ table , 'ola_question_tto ' , 'ola_question_tto ' , ' integer ' , ['after ' => 'ola_rule ' ]);
131
- $ this ->migration ->changeField ($ table , 'ola_question_ttr ' , 'ola_question_ttr ' , ' integer ' , ['after ' => 'ola_question_tto ' ]);
132
+ $ this ->migration ->changeField ($ table , 'ola_question_tto ' , 'ola_question_tto ' , $ unsignedIntType , ['after ' => 'ola_rule ' ]);
133
+ $ this ->migration ->changeField ($ table , 'ola_question_ttr ' , 'ola_question_ttr ' , $ unsignedIntType , ['after ' => 'ola_question_tto ' ]);
132
134
$ this ->migration ->changeField ($ table , 'uuid ' , 'uuid ' , 'string ' , ['after ' => 'ola_question_ttr ' ]);
133
135
$ this ->migration ->migrationOneTable ($ table );
134
136
135
137
$ table = 'glpi_plugin_formcreator_questiondependencies ' ;
136
- $ this ->migration ->changeField ($ table , 'plugin_formcreator_questions_id ' , 'plugin_formcreator_questions_id ' , ' integer ' );
137
- $ this ->migration ->changeField ($ table , 'plugin_formcreator_questions_id_2 ' , 'plugin_formcreator_questions_id_2 ' , ' integer ' );
138
+ $ this ->migration ->changeField ($ table , 'plugin_formcreator_questions_id ' , 'plugin_formcreator_questions_id ' , $ unsignedIntType );
139
+ $ this ->migration ->changeField ($ table , 'plugin_formcreator_questions_id_2 ' , 'plugin_formcreator_questions_id_2 ' , $ unsignedIntType );
138
140
$ this ->migration ->migrationOneTable ($ table );
139
141
140
142
$ table = 'glpi_plugin_formcreator_forms_languages ' ;
141
- $ this ->migration ->changeField ($ table , 'plugin_formcreator_forms_id ' , 'plugin_formcreator_forms_id ' , ' integer ' );
143
+ $ this ->migration ->changeField ($ table , 'plugin_formcreator_forms_id ' , 'plugin_formcreator_forms_id ' , $ unsignedIntType );
142
144
$ this ->migration ->migrationOneTable ($ table );
143
145
}
144
146
0 commit comments