mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 09:34:39 +00:00
(mvc) BaseModel add getVersion() to retrieve the running config version, commit changes to in memory config after every migration step.
Errors will be send to syslog, current policy is to always upgrade and ignore migration errors. (there's not really a way back, other then undo pkg install and revert the full config)
This commit is contained in:
parent
aaa0ddafe1
commit
89fa64dbcb
@ -541,6 +541,7 @@ abstract class BaseModel
|
||||
$migobj = $mig_class->newInstance();
|
||||
try {
|
||||
$migobj->run($this);
|
||||
$this->serializeToConfig();
|
||||
} catch (\Exception $e) {
|
||||
$logger->error("failed migrating from version " .
|
||||
$this->internal_current_model_version .
|
||||
@ -554,4 +555,13 @@ abstract class BaseModel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return current version number
|
||||
* @return null|string
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->internal_current_model_version;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user