Completed
Push — feature/test-php-7-2-in-travis ( 027341...a56bae )
by
unknown
05:31
created

Version20141031133057::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.6333
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Surfnet\StepupMiddleware\Migrations;
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 Version20141031133057 extends AbstractMigration
12
{
13
    public function up(Schema $schema)
14
    {
15
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
16
17
        $sql = <<<SQL
18
            CREATE TABLE event_stream (
19
                uuid varchar(36) NOT NULL,
20
                playhead int(11) NOT NULL,
21
                metadata text NOT NULL,
22
                payload text NOT NULL,
23
                recorded_on varchar(32) NOT NULL,
24
                type varchar(150) NOT NULL,
25
                PRIMARY KEY (uuid),
26
                UNIQUE KEY unique_playhead (playhead)
27
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8
28
SQL;
29
30
        $this->addSql($sql);
31
    }
32
33
    public function down(Schema $schema)
34
    {
35
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
36
37
        $this->addSql('DROP TABLE event_stream');
38
    }
39
}
40