1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace SWP\Migrations; |
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
|
|
View Code Duplication |
final class Version20190320142338 extends AbstractMigration |
14
|
|
|
{ |
15
|
|
|
public function up(Schema $schema): void |
16
|
|
|
{ |
17
|
|
|
// this up() migration is auto-generated, please modify it to your needs |
18
|
|
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); |
19
|
|
|
|
20
|
|
|
$this->addSql('ALTER TABLE swp_item ADD body_text TEXT DEFAULT NULL'); |
21
|
|
|
$this->addSql('ALTER TABLE swp_item ADD usage_terms VARCHAR(255) DEFAULT NULL'); |
22
|
|
|
$this->addSql('ALTER TABLE swp_item ADD copyright_notice VARCHAR(255) DEFAULT NULL'); |
23
|
|
|
$this->addSql('ALTER TABLE swp_item ADD copyright_holder VARCHAR(255) DEFAULT NULL'); |
24
|
|
|
$this->addSql('ALTER TABLE swp_article_media ADD headline TEXT DEFAULT NULL'); |
25
|
|
|
$this->addSql('ALTER TABLE swp_article_media ADD copyright_notice VARCHAR(255) DEFAULT NULL'); |
26
|
|
|
$this->addSql('ALTER TABLE swp_article_media ADD copyright_holder VARCHAR(255) DEFAULT NULL'); |
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('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); |
33
|
|
|
|
34
|
|
|
$this->addSql('ALTER TABLE swp_item DROP body_text'); |
35
|
|
|
$this->addSql('ALTER TABLE swp_item DROP usage_terms'); |
36
|
|
|
$this->addSql('ALTER TABLE swp_item DROP copyright_notice'); |
37
|
|
|
$this->addSql('ALTER TABLE swp_item DROP copyright_holder'); |
38
|
|
|
$this->addSql('ALTER TABLE swp_article_media DROP headline'); |
39
|
|
|
$this->addSql('ALTER TABLE swp_article_media DROP copyright_notice'); |
40
|
|
|
$this->addSql('ALTER TABLE swp_article_media DROP copyright_holder'); |
41
|
|
|
} |
42
|
|
|
} |
43
|
|
|
|