<?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 Version20200106055826 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 employee (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, firstName VARCHAR(100) DEFAULT NULL, lastName VARCHAR(100) DEFAULT NULL, active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_5D9F75A1A76ED395 (user_id), INDEX IDX_5D9F75A1B03A8386 (created_by_id), INDEX IDX_5D9F75A1896DBBDE (updated_by_id), FULLTEXT INDEX search (firstName, lastName), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('UPDATE users SET is_active=0 WHERE id=8668');
$this->addSql('UPDATE users SET is_active=0 WHERE id=27570');
$this->addSql('INSERT INTO employee(user_id, firstName, lastName, active, created_by_id, created_at, updated_by_id, updated_at) SELECT users.id, users.name, "", users.is_active, 1, NOW(), 1, NOW() FROM users WHERE users.roles <> "ROLE_USER"');
}
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 employee');
}
}