@@ -850,19 +850,22 @@ private function exportDatabases(int $batchSize, array $resources = []): void
850850 $ response = $ this ->reader ->listDatabases ($ queries );
851851
852852 foreach ($ response as $ database ) {
853- $ databaseType = $ database ['type ' ];
854- if (in_array ($ databaseType , [Resource::TYPE_DATABASE_LEGACY ,Resource::TYPE_DATABASE_TABLESDB ])) {
855- $ databaseType = Resource::TYPE_DATABASE ;
853+ $ originalType = $ database ['type ' ] ?? Resource::TYPE_DATABASE_LEGACY ;
854+
855+ $ databaseFamilyType = $ originalType ;
856+ if (\in_array ($ databaseFamilyType , [Resource::TYPE_DATABASE_LEGACY , Resource::TYPE_DATABASE_TABLESDB ], true )) {
857+ $ databaseFamilyType = Resource::TYPE_DATABASE ;
856858 }
857- if (Resource::isSupported ($ databaseType , $ resources )) {
858- $ newDatabase = self ::getDatabase ($ databaseType , [
859+
860+ if (Resource::isSupported ($ databaseFamilyType , $ resources )) {
861+ $ newDatabase = self ::getDatabase ($ databaseFamilyType , [
859862 'id ' => $ database ['$id ' ],
860863 'name ' => $ database ['name ' ],
861864 'createdAt ' => $ database ['$createdAt ' ],
862865 'updatedAt ' => $ database ['$updatedAt ' ],
866+ 'type ' => $ originalType ,
867+ 'database ' => $ database ['database ' ],
863868 'enabled ' => $ database ['enabled ' ] ?? true ,
864- 'type ' => $ databaseType ,
865- 'database ' => $ database ['database ' ]
866869 ]);
867870 $ databases [] = $ newDatabase ;
868871
0 commit comments