- Added a new Field Mapper to SQLs Adapters.

- Defined missing MySQL fields attributes
- WIP on lean-console's migration methods
This commit is contained in:
Dave Mc Nicoll committed 2024-10-21 18:12:24 +00:00
1 parent 5f4f23a8e4
commit 411992c7a8
17 files changed
+214 -8

No files matched your search

+8 -1
View File
@@ -97,7 +97,6 @@ class SQLite implements AdapterInterface, MigrateInterface, SqlAdapterInterface
public function mapFieldType(FieldDefinition $field, bool $typeOnly = false) : string
{
$type = $field->type;
$length = $field->length;
if ( is_a($type, Entity\Field\Date::class, true) || is_a($type, Entity\Field\Time::class, true) || is_a($type, \DateTime::class, true) ) {
@@ -115,6 +114,10 @@ class SQLite implements AdapterInterface, MigrateInterface, SqlAdapterInterface
break;
case "array":
$type = "JSON";
$length = null;
break;
case "string":
$type = "TEXT";
$length = null;
@@ -130,6 +133,10 @@ class SQLite implements AdapterInterface, MigrateInterface, SqlAdapterInterface
}
}
if (in_array($type, [ 'JSON', 'TEXT', 'BLOB', 'GEOMETRY' ])) {
$field->default = "";
}
return $typeOnly ? $type : $type . ( $length ? "($length" . ")" : "" );
}