(fix): backfill null migration generation IDs

This commit is contained in:
Jake Barnby committed 2026-07-20 22:46:48 +12:00
1 parent 22800b14d9
commit 1d94059ce3
2 files changed
+6 -2

No files matched your search

+2 -2
View File
@@ -200,13 +200,13 @@ class V25 extends Migration
}
if (
$document->getAttribute('parentResourceInternalId', '') === ''
(string) $document->getAttribute('parentResourceInternalId', '') === ''
&& isset($internalIds['parentResourceInternalId'])
) {
$document->setAttribute('parentResourceInternalId', $internalIds['parentResourceInternalId']);
}
if (
$document->getAttribute('resourceInternalId', '') === ''
(string) $document->getAttribute('resourceInternalId', '') === ''
&& isset($internalIds['resourceInternalId'])
) {
$document->setAttribute('resourceInternalId', $internalIds['resourceInternalId']);
+4
View File
@@ -33,7 +33,9 @@ final class V25Test extends TestCase
'$id' => 'migration',
'$collection' => 'migrations',
'resourceId' => 'database:collection',
'resourceInternalId' => null,
'resourceType' => Resource::TYPE_DATABASE,
'parentResourceInternalId' => null,
]);
$result = $migration->migrate($document);
@@ -84,7 +86,9 @@ final class V25Test extends TestCase
'$id' => 'migration',
'$collection' => 'migrations',
'resourceId' => 'database:collection',
'resourceInternalId' => null,
'resourceType' => Resource::TYPE_DATABASE,
'parentResourceInternalId' => null,
]);
$migration->migrate($document);