diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-06 12:02:39 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-11-16 23:07:34 +0100 |
commit | a42f38d9fb7906b785285fab2a09f8c2b9efe996 (patch) | |
tree | 8f85793b17497827d063527a339aea42d81ed483 /app/DoctrineMigrations/Version20161106113822.php | |
parent | e042a5d78fc7676eb399f61d199e8ec0045fbd1f (diff) | |
download | wallabag-a42f38d9fb7906b785285fab2a09f8c2b9efe996.tar.gz wallabag-a42f38d9fb7906b785285fab2a09f8c2b9efe996.tar.zst wallabag-a42f38d9fb7906b785285fab2a09f8c2b9efe996.zip |
Added a configuration to define the redirection after archiving an entry
Fix #496
Diffstat (limited to 'app/DoctrineMigrations/Version20161106113822.php')
-rw-r--r-- | app/DoctrineMigrations/Version20161106113822.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/app/DoctrineMigrations/Version20161106113822.php b/app/DoctrineMigrations/Version20161106113822.php new file mode 100644 index 00000000..41e64a4a --- /dev/null +++ b/app/DoctrineMigrations/Version20161106113822.php | |||
@@ -0,0 +1,42 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Application\Migrations; | ||
4 | |||
5 | use Doctrine\DBAL\Migrations\AbstractMigration; | ||
6 | use Doctrine\DBAL\Schema\Schema; | ||
7 | |||
8 | class 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 | } | ||