- A lot of fixes made again in this patch
This commit is contained in:
1 parent
4df9ececba
commit
7fb591e1f5
12 files changed
+222
-52
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Query;
|
||||
|
||||
use Ulmus\Annotation,
|
||||
Ulmus\Common\EntityField;
|
||||
|
||||
class Alter extends Fragment {
|
||||
|
||||
const SQL_TOKEN = "ALTER TABLE";
|
||||
|
||||
public string $table;
|
||||
|
||||
public string $engine;
|
||||
|
||||
public int $order = -80;
|
||||
|
||||
public bool $skipExisting = true;
|
||||
|
||||
public array $fieldList;
|
||||
|
||||
public function render() : string
|
||||
{
|
||||
return $this->renderSegments([
|
||||
static::SQL_TOKEN, $this->renderTables($this->table), $this->renderFields(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function renderFields() : string
|
||||
{
|
||||
return "(" . PHP_EOL . implode("," . PHP_EOL, array_map(function($field) {
|
||||
return " " . EntityField::generateAlterColumn($field);
|
||||
}, $this->fieldList)) . PHP_EOL . ")";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user