Completed
Push — Recipes ( c0466a...7632b6 )
by Laurent
04:22
created

Version20190316165851::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
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 Version20190316165851 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
24
25
        $this->addSql('CREATE TABLE app_supplier (id INT AUTO_INCREMENT NOT NULL, family_log_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, zipcode VARCHAR(5) NOT NULL, town VARCHAR(255) NOT NULL, phone VARCHAR(35) NOT NULL COMMENT \'(DC2Type:phone_number)\', fax VARCHAR(35) NOT NULL COMMENT \'(DC2Type:phone_number)\', mail VARCHAR(255) NOT NULL, contact VARCHAR(255) NOT NULL, gsm VARCHAR(35) NOT NULL COMMENT \'(DC2Type:phone_number)\', delaydeliv SMALLINT NOT NULL, orderdate LONGTEXT NOT NULL COMMENT \'(DC2Type:simple_array)\', active TINYINT(1) NOT NULL, slug VARCHAR(128) NOT NULL, UNIQUE INDEX UNIQ_93AA0CD3989D9B62 (slug), INDEX IDX_93AA0CD323570A93 (family_log_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
26
        $this->addSql('ALTER TABLE app_supplier ADD CONSTRAINT FK_93AA0CD323570A93 FOREIGN KEY (family_log_id) REFERENCES app_familylog (id)');
27
    }
28
29
    public function down(Schema $schema) : void
30
    {
31
        // this down() migration is auto-generated, please modify it to your needs
32
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
33
34
        $this->addSql('DROP TABLE app_supplier');
35
    }
36
}
37