Merge branch 'master' of https://git.mcnd.ca/mcndave/lean-console
This commit is contained in:
		
						commit
						9c5cf3d1b1
					
				| @ -25,6 +25,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(); | ||||
| 
 | ||||
| @ -32,20 +34,30 @@ class Database implements FormInterface | ||||
|                 continue; | ||||
|             } | ||||
| 
 | ||||
|             $table = Table::repository() | ||||
|                 ->where(Table::field('name'), $table->tableName()) | ||||
|                 ->where(Table::field('schema'), $table->databaseName()) | ||||
|                 ->loadOne(); | ||||
| #<<<<<<< HEAD
 | ||||
|             $tableEntity = $adapter->schemaTable($databaseName, $tableName); | ||||
| 
 | ||||
|             if ( $table ) { | ||||
|                 $fields = $entity::resolveEntity()->fieldList(EntityResolver::KEY_COLUMN_NAME, true); | ||||
|             if ( $tableEntity ) { | ||||
|                 #$fields = $entiy::resolveEntity()->fieldList();
 | ||||
| 
 | ||||
|                 $alter = []; | ||||
|                 foreach($tableEntity->columns as $col) { | ||||
|                    //dump( $entity::field($col->name) );
 | ||||
| #=======
 | ||||
| #            $table = Table::repository()
 | ||||
| #                ->where(Table::field('name'), $table->tableName())
 | ||||
| #                ->where(Table::field('schema'), $table->databaseName())
 | ||||
| #                ->loadOne();
 | ||||
| 
 | ||||
|                 foreach($fields as $field => $definition) { | ||||
|                     if ( $table->columns->filtersCollection(fn($e) => $e->name === $field)->count() === 0 ) { | ||||
|                         $alter[$field] = $definition; | ||||
|                     } | ||||
| #            if ( $table ) {
 | ||||
| #                $fields = $entity::resolveEntity()->fieldList(EntityResolver::KEY_COLUMN_NAME, true);
 | ||||
| 
 | ||||
| #                $alter = [];
 | ||||
| 
 | ||||
| #                foreach($fields as $field => $definition) {
 | ||||
| #                    if ( $table->columns->filtersCollection(fn($e) => $e->name === $field)->count() === 0 ) {
 | ||||
| #                        $alter[$field] = $definition;
 | ||||
| #                    }
 | ||||
| #>>>>>>> 7194a33bec884d745e838c8ac2693b353e95a3ce
 | ||||
|                 } | ||||
| 
 | ||||
|                 if ( $alter ) { | ||||
| @ -67,6 +79,7 @@ class Database implements FormInterface | ||||
|                     'msg' => "unexisting", | ||||
|                     'query' => $entity::repository()->createSqlQuery()->getSqlQuery(true), | ||||
|                 ]; | ||||
| 
 | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
| @ -106,4 +119,4 @@ class Database implements FormInterface | ||||
|             public array $actions = []; | ||||
|         }; | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user