Completed
Push — master ( e7f8de...7e52b4 )
by Dmitry
03:22
created

Tracker::migrate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 13
ccs 10
cts 10
cp 1
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 8
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Tarantool\Mapper\Migrations;
4
5
use Tarantool\Mapper\Contracts;
6
7
class Tracker implements Contracts\Migration
8
{
9 64
    public function migrate(Contracts\Manager $manager)
10
    {
11 64
        if (!$manager->getSchema()->hasSpace('meta')) {
12 64
            $migration = new Bootstrap();
13 64
            $migration->migrate($manager);
14 64
        }
15
16 64
        $migration = $manager->getMeta()->create('migrations', ['name']);
17 64
        $migration->addIndex('name');
18
19 64
        $manager->create('migrations', Bootstrap::class);
20 64
        $manager->create('migrations', self::class);
21 64
    }
22
}
23