- Merged stash after pull
This commit is contained in:
1 parent
114fa5be09
commit
efa957fe58
20 files changed
+623
-436
No files matched your search
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Query;
|
||||
|
||||
use Ulmus\Annotation,
|
||||
Ulmus\Common\EntityField;
|
||||
|
||||
|
||||
class Create extends Fragment {
|
||||
|
||||
const SQL_TOKEN = "CREATE 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::generateCreateColumn($field);
|
||||
}, $this->fieldList)) . PHP_EOL . ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Query;
|
||||
|
||||
class Engine extends Fragment {
|
||||
|
||||
const SQL_TOKEN = "ENGINE";
|
||||
|
||||
public int $order = 80;
|
||||
|
||||
public string $engine;
|
||||
|
||||
public function render() : string
|
||||
{
|
||||
return $this->renderSegments([
|
||||
static::SQL_TOKEN, $this->engine,
|
||||
], "=");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user