-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathVersion20190222213409.php
88 lines (77 loc) · 2.41 KB
/
Version20190222213409.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
declare(strict_types=1);
// phpcs:ignoreFile
namespace DoctrineMigrations;
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Override;
/**
* Initial database structure
*/
final class Version20190222213409 extends AbstractMigration
{
/**
* @noinspection PhpMissingParentCallCommonInspection
*/
#[Override]
public function getDescription(): string
{
return 'Initial database structure';
}
/**
* @noinspection PhpMissingParentCallCommonInspection
*/
#[Override]
public function isTransactional(): bool
{
return false;
}
/**
* {@inheritdoc}
*/
#[Override]
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform,
'Migration can only be executed safely on \'mysql\'.'
);
$sql = <<<SQL
CREATE TABLE scheduled_command (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(150) NOT NULL,
command VARCHAR(200) NOT NULL,
arguments LONGTEXT DEFAULT NULL,
cron_expression VARCHAR(200) DEFAULT NULL,
last_execution DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)',
last_return_code INT DEFAULT NULL,
log_file VARCHAR(150) DEFAULT NULL,
priority INT NOT NULL,
execute_immediately TINYINT(1) NOT NULL,
disabled TINYINT(1) NOT NULL,
locked TINYINT(1) NOT NULL,
ping_back_url VARCHAR(255) DEFAULT NULL,
ping_back_failed_url VARCHAR(255) DEFAULT NULL,
notes LONGTEXT NOT NULL,
version INT DEFAULT 1 NOT NULL,
created_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)',
UNIQUE INDEX UNIQ_EA0DBC905E237E06 (name),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB
SQL;
$this->addSql($sql);
$this->addSql('ALTER TABLE scheduled_command ');
}
#[Override]
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
!$this->connection->getDatabasePlatform() instanceof AbstractMySQLPlatform,
'Migration can only be executed safely on \'mysql\'.'
);
$this->addSql('DROP TABLE scheduled_command');
}
}