aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/DoctrineMigrations/Version20160401000000.php26
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig11
2 files changed, 28 insertions, 9 deletions
diff --git a/app/DoctrineMigrations/Version20160401000000.php b/app/DoctrineMigrations/Version20160401000000.php
index a8603abf..a88d2dc0 100644
--- a/app/DoctrineMigrations/Version20160401000000.php
+++ b/app/DoctrineMigrations/Version20160401000000.php
@@ -4,21 +4,30 @@ namespace Application\Migrations;
4 4
5use Doctrine\DBAL\Migrations\AbstractMigration; 5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema; 6use Doctrine\DBAL\Schema\Schema;
7use Symfony\Component\DependencyInjection\ContainerAwareInterface;
8use Symfony\Component\DependencyInjection\ContainerInterface;
7 9
8/** 10/**
9 * Initial database structure. 11 * Initial database structure.
10 */ 12 */
11class Version20160401000000 extends AbstractMigration 13class Version20160401000000 extends AbstractMigration implements ContainerAwareInterface
12{ 14{
13 /** 15 /**
16 * @var ContainerInterface
17 */
18 private $container;
19
20 public function setContainer(ContainerInterface $container = null)
21 {
22 $this->container = $container;
23 }
24
25 /**
14 * @param Schema $schema 26 * @param Schema $schema
15 */ 27 */
16 public function up(Schema $schema) 28 public function up(Schema $schema)
17 { 29 {
18 if ($this->version->getConfiguration()->getNumberOfExecutedMigrations() > 0) { 30 $this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
19 $this->version->markMigrated();
20 $this->skipIf(true, 'Database already initialized');
21 }
22 31
23 switch ($this->connection->getDatabasePlatform()->getName()) { 32 switch ($this->connection->getDatabasePlatform()->getName()) {
24 case 'sqlite': 33 case 'sqlite':
@@ -160,7 +169,7 @@ ALTER TABLE wallabag_oauth2_refresh_tokens ADD CONSTRAINT FK_20C9FB24A76ED395 FO
160ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE; 169ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FA19EB6921 FOREIGN KEY (client_id) REFERENCES wallabag_oauth2_clients (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
161ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; 170ALTER TABLE wallabag_oauth2_auth_codes ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
162ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; 171ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES "wallabag_user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
163ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE; 172ALTER TABLE wallabag_annotation ADD CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES "wallabag_entry" (id) NOT DEFERRABLE INITIALLY IMMEDIATE;
164SQL 173SQL
165 ; 174 ;
166 foreach (explode("\n", $sql) as $query) { 175 foreach (explode("\n", $sql) as $query) {
@@ -188,4 +197,9 @@ SQL
188 $this->addSql('DROP TABLE "wallabag_user"'); 197 $this->addSql('DROP TABLE "wallabag_user"');
189 $this->addSql('DROP TABLE wallabag_annotation'); 198 $this->addSql('DROP TABLE wallabag_annotation');
190 } 199 }
200
201 private function getTable($tableName)
202 {
203 return $this->container->getParameter('database_table_prefix') . $tableName;
204 }
191} 205}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig
index 2bf9b2bd..eb26054c 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/_rss_link.html.twig
@@ -1,6 +1,11 @@
1{% if tag is defined %} 1{% if tag is defined %}
2 <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"><i class="material-icons md-24">rss_feed</i></a> 2 <a rel="alternate" type="application/rss+xml" href="{{ path('tag_rss', {'username': app.user.username, 'token': app.user.config.rssToken, 'slug': tag.slug}) }}" class="right"><i class="material-icons md-24">rss_feed</i></a>
3{% elseif currentRoute in ['unread', 'starred', 'archive', 'all'] %} 3{% elseif currentRoute in ['homepage', 'unread', 'starred', 'archive', 'all'] %}
4 <a rel="alternate" type="application/rss+xml" href="{{ path(currentRoute ~ '_rss', {'username': app.user.username, 'token': app.user.config.rssToken}) }}" class="right"><i class="material-icons">rss_feed</i></a> 4 {% set rssRoute = currentRoute %}
5{% endif %} 5 {% if currentRoute == 'homepage' %}
6 {% set rssRoute = 'unread' %}
7 {% endif %}
8 {% set rssRoute = rssRoute ~ '_rss' %}
6 9
10 <a rel="alternate" type="application/rss+xml" href="{{ path(rssRoute, {'username': app.user.username, 'token': app.user.config.rssToken}) }}" class="right"><i class="material-icons">rss_feed</i></a>
11{% endif %}