]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20161106113822.php
Added a configuration to define the redirection after archiving an entry
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20161106113822.php
CommitLineData
a42f38d9
NL
1<?php
2
3namespace Application\Migrations;
4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema;
7
8class Version20161106113822 extends AbstractMigration
9{
10 /**
11 * @var ContainerInterface
12 */
13 private $container;
14
15 public function setContainer(ContainerInterface $container = null)
16 {
17 $this->container = $container;
18 }
19
20 private function getTable($tableName)
21 {
22 return $this->container->getParameter('database_table_prefix') . $tableName;
23 }
24
25 /**
26 * @param Schema $schema
27 */
28 public function up(Schema $schema)
29 {
30 $this->addSql('ALTER TABLE "'.$this->getTable('config').'" ADD action_mark_as_read INT DEFAULT 0');
31 }
32
33 /**
34 * @param Schema $schema
35 */
36 public function down(Schema $schema)
37 {
38 $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.');
39
40 $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP action_mark_as_read');
41 }
42}