From f9229b890d00e9c5dd711f7ae24715c56f66caf0 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Mon, 27 Mar 2023 18:39:20 +0000 Subject: [PATCH] - WIP on SQLite migration --- src/Entity/Column.php | 44 ++++++++++++++++++++++++++ src/Form/Storage/DatabaseMigration.php | 6 ++-- 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 src/Entity/Column.php diff --git a/src/Entity/Column.php b/src/Entity/Column.php new file mode 100644 index 0000000..b498fc8 --- /dev/null +++ b/src/Entity/Column.php @@ -0,0 +1,44 @@ + "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 [ + + ]; + } + }; + } +*/ + +} \ No newline at end of file diff --git a/src/Form/Storage/DatabaseMigration.php b/src/Form/Storage/DatabaseMigration.php index 43867de..e70158c 100644 --- a/src/Form/Storage/DatabaseMigration.php +++ b/src/Form/Storage/DatabaseMigration.php @@ -38,11 +38,11 @@ class DatabaseMigration implements FormInterface $tableEntity = $adapter->schemaTable($connection, $databaseName, $tableName); 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 ) { # $alter[$field] = $definition; - #} - } + # + #} $alter =false;