<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20200526104319 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE coin_level_data (id INT AUTO_INCREMENT NOT NULL, created_by INT DEFAULT NULL, modified_by INT DEFAULT NULL, coin_level_data VARCHAR(255) DEFAULT NULL, deleted TINYINT(1) DEFAULT NULL, creation_date DATETIME NOT NULL, modified_date DATETIME DEFAULT NULL, comment LONGTEXT DEFAULT NULL, INDEX IDX_DAC631E4DE12AB56 (created_by), INDEX IDX_DAC631E425F94802 (modified_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE coin_level_data ADD CONSTRAINT FK_DAC631E4DE12AB56 FOREIGN KEY (created_by) REFERENCES user (id)');
$this->addSql('ALTER TABLE coin_level_data ADD CONSTRAINT FK_DAC631E425F94802 FOREIGN KEY (modified_by) REFERENCES user (id)');
$this->addSql('ALTER TABLE hoard ADD coin_level_data_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE hoard ADD CONSTRAINT FK_12E633E67CF0DDA1 FOREIGN KEY (coin_level_data_id) REFERENCES coin_level_data (id)');
$this->addSql('ALTER TABLE hoard_audit ADD coin_level_data_id INT DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE coin_level_data');
$this->addSql('ALTER TABLE hoard DROP coin_level_data_id');
$this->addSql('ALTER TABLE hoard_audit DROP coin_level_data_id');
}
}