- WIP on SQLite migration
This commit is contained in:
parent
eda0ee6f33
commit
f9229b890d
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Lean\Console\Entity;
|
||||||
|
|
||||||
|
use Ulmus\Common\EntityField;
|
||||||
|
use Ulmus\Entity\Field\Datetime,
|
||||||
|
Ulmus\Entity\InformationSchema;
|
||||||
|
use Ulmus\EntityCollection;
|
||||||
|
use Ulmus\Migration\FieldDefinition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Table('name' => "columns", 'database' => "information_schema")
|
||||||
|
*/
|
||||||
|
class Column extends InformationSchema\Column
|
||||||
|
{
|
||||||
|
|
||||||
|
public function differsFromFieldDefinition(FieldDefinition $definition) : bool
|
||||||
|
{
|
||||||
|
switch(true) {
|
||||||
|
//case $definition->
|
||||||
|
|
||||||
|
// return true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* public static function entityCollection(...$arguments) : EntityCollection
|
||||||
|
{
|
||||||
|
return new class(...$arguments) extends EntityCollection
|
||||||
|
{
|
||||||
|
public function getEntityData() : array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
|
||||||
|
];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
|
@ -38,11 +38,11 @@ class DatabaseMigration implements FormInterface
|
||||||
$tableEntity = $adapter->schemaTable($connection, $databaseName, $tableName);
|
$tableEntity = $adapter->schemaTable($connection, $databaseName, $tableName);
|
||||||
|
|
||||||
if ( $tableEntity ) {
|
if ( $tableEntity ) {
|
||||||
foreach($tableEntity->columns as $field => $definition) {
|
#foreach($tableEntity->columns as $field => $definition) {
|
||||||
# if ( $table->columns->filtersCollection(fn($e) => $e->name === $field)->count() === 0 ) {
|
# if ( $table->columns->filtersCollection(fn($e) => $e->name === $field)->count() === 0 ) {
|
||||||
# $alter[$field] = $definition;
|
# $alter[$field] = $definition;
|
||||||
#}
|
#
|
||||||
}
|
#}
|
||||||
|
|
||||||
$alter =false;
|
$alter =false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue