Completed
Push — 1.10.x ( 2635b5...f0080b )
by Yannick
165:55 queued 120:08
created

Version20150527114220   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Application\Migrations\Schema\V110;
5
6
use Application\Migrations\AbstractMigrationChamilo;
7
use Doctrine\DBAL\Schema\Schema;
8
9
/**
10
 * Class Version20150527114220
11
 * Lp category
12
 * @package Application\Migrations\Schema\V11010
13
 */
14
class Version20150527114220 extends AbstractMigrationChamilo
15
{
16
    /**
17
     * @param Schema $schema
18
     */
19
    public function up(Schema $schema)
20
    {
21
        $this->addSql('CREATE TABLE c_lp_category (iid INT AUTO_INCREMENT NOT NULL, c_id INT NOT NULL, name VARCHAR(255) NOT NULL, position INT NOT NULL, PRIMARY KEY(iid)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
22
        $this->addSql('ALTER TABLE c_lp ADD category_id INT NOT NULL DEFAULT 0');
23
    }
24
25
    /**
26
     * @param Schema $schema
27
     */
28
    public function down(Schema $schema)
29
    {
30
        $this->addSql('DROP TABLE c_lp_category');
31
        $this->addSql('ALTER TABLE c_lp DROP category_id');
32
    }
33
}
34