3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Schema\Schema
;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
9 * Add missing entries in craue_config_setting.
11 final class Version20190129120000
extends WallabagMigration
20 'name' => 'share_diaspora',
25 'name' => 'diaspora_url',
26 'value' => 'http://diasporapod.com',
30 'name' => 'share_shaarli',
35 'name' => 'shaarli_url',
36 'value' => 'http://myshaarli.com',
40 'name' => 'share_mail',
45 'name' => 'share_twitter',
50 'name' => 'show_printlink',
55 'name' => 'export_epub',
57 'section' => 'export',
60 'name' => 'export_mobi',
62 'section' => 'export',
65 'name' => 'export_pdf',
67 'section' => 'export',
70 'name' => 'export_csv',
72 'section' => 'export',
75 'name' => 'export_json',
77 'section' => 'export',
80 'name' => 'export_txt',
82 'section' => 'export',
85 'name' => 'export_xml',
87 'section' => 'export',
90 'name' => 'piwik_enabled',
92 'section' => 'analytics',
95 'name' => 'piwik_host',
96 'value' => 'v2.wallabag.org',
97 'section' => 'analytics',
100 'name' => 'piwik_site_id',
102 'section' => 'analytics',
105 'name' => 'demo_mode_enabled',
110 'name' => 'demo_mode_username',
111 'value' => 'wallabag',
115 'name' => 'wallabag_support_url',
116 'value' => 'https://www.wallabag.org/pages/support.html',
122 * @param Schema $schema
124 public function up(Schema
$schema)
126 foreach ($this->settings
as $setting) {
127 $settingEnabled = $this->container
128 ->get('doctrine.orm.default_entity_manager')
130 ->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = '" . $setting['name'] . "'");
132 if (false !== $settingEnabled) {
136 $this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('" . $setting['name'] . "', '" . $setting['value'] . "', '" . $setting['section'] . "');");
141 * @param Schema $schema
143 public function down(Schema
$schema)
145 $this->skipIf(true, 'These settings are required and should not be removed.');