CreateMigrationTableMigration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 17 1
1
<?php
2
3
namespace RDV\Bundle\MigrationBundle\Migration;
4
5
use Doctrine\DBAL\Schema\Schema;
6
7
class CreateMigrationTableMigration implements Migration
8
{
9
    /**
10
     * @inheritdoc
11
     */
12
    public function up(Schema $schema, QueryBag $queries)
13
    {
14
        $table = $schema->createTable(Tables::MIGRATION_TABLE);
15
        $table->addColumn('id', 'integer', ['notnull' => true, 'autoincrement' => true]);
16
        $table->addColumn('bundle', 'string', ['notnull' => true, 'length' => 250]);
17
        $table->addColumn('version', 'string', ['notnull' => true, 'length' => 250]);
18
        $table->addColumn('loaded_at', 'datetime', ['notnull' => true]);
19
        $table->setPrimaryKey(['id']);
20
        $table->addIndex(['bundle'], 'idx_rdv_migrations', []);
21
22
        $table = $schema->createTable(Tables::MIGRATION_DATA_TABLE);
23
        $table->addColumn('id', 'integer', ['notnull' => true, 'autoincrement' => true]);
24
        $table->addColumn('class_name', 'string', ['default' => null, 'notnull' => true, 'length' => 255]);
25
        $table->addColumn('loaded_at', 'datetime', ['notnull' => true]);
26
        $table->addColumn('version', 'string', ['notnull' => false, 'length' => 255]);
27
        $table->setPrimaryKey(['id']);
28
    }
29
}
30