- Fixed the database interface

This commit is contained in:
Dave M. 2022-05-15 02:41:49 +00:00
parent 23af120020
commit 616d46cdde
1 changed files with 6 additions and 5 deletions

View File

@ -24,6 +24,8 @@ class Database implements FormInterface
$context->tableExist = [];
foreach($this->migration->entities as $entity => $table) {
$adapter = $entity::resolveEntity()->sqlAdapter()->adapter();
$tableName = $table->tableName();
$databaseName = $table->databaseName();
@ -31,14 +33,12 @@ class Database implements FormInterface
continue;
}
$table = Table::repository()->where(Table::field('name'), $table->tableName())
->where(Table::field('schema'), $table->databaseName())
->loadOne();
$tableEntity = $adapter->schemaTable($databaseName, $tableName);
if ( $table ) {
if ( $tableEntity ) {
#$fields = $entiy::resolveEntity()->fieldList();
foreach($table->columns as $col) {
foreach($tableEntity->columns as $col) {
//dump( $entity::field($col->name) );
}
@ -53,6 +53,7 @@ class Database implements FormInterface
'msg' => "unexisting",
'query' => $entity::repository()->createSqlQuery()->getSqlQuery(true),
];
}
}