- Fixed the database interface
This commit is contained in:
parent
23af120020
commit
616d46cdde
|
@ -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),
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue