fix: Установка таблиц из json
This commit is contained in:
parent
fd12f9a2f5
commit
ad6efaf36d
3 changed files with 6 additions and 4 deletions
|
|
@ -78,7 +78,7 @@ class Installer
|
|||
|
||||
if (file_exists($setup) && ($this->isChanged($name) || $force)) {
|
||||
$registry = $this->_registry;
|
||||
|
||||
|
||||
$settings = new Settings($setup);
|
||||
$settings->read();
|
||||
|
||||
|
|
|
|||
|
|
@ -63,8 +63,10 @@ class JsonInstall {
|
|||
$table_name = $action["table_name"];
|
||||
if (isset($refs[$table_name])) {
|
||||
foreach ($refs[$table_name] as $value) {
|
||||
$action['fields'][$value['column']]['references'] =
|
||||
$value['refTable']."(".$value['refColumn'].")";
|
||||
$action['fields'][$value['column']]['references'] = [
|
||||
"refTable" => $value['refTable'],
|
||||
'refColumn' => $value['refColumn']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class Manager
|
|||
$constraint = isset($data['constraint']) ? " ".$data['constraint'] : "";
|
||||
$references = "";
|
||||
if (isset($data['references'])) {
|
||||
$references = " REFERENCES ".$data['references'];
|
||||
$references = " REFERENCES " . $data['references']['refTable'] . '(' .$data['references']['refColumn'] . ')';
|
||||
}
|
||||
if (isset($data["not_null"]) && $data["not_null"]) {
|
||||
$constraint .=" NOT NULL";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue