<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200330102037 extends AbstractMigration
{
/**
* @return string
*/
public function getDescription(): string
{
return '';
}
/**
* @param Schema $schema
*
* @throws \Doctrine\DBAL\DBALException
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() !== 'postgresql',
'Migration can only be executed safely on \'postgresql\'.'
);
$this->addSql('ALTER TABLE devices ADD calibrated_at DATE DEFAULT NULL');
}
/**
* @param Schema $schema
*
* @throws \Doctrine\DBAL\DBALException
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
$this->connection->getDatabasePlatform()->getName() !== 'postgresql',
'Migration can only be executed safely on \'postgresql\'.'
);
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE devices DROP calibrated_at');
}
}