Completed
Pull Request — master (#1663)
by chihiro
20:50
created

Version20160803143037::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace DoctrineMigrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
use Doctrine\ORM\Tools\SchemaTool;
8
9
/**
10
 * Auto-generated Migration: Please modify to your needs!
11
 */
12
class Version20160803143037 extends AbstractMigration
13
{
14
    /**
15
     * @param Schema $schema
16
     */
17
    public function up(Schema $schema)
18
    {
19
        if ($schema->hasTable('dtb_plugin_option')) {
20
            return;
21
        }
22
        $app = \Eccube\Application::getInstance();
23
        $meta = $app['orm.em']->getMetadataFactory()->getMetadataFor('Eccube\Entity\PluginOption');
24
        $tool = new SchemaTool($app['orm.em']);
25
        $tool->createSchema(array($meta));
26
    }
27
28
    /**
29
     * @param Schema $schema
30
     */
31
    public function down(Schema $schema)
32
    {
33
        // this down() migration is auto-generated, please modify it to your needs
34
35
    }
36
}
37