diff --git a/src/Space.php b/src/Space.php index 66ad5b6..4cb7beb 100644 --- a/src/Space.php +++ b/src/Space.php @@ -303,6 +303,9 @@ public function migrate() $source = $this->constructor ? $constructor->getParameters() : $reflection->getProperties(); foreach ($source as $property) { + if (in_array($property->getName(), $this->fields)) { + continue; + } $tarantoolType = match ((string) $property->getType()) { 'bool' => 'boolean', 'float' => 'number', diff --git a/tests/MapperTest.php b/tests/MapperTest.php index a82ba3c..9726852 100644 --- a/tests/MapperTest.php +++ b/tests/MapperTest.php @@ -140,6 +140,7 @@ public function testSpaces() $space = $mapper->createSpace($name); $space->setClass($type); $space->migrate(); + $space->migrate(); $this->assertSame($space, $mapper->createSpace($name, ['if_not_exists' => true])); $this->assertSame($space, $mapper->getSpace($space->getId()));