Added sticky flag to News entity
Signed-off-by: Gergely Polonkai <polesz@w00d5t0ck.info>
This commit is contained in:
29
app/DoctrineMigrations/Version20120819121254.php
Normal file
29
app/DoctrineMigrations/Version20120819121254.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration,
|
||||
Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your need!
|
||||
*/
|
||||
class Version20120819121254 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 news ADD sticky TINYINT(1) NOT NULL");
|
||||
$this->addSql("UPDATE news SET sticky = FALSE");
|
||||
}
|
||||
|
||||
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 news DROP sticky");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user