<?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 Version20190513142752 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
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('ALTER TABLE event_store CHANGE data data VARCHAR(21000) DEFAULT NULL');
$this->addSql('ALTER TABLE gym_circuit ADD training_session_id INT NOT NULL, ADD `order` INT NOT NULL, ADD `round` INT DEFAULT NULL, ADD `rest` INT DEFAULT NULL');
$this->addSql('ALTER TABLE gym_circuit ADD CONSTRAINT FK_B7573744DB8156B9 FOREIGN KEY (training_session_id) REFERENCES training_session (id)');
$this->addSql('CREATE INDEX IDX_B7573744DB8156B9 ON gym_circuit (training_session_id)');
$this->addSql('ALTER TABLE gym_circuit_detail ADD `order` INT NOT NULL, ADD `um_type` VARCHAR(255) DEFAULT NULL COMMENT \'(DC2Type:um_type)\', ADD `value` INT NOT NULL, ADD `rest` INT DEFAULT NULL');
$this->addSql('ALTER TABLE membership_manager CHANGE type_manager `type_manager` VARCHAR(255) NOT NULL COMMENT \'(DC2Type:membership_type_manager)\'');
$this->addSql('ALTER TABLE training_program CHANGE user_id `user_id` VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE training_session CHANGE `order` `order` INT NOT NULL');
}
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('ALTER TABLE event_store CHANGE data data VARCHAR(10000) DEFAULT NULL COLLATE utf8_unicode_ci');
$this->addSql('ALTER TABLE gym_circuit DROP FOREIGN KEY FK_B7573744DB8156B9');
$this->addSql('DROP INDEX IDX_B7573744DB8156B9 ON gym_circuit');
$this->addSql('ALTER TABLE gym_circuit DROP training_session_id, DROP `order`, DROP `round`, DROP `rest`');
$this->addSql('ALTER TABLE gym_circuit_detail DROP `order`, DROP `um_type`, DROP `value`, DROP `rest`');
$this->addSql('ALTER TABLE membership_manager CHANGE `type_manager` type_manager VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci COMMENT \'(DC2Type:membership_status)\'');
$this->addSql('ALTER TABLE training_program CHANGE `user_id` user_id VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci');
$this->addSql('ALTER TABLE training_session CHANGE `order` `order` VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci');
}
}