for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AppBundle\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20170921120747 extends AbstractMigration
{
* @param Schema $schema
public function up(Schema $schema)
// 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 documentation_entry ADD state INT, ADD state_changed_at DATETIME');
$this->addSql('UPDATE documentation_entry SET state = 2, state_changed_at = CURRENT_TIMESTAMP');
$this->addSql('ALTER TABLE documentation_entry CHANGE state state INT NOT NULL, CHANGE state_changed_at state_changed_at DATETIME NOT NULL');
}
public function down(Schema $schema)
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE documentation_entry DROP state, DROP state_changed_at');