Commit cdfc85fd authored by Ad Schellevis's avatar Ad Schellevis

(model) skip save on migration when defaults lead to inconsistent data, closes...

(model) skip save on migration when defaults lead to inconsistent data, closes https://github.com/opnsense/core/issues/1149
parent daca31be
...@@ -559,7 +559,11 @@ abstract class BaseModel ...@@ -559,7 +559,11 @@ abstract class BaseModel
// serialize to config after last migration step, keep the config data static as long as not all // serialize to config after last migration step, keep the config data static as long as not all
// migrations have completed. // migrations have completed.
if ($upgradePerfomed) { if ($upgradePerfomed) {
try {
$this->serializeToConfig(); $this->serializeToConfig();
} catch (\Exception $e) {
$logger->error("Model ".$class_info->getName() ." can't be saved, skip ( " .$e . " )");
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment