Completed
Push — master ( c1fc0d...a7d98d )
by Dmitry
28:31 queued 26:01
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 5
Bugs 0 Features 1
Metric Value
c 5
b 0
f 1
dl 0
loc 13
ccs 10
cts 10
cp 1
rs 9.4285
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 62
    public function migrate(Contracts\Manager $manager)
10
    {
11 62
        if (!$manager->getSchema()->hasSpace('meta')) {
12 62
            $migration = new Bootstrap();
13 62
            $migration->migrate($manager);
14 62
        }
15
16 62
        $migration = $manager->getMeta()->create('migrations', ['name']);
17 62
        $migration->addIndex('name');
18
19 62
        $manager->create('migrations', Bootstrap::class);
20 62
        $manager->create('migrations', self::class);
21 62
    }
22
}
23