2012-09-05 11:23:03 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Application\Migrations;
|
|
|
|
|
|
|
|
use Doctrine\DBAL\Migrations\AbstractMigration,
|
|
|
|
Doctrine\DBAL\Schema\Schema;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Auto-generated Migration: Please modify to your need!
|
|
|
|
*/
|
|
|
|
class Version20120905131921 extends AbstractMigration
|
|
|
|
{
|
|
|
|
public function up(Schema $schema)
|
|
|
|
{
|
|
|
|
// this up() migration is autogenerated, please modify it to your needs
|
|
|
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
|
|
|
|
|
|
|
|
$this->addSql("ALTER TABLE blog_posts ADD draft TINYINT(1) NOT NULL");
|
2012-09-05 13:14:01 +00:00
|
|
|
$this->addSql("UPDATE blog_posts SET draft = 0");
|
2012-09-05 11:23:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function down(Schema $schema)
|
|
|
|
{
|
|
|
|
// this down() migration is autogenerated, please modify it to your needs
|
|
|
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
|
|
|
|
|
|
|
|
$this->addSql("ALTER TABLE blog_posts DROP draft");
|
|
|
|
}
|
|
|
|
}
|