Version20160214210556   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 14 1
A down() 0 5 1
1
<?php
2
3
namespace T3Botmigrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
use Doctrine\DBAL\Types\Type;
8
9
/**
10
 * Auto-generated Migration: Please modify to your needs!
11
 */
12
class Version20160214210556 extends AbstractMigration
13
{
14
    /**
15
     * @param Schema $schema
16
     */
17
    public function up(Schema $schema)
18
    {
19
        // create notifications table
20
        $notificationsTable = $schema->createTable('notifications');
21
        $notificationsTable->addColumn('id', Type::INTEGER, ['unsigned' => true])->setAutoincrement(true);
22
        $notificationsTable->addColumn('from_user', Type::STRING, ['length' => 32]);
23
        $notificationsTable->addColumn('to_user', Type::STRING, ['length' => 32]);
24
        $notificationsTable->addColumn('message', Type::TEXT);
25
        $notificationsTable->addColumn('created', Type::DATETIME, [
26
            'columnDefinition' => 'timestamp default current_timestamp',
27
        ]);
28
        $notificationsTable->addColumn('delivered', Type::DATETIME);
29
        $notificationsTable->setPrimaryKey(['id']);
30
    }
31
32
    /**
33
     * @param Schema $schema
34
     */
35
    public function down(Schema $schema)
36
    {
37
        // Drop notidications table
38
        $schema->dropTable('notifications');
39
    }
40
}
41