Skip to content

Commit 7edd22e

Browse files
committed
space migration consistency check
1 parent 1d6f791 commit 7edd22e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Space.php

+3
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ public function migrate()
303303
$source = $this->constructor ? $constructor->getParameters() : $reflection->getProperties();
304304

305305
foreach ($source as $property) {
306+
if (in_array($property->getName(), $this->fields)) {
307+
continue;
308+
}
306309
$tarantoolType = match ((string) $property->getType()) {
307310
'bool' => 'boolean',
308311
'float' => 'number',

tests/MapperTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public function testSpaces()
140140
$space = $mapper->createSpace($name);
141141
$space->setClass($type);
142142
$space->migrate();
143+
$space->migrate();
143144

144145
$this->assertSame($space, $mapper->createSpace($name, ['if_not_exists' => true]));
145146
$this->assertSame($space, $mapper->getSpace($space->getId()));

0 commit comments

Comments
 (0)