-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathVersion20200329141302.php
35 lines (27 loc) · 1.72 KB
/
Version20200329141302.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
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20200329141302 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE SEQUENCE mirakl_refund_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE mirakl_refund (id INT NOT NULL, amount INT NOT NULL, currency VARCHAR(255) NOT NULL, mirakl_refund_id VARCHAR(255) NOT NULL, mirakl_order_id VARCHAR(255) NOT NULL, stripe_refund_id VARCHAR(255) DEFAULT NULL, stripe_reversal_id VARCHAR(255) DEFAULT NULL, status VARCHAR(255) NOT NULL, failed_reason VARCHAR(1024) NULL, mirakl_validation_time TIMESTAMP(0) WITHOUT TIME ZONE NULL, creation_datetime TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, modification_datetime TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B19DB5F748568E43 ON mirakl_refund (mirakl_refund_id)');
}
public function down(Schema $schema): void
{
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE SCHEMA IF NOT EXISTS public');
$this->addSql('DROP INDEX UNIQ_B19DB5F748568E43');
$this->addSql('DROP SEQUENCE mirakl_refund_id_seq CASCADE');
$this->addSql('DROP TABLE mirakl_refund');
}
}