- Field mapper is now removed from Adapters and set into it's own object
- Added a PK to Column (IS)
This commit is contained in:
1 parent
9977a25cf5
commit
3c2ae86653
7 files changed
+168
-57
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Ulmus\Adapter;
|
||||
|
||||
use Ulmus\Migration\FieldDefinition;
|
||||
use Ulmus\Migration\MigrateInterface;
|
||||
use Ulmus\QueryBuilder\Sql;
|
||||
use Ulmus\Common\PdoObject;
|
||||
@@ -136,7 +137,14 @@ class MySQL implements AdapterInterface, MigrateInterface, SqlAdapterInterface {
|
||||
}
|
||||
}
|
||||
|
||||
public function escapeIdentifier(string $segment, int $type) : string
|
||||
public function mapFieldType(FieldDefinition $field, bool $typeOnly = false) : string
|
||||
{
|
||||
$mapper = new MySQLFieldMapper($field);
|
||||
|
||||
return $typeOnly ? $mapper->type : $mapper->render();
|
||||
}
|
||||
|
||||
public static function escapeIdentifier(string $segment, int $type) : string
|
||||
{
|
||||
switch($type) {
|
||||
case static::IDENTIFIER_DATABASE:
|
||||
@@ -158,5 +166,4 @@ class MySQL implements AdapterInterface, MigrateInterface, SqlAdapterInterface {
|
||||
{
|
||||
return Sql\MysqlQueryBuilder::class;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user