<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20140804125245 extends AbstractMigration
{
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 job CHANGE notice_date job_active_from DATETIME NOT NULL');
$this->addSql('ALTER TABLE user ADD customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6499395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('CREATE INDEX IDX_8D93D6499395C3F3 ON user (customer_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('ALTER TABLE job CHANGE job_active_from notice_date DATETIME NOT NULL');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6499395C3F3');
$this->addSql('DROP INDEX IDX_8D93D6499395C3F3 ON user');
$this->addSql('ALTER TABLE user DROP customer_id');
}
}