]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20160410190541.php
Change share entry behavior
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20160410190541.php
CommitLineData
d0545b6b
NL
1<?php
2
3namespace Application\Migrations;
4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema;
a7e2218e
NL
7use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8use Symfony\Component\DependencyInjection\ContainerInterface;
9use Wallabag\CoreBundle\Entity\Entry;
d0545b6b 10
a7e2218e 11class Version20160410190541 extends AbstractMigration implements ContainerAwareInterface
d0545b6b 12{
a7e2218e
NL
13 /**
14 * @var ContainerInterface
15 */
16 private $container;
17
18 public function setContainer(ContainerInterface $container = null)
19 {
20 $this->container = $container;
21 }
22
d0545b6b
NL
23 /**
24 * @param Schema $schema
25 */
26 public function up(Schema $schema)
27 {
a7e2218e 28 $this->addSql('ALTER TABLE `wallabag_entry` ADD `uuid` LONGTEXT DEFAULT NULL');
9a5231e8 29 }
a7e2218e 30
d0545b6b
NL
31 /**
32 * @param Schema $schema
33 */
34 public function down(Schema $schema)
35 {
9a5231e8 36 $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.');
a7e2218e 37 $this->addSql('ALTER TABLE `wallabag_entry` DROP `uuid`');
d0545b6b
NL
38 }
39}