|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the G.L.S.R. Apps package. |
|
7
|
|
|
* |
|
8
|
|
|
* (c) Dev-Int Création <[email protected]>. |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
11
|
|
|
* file that was distributed with this source code. |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
namespace Administration\Infrastructure\DoctrineMigrations; |
|
15
|
|
|
|
|
16
|
|
|
use Doctrine\DBAL\Schema\Schema; |
|
17
|
|
|
use Doctrine\Migrations\AbstractMigration; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Auto-generated Migration: Please modify to your needs! |
|
21
|
|
|
*/ |
|
22
|
|
|
final class Version20201206170233 extends AbstractMigration |
|
23
|
|
|
{ |
|
24
|
|
|
public function getDescription(): string |
|
25
|
|
|
{ |
|
26
|
|
|
return 'Create company table and Messenger installation.'; |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
public function up(Schema $schema): void |
|
30
|
|
|
{ |
|
31
|
|
|
// this up() migration is auto-generated, please modify it to your needs |
|
32
|
|
|
$this->addSql( |
|
33
|
|
|
'CREATE TABLE company (' . |
|
34
|
|
|
'uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:guid)\', ' . |
|
35
|
|
|
'name VARCHAR(150) NOT NULL, ' . |
|
36
|
|
|
'address VARCHAR(255) NOT NULL, ' . |
|
37
|
|
|
'phone VARCHAR(255) NOT NULL, ' . |
|
38
|
|
|
'facsimile VARCHAR(255) DEFAULT NULL, ' . |
|
39
|
|
|
'email VARCHAR(255) NOT NULL, ' . |
|
40
|
|
|
'contact VARCHAR(255) NOT NULL, ' . |
|
41
|
|
|
'cellphone VARCHAR(255) NOT NULL, ' . |
|
42
|
|
|
'PRIMARY KEY(uuid)' . |
|
43
|
|
|
') DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB' |
|
44
|
|
|
); |
|
45
|
|
|
$this->addSql( |
|
46
|
|
|
'CREATE TABLE messenger_messages (' . |
|
47
|
|
|
'id BIGINT AUTO_INCREMENT NOT NULL, ' . |
|
48
|
|
|
'body LONGTEXT NOT NULL, ' . |
|
49
|
|
|
'headers LONGTEXT NOT NULL, ' . |
|
50
|
|
|
'queue_name VARCHAR(190) NOT NULL, ' . |
|
51
|
|
|
'created_at DATETIME NOT NULL, ' . |
|
52
|
|
|
'available_at DATETIME NOT NULL, ' . |
|
53
|
|
|
'delivered_at DATETIME DEFAULT NULL, ' . |
|
54
|
|
|
'INDEX IDX_75EA56E0FB7336F0 (queue_name), ' . |
|
55
|
|
|
'INDEX IDX_75EA56E0E3BD61CE (available_at), ' . |
|
56
|
|
|
'INDEX IDX_75EA56E016BA31DB (delivered_at), ' . |
|
57
|
|
|
'PRIMARY KEY(id)' . |
|
58
|
|
|
') DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB' |
|
59
|
|
|
); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function down(Schema $schema): void |
|
63
|
|
|
{ |
|
64
|
|
|
// this down() migration is auto-generated, please modify it to your needs |
|
65
|
|
|
$this->addSql('DROP TABLE company'); |
|
66
|
|
|
$this->addSql('DROP TABLE messenger_messages'); |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|