<?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 Version20200125234132 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('CREATE TABLE action_comment (id INT AUTO_INCREMENT NOT NULL, action_id INT NOT NULL, content LONGTEXT NOT NULL, INDEX IDX_4ED6DA8D9D32F035 (action_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE action_comment ADD CONSTRAINT FK_4ED6DA8D9D32F035 FOREIGN KEY (action_id) REFERENCES action (id)');
$this->addSql('ALTER TABLE resource CHANGE notification_book_ac notification_book_ac TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE action ADD assigned_id INT DEFAULT NULL, ADD reminder DATETIME DEFAULT NULL, ADD completed TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE action ADD CONSTRAINT FK_47CC8C92E1501A05 FOREIGN KEY (assigned_id) REFERENCES fos_user (id)');
$this->addSql('CREATE INDEX IDX_47CC8C92E1501A05 ON action (assigned_id)');
}
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 action_comment');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY FK_47CC8C92E1501A05');
$this->addSql('DROP INDEX IDX_47CC8C92E1501A05 ON action');
$this->addSql('ALTER TABLE action DROP assigned_id, DROP reminder, DROP completed');
$this->addSql('ALTER TABLE resource CHANGE notification_book_ac notification_book_ac TINYINT(1) NOT NULL');
}
}