Failed Conditions
Push — master ( bb033c...020e7f )
by Kentaro
40:09
created

Version20160823140932   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 11 2
A down() 0 5 1
1
<?php
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
8
/**
9
 * Auto-generated Migration: Please modify to your needs!
10
 */
11
class Version20160823140932 extends AbstractMigration
12
{
13
    /**
14
     * @param Schema $schema
15
     */
16
    public function up(Schema $schema)
17
    {
18
        if ($this->platform->getName() == 'postgresql') {
19
            $qb = $this->connection->createQueryBuilder();
20
            $max = $qb->select('max(id) + 1')
21
                ->from('dtb_help')
22
                ->execute()
23
                ->fetchColumn();
24
            $this->addSql("SELECT setval('dtb_help_id_seq', $max);");
25
        }
26
    }
27
28
    /**
29
     * @param Schema $schema
30
     */
31
    public function down(Schema $schema)
32
    {
33
        // this down() migration is auto-generated, please modify it to your needs
34
35
    }
36
}
37