Version20201126220805   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A down() 0 4 1
A getDescription() 0 3 1
A up() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineMigrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20201126220805 extends AbstractMigration
14
{
15
    public function getDescription() : string
16
    {
17
        return '';
18
    }
19
20
    public function up(Schema $schema) : void
21
    {
22
        // this up() migration is auto-generated, please modify it to your needs
23
        $this->addSql('CREATE TABLE wander_image (wander_id INT NOT NULL, image_id INT NOT NULL, INDEX IDX_69C7253A2F82EC6B (wander_id), INDEX IDX_69C7253A3DA5256D (image_id), PRIMARY KEY(wander_id, image_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
24
        $this->addSql('ALTER TABLE wander_image ADD CONSTRAINT FK_69C7253A2F82EC6B FOREIGN KEY (wander_id) REFERENCES wander (id) ON DELETE CASCADE');
25
        $this->addSql('ALTER TABLE wander_image ADD CONSTRAINT FK_69C7253A3DA5256D FOREIGN KEY (image_id) REFERENCES image (id) ON DELETE CASCADE');
26
    }
27
28
    public function down(Schema $schema) : void
29
    {
30
        // this down() migration is auto-generated, please modify it to your needs
31
        $this->addSql('DROP TABLE wander_image');
32
    }
33
}
34