Completed
Push — master ( 762e93...98e9e2 )
by Dmitry
32:47 queued 02:55
created

Tracker::migrate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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