@@ 267-273 (lines=7) @@ | ||
264 | foreach ($objectVars as $key => $var) { |
|
265 | if ($var['persistent']) { |
|
266 | $type = $this->getFieldTypeFromVar($var); |
|
267 | if ($key == $moduleHandler->keyName) { |
|
268 | $extra = 'auto_increment'; |
|
269 | } else { |
|
270 | $default = $this->getFieldDefaultFromVar($var); |
|
271 | $extra = "default '$default' |
|
272 | "; |
|
273 | } |
|
274 | $structure .= "`$key` $type not null $extra, |
|
275 | "; |
|
276 | } |
|
@@ 299-304 (lines=6) @@ | ||
296 | // if field already exists, let's check if the definition is correct |
|
297 | $definition = strtolower($existingFieldsArray[$key]); |
|
298 | $type = $this->getFieldTypeFromVar($var); |
|
299 | if ($key == $moduleHandler->keyName) { |
|
300 | $extra = 'auto_increment'; |
|
301 | } else { |
|
302 | $default = $this->getFieldDefaultFromVar($var, $key); |
|
303 | $extra = "default '$default'"; |
|
304 | } |
|
305 | $actual_definition = "$type not null $extra"; |
|
306 | if ($definition != $actual_definition) { |
|
307 | $table->addAlteredField($key, $actual_definition); |