fix: Установка таблиц из json

This commit is contained in:
origami11@yandex.ru 2023-11-16 12:58:28 +03:00
parent fd12f9a2f5
commit ad6efaf36d
3 changed files with 6 additions and 4 deletions

View file

@ -78,7 +78,7 @@ class Installer
if (file_exists($setup) && ($this->isChanged($name) || $force)) {
$registry = $this->_registry;
$settings = new Settings($setup);
$settings->read();

View file

@ -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']
];
}
}

View file

@ -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";