-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathVersion20210209195048.php
32 lines (24 loc) · 1.15 KB
/
Version20210209195048.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
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20210209195048 extends AbstractMigration
{
public function getDescription(): string
{
return 'Use commercial ID in refund workflow instead of order ID.';
}
public function up(Schema $schema): void
{
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE payment_mapping RENAME COLUMN mirakl_order_id TO mirakl_commercial_order_id');
$this->addSql('ALTER TABLE stripe_refund ADD mirakl_commercial_order_id VARCHAR(255)');
}
public function down(Schema $schema): void
{
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE stripe_refund DROP COLUMN mirakl_commercial_order_id');
$this->addSql('ALTER TABLE payment_mapping RENAME COLUMN mirakl_commercial_order_id TO mirakl_order_id');
}
}