nur-sery/nur_src/m/pdo/mysql/MysqlUpdateMigrationsApp.php

41 lines
1.2 KiB
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?php
namespace nur\m\pdo\mysql;
use nur\m\cli\UpdateMigrationsApp;
class MysqlUpdateMigrationsApp extends UpdateMigrationsApp {
protected function migrate(array $params) {
$class = $params["class"];
$overwrite = $params["overwrite"];
$verbose = $params["verbose"];
$basedir = $params["basedir"];
if ($params["do_sql"]) {
MysqlMigrations::gensql($class, [
"overwrite" => $overwrite,
"verbose" => $verbose,
"destdir" => "$basedir/$params[sql_dir]",
"prefix" => $params["sql_prefix"],
"trace" => [$this, "trace"],
]);
}
if ($params["do_class"]) {
MysqlMigrations::genclass($class, [
"overwrite" => $overwrite,
"verbose" => $verbose,
"destdir" => "$basedir/$params[class_dir]",
"package" => $params["class_package"],
"baserow" => $params["class_baserow"],
"trace" => [$this, "trace"],
]);
}
2024-06-14 11:25:34 +04:00
if ($params["do_doc"]) {
MysqlMigrations::gendoc($class, [
"overwrite" => $overwrite,
"verbose" => $verbose,
"destdir" => "$basedir/$params[doc_dir]",
"trace" => [$this, "trace"],
]);
}
2023-12-03 22:10:18 +04:00
}
}