DoctrineMigration::up()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.8666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace BWC\Share\Data\Sequence;
4
5
use Doctrine\DBAL\Connection;
6
use Doctrine\DBAL\Migrations\AbstractMigration,
7
    Doctrine\DBAL\Schema\Schema;
8
9
abstract class DoctrineMigration extends AbstractMigration
10
{
11
12
    /**
13
     * @return string
14
     */
15
    abstract function getTableName();
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
17
18
    public function up(Schema $schema)
19
    {
20
        $tbl = $this->getTableName();
21
        /** @var $con Connection */
22
        $con = $this->connection;
23
        $con->exec("CREATE TABLE `{$tbl}` (
24
          `name` varchar(20) NOT NULL,
25
          `value` char(32) NOT NULL,
26
          PRIMARY KEY (`name`,`value`)
27
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci ");
28
29
    }
30
31
    public function down(Schema $schema)
32
    {
33
34
    }
35
}
36