<?php
declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190412072548 extends AbstractMigration
{
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE alpha_update');
$this->addSql('ALTER TABLE system_settings ADD suspension_thresholds LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\'');
$thresholds = 'a:1:{i:0;O:13:"Carbon\\\\Carbon":3:{s:4:"date";s:26:"2018-12-19 09:44:12.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:15:"Europe/Brussels";}}';
$this->addSql('UPDATE system_settings SET suspension_thresholds = \''.$thresholds.'\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE alpha_update (id INT AUTO_INCREMENT NOT NULL, company_id INT DEFAULT NULL, contact_id INT DEFAULT NULL, xml_field VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, property_path VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, backup VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, value VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, decoded LONGBLOB NOT NULL, processed TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:carbondatetime)\', INDEX IDX_6325E973E7A1254A (contact_id), INDEX IDX_6325E973979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE alpha_update ADD CONSTRAINT FK_6325E973979B1AD6 FOREIGN KEY (company_id) REFERENCES non_member_billing_company (id)');
$this->addSql('ALTER TABLE alpha_update ADD CONSTRAINT FK_6325E973E7A1254A FOREIGN KEY (contact_id) REFERENCES non_member_billing_contact_person (id)');
$this->addSql('ALTER TABLE system_settings DROP suspension_thresholds');
}
}