forked from wallabag/wallabag
Compare commits
1 Commits
2.6.2
...
fix/CodeQL
| Author | SHA1 | Date | |
|---|---|---|---|
| af54ccea8a |
14
.github/CONTRIBUTING.md
vendored
14
.github/CONTRIBUTING.md
vendored
@ -45,17 +45,3 @@ Note : If you have large portions of text, use [Github's Gist service](https://g
|
||||
|
||||
## You want to fix a bug or to add a feature
|
||||
Please fork wallabag and work with **the master branch**.
|
||||
|
||||
## Run Tests and PHP formatter
|
||||
|
||||
All pull requests need to pass the tests and the code needs match the style guide.
|
||||
|
||||
To run the tests locally run:
|
||||
|
||||
- when testing using Docker: `docker-compose run --rm php make test`
|
||||
- otherwise: `make test`
|
||||
|
||||
To run the PHP formatter:
|
||||
|
||||
- when testing using Docker: `docker-compose run --rm php bin/php-cs-fixer fix`
|
||||
- otherwise: `php bin/php-cs-fixer fix`
|
||||
|
||||
12
.github/dependabot.yml
vendored
12
.github/dependabot.yml
vendored
@ -22,10 +22,18 @@ updates:
|
||||
- j0k3r
|
||||
- tcitworld
|
||||
- Kdecherf
|
||||
labels:
|
||||
- Ready for review
|
||||
ignore:
|
||||
- dependency-name: lcobucci/jwt
|
||||
- dependency-name: doctrine/doctrine-migrations-bundle
|
||||
versions:
|
||||
- ">= 4.2.0"
|
||||
- "> 1.3.2"
|
||||
- dependency-name: friendsofsymfony/user-bundle
|
||||
versions:
|
||||
- "> 2.0.2"
|
||||
- dependency-name: nelmio/api-doc-bundle
|
||||
versions:
|
||||
- "> 2.13.4"
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
|
||||
42
.github/workflows/codeql-analysis.yml
vendored
Normal file
42
.github/workflows/codeql-analysis.yml
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
schedule:
|
||||
- cron: '22 9 * * 2'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
72
.github/workflows/continuous-integration.yml
vendored
72
.github/workflows/continuous-integration.yml
vendored
@ -32,7 +32,6 @@ jobs:
|
||||
- "7.4"
|
||||
- "8.0"
|
||||
- "8.1"
|
||||
- "8.2"
|
||||
database:
|
||||
- "sqlite"
|
||||
- "mysql"
|
||||
@ -80,74 +79,3 @@ jobs:
|
||||
|
||||
- name: "Run PHPUnit"
|
||||
run: "php bin/simple-phpunit -v"
|
||||
|
||||
phpunit_no_prefix:
|
||||
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without prefix"
|
||||
runs-on: "ubuntu-20.04"
|
||||
services:
|
||||
rabbitmq:
|
||||
image: rabbitmq:3-alpine
|
||||
ports:
|
||||
- 5672:5672
|
||||
redis:
|
||||
image: redis:6-alpine
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
php:
|
||||
- "8.2"
|
||||
database:
|
||||
- "sqlite"
|
||||
- "mysql"
|
||||
- "pgsql"
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v3"
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
php-version: "${{ matrix.php }}"
|
||||
coverage: none
|
||||
tools: pecl
|
||||
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
||||
ini-values: "date.timezone=Europe/Paris"
|
||||
|
||||
- name: "Remove database prefix"
|
||||
run: |
|
||||
pip install --user yq
|
||||
yq -Y --in-place '.parameters.database_table_prefix = ""' app/config/parameters.yml.dist
|
||||
|
||||
- name: "Setup MySQL"
|
||||
if: "${{ matrix.database == 'mysql' }}"
|
||||
run: |
|
||||
sudo systemctl start mysql.service
|
||||
sudo mysql -u root -proot -h 127.0.0.1 -e "CREATE DATABASE wallabag_test"
|
||||
|
||||
- name: "Setup PostgreSQL"
|
||||
if: "${{ matrix.database == 'pgsql' }}"
|
||||
run: |
|
||||
sudo systemctl start postgresql
|
||||
sudo -u postgres psql -d template1 -c "CREATE USER wallabag WITH PASSWORD 'wallabagrocks' CREATEDB"
|
||||
createdb -h localhost -p 5432 -U wallabag wallabag_test
|
||||
pg_isready -d wallabag_test -h localhost -p 5432 -U wallabag
|
||||
|
||||
- name: "Install dependencies with Composer"
|
||||
uses: "ramsey/composer-install@v2"
|
||||
with:
|
||||
composer-options: "--optimize-autoloader --prefer-dist"
|
||||
|
||||
- name: "Prepare database"
|
||||
run: "make prepare DB=${{ matrix.database }}"
|
||||
|
||||
- name: "Prepare fixtures"
|
||||
run: "make fixtures"
|
||||
|
||||
- name: "Run PHPUnit"
|
||||
run: "php bin/simple-phpunit -v"
|
||||
|
||||
@ -12,7 +12,7 @@ jobs:
|
||||
steps:
|
||||
- name: Dependabot metadata
|
||||
id: metadata
|
||||
uses: dependabot/fetch-metadata@v1.6.0
|
||||
uses: dependabot/fetch-metadata@v1.3.4
|
||||
with:
|
||||
github-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
- name: Approve and merge minor updates
|
||||
|
||||
10
.github/workflows/translations.yml
vendored
10
.github/workflows/translations.yml
vendored
@ -40,5 +40,11 @@ jobs:
|
||||
with:
|
||||
composer-options: "--optimize-autoloader --prefer-dist"
|
||||
|
||||
- name: "Validate translations"
|
||||
run: "php bin/console lint:yaml translations -v"
|
||||
- name: "Validate Core translations"
|
||||
run: "php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v"
|
||||
|
||||
- name: "Validate CraueConfig translations"
|
||||
run: "php bin/console lint:yaml app/Resources/CraueConfigBundle/translations -v"
|
||||
|
||||
- name: "Validate User translations"
|
||||
run: "php bin/console lint:yaml src/Wallabag/UserBundle/Resources/translations -v"
|
||||
|
||||
126
CHANGELOG.md
126
CHANGELOG.md
@ -1,131 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## [2.6.2](https://github.com/wallabag/wallabag/tree/2.6.2)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.1...2.6.2)
|
||||
|
||||
### Fixes
|
||||
* Fix mass action input on dark theme by @simounet https://github.com/wallabag/wallabag/pull/6673
|
||||
* Fix undefined variable by @nicosomb https://github.com/wallabag/wallabag/pull/6672
|
||||
* Fix table name in migration by @nicosomb https://github.com/wallabag/wallabag/pull/6653
|
||||
|
||||
### Technical stuff
|
||||
* Add a new build to test when no database table prefix are defined by @j0k3r https://github.com/wallabag/wallabag/pull/6731
|
||||
* Keep escaped table name while migrating by @Glandos https://github.com/wallabag/wallabag/pull/6710
|
||||
* Remove twofactor_auth parameter by @nicosomb https://github.com/wallabag/wallabag/pull/6723
|
||||
* ApiDoc: Add response description to UserRestController by @caspermeijn https://github.com/wallabag/wallabag/pull/6684
|
||||
* ApiDoc: Add response description to WallabagRestController by @caspermeijn https://github.com/wallabag/wallabag/pull/6102
|
||||
* Skip migration if the table was already renamed by @gramakri https://github.com/wallabag/wallabag/pull/6678
|
||||
|
||||
### Meta
|
||||
* Document how to run tests and formatter for new contributors by @caspermeijn https://github.com/wallabag/wallabag/pull/6685
|
||||
* Add link to wallabag ecosystem resources by @nicosomb https://github.com/wallabag/wallabag/pull/6700
|
||||
|
||||
## [2.6.1](https://github.com/wallabag/wallabag/tree/2.6.1)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.0...2.6.1)
|
||||
|
||||
### Fixes
|
||||
* Do not autoload fixtures by @j0k3r https://github.com/wallabag/wallabag/pull/6648
|
||||
* Add confirmation alert when deleting articles from list view by @nicosomb https://github.com/wallabag/wallabag/pull/6644
|
||||
|
||||
## [2.6.0](https://github.com/wallabag/wallabag/tree/2.6.0)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.5.4...2.6.0)
|
||||
|
||||
### Features
|
||||
* Add tag deletion from tags list by @nicosomb https://github.com/wallabag/wallabag/pull/5861
|
||||
* Add support of mass action to tag entries by @kdecherf https://github.com/wallabag/wallabag/pull/5838
|
||||
* Mass action interface by @Simounet https://github.com/wallabag/wallabag/pull/6547
|
||||
* Empty space on the top bar used for more add url toggle clickable target by @Simounet https://github.com/wallabag/wallabag/pull/6612
|
||||
* Add new setting to show / hide articles thumbnails by @nicosomb https://github.com/wallabag/wallabag/pull/6609
|
||||
|
||||
### Fixes
|
||||
* Add prefix for tag slugs by @kdecherf https://github.com/wallabag/wallabag/pull/6226
|
||||
* Fix open all external links in new tab in Config by @wyntonfranklin https://github.com/wallabag/wallabag/pull/6256
|
||||
* Fix dark theme for pre HTML tags by @Simounet https://github.com/wallabag/wallabag/pull/6495
|
||||
* Fix dark mode top bar contrast by @Simounet https://github.com/wallabag/wallabag/pull/6510
|
||||
* Dark mode contrast improved by @Simounet https://github.com/wallabag/wallabag/pull/6512
|
||||
* Fix dark mode URL add input color by @Simounet https://github.com/wallabag/wallabag/pull/6525
|
||||
* Fix round reading time in export by @mart-e https://github.com/wallabag/wallabag/pull/6545
|
||||
* Fix images downloading with numeric HTML entity by @Simounet https://github.com/wallabag/wallabag/pull/6563
|
||||
* Fix DownloadImages not following redirections by @Simounet https://github.com/wallabag/wallabag/pull/6562
|
||||
* Fix auto dark theme detection flickering by @Simounet https://github.com/wallabag/wallabag/pull/6584
|
||||
* Fix RSS feed_route not set by @Simounet https://github.com/wallabag/wallabag/pull/6606
|
||||
* Add flash message when we try to add too much tags by @nicosomb https://github.com/wallabag/wallabag/pull/6607
|
||||
* Changed default value for domain_name parameter by @nicosomb https://github.com/wallabag/wallabag/pull/6616
|
||||
* Improved tags display by @Simounet https://github.com/wallabag/wallabag/pull/6613
|
||||
* Fix mousetrap enter issue by @Simounet https://github.com/wallabag/wallabag/pull/6624
|
||||
* Fix duplicate tags creation when assigning search results to tag by @nicosomb https://github.com/wallabag/wallabag/pull/6629
|
||||
|
||||
### Meta
|
||||
* Removed Carrot & Scuttle share by @nicosomb https://github.com/wallabag/wallabag/pull/6047
|
||||
* Remove old, not so maintained and buggy baggy theme by @nicosomb https://github.com/wallabag/wallabag/pull/4332
|
||||
* Remove Scrutinizer badge by @j0k3r https://github.com/wallabag/wallabag/pull/6179
|
||||
* Add mention to unofficial linux client by @imhemish https://github.com/wallabag/wallabag/pull/6203
|
||||
|
||||
### Technical stuff
|
||||
* Remove SensioDistributionBundle by @yguedidi https://github.com/wallabag/wallabag/pull/5761
|
||||
* Back to latest composer version by @yguedidi https://github.com/wallabag/wallabag/pull/5810
|
||||
* Clean composer.lock after SensioDistributionBundle removal by @yguedidi https://github.com/wallabag/wallabag/pull/5839
|
||||
* Remove transitive dependencies by @yguedidi https://github.com/wallabag/wallabag/pull/5784
|
||||
* Register missed commands by @yguedidi https://github.com/wallabag/wallabag/pull/5928
|
||||
* Extend right FOSRestBundle controller class by @yguedidi https://github.com/wallabag/wallabag/pull/5929
|
||||
* Remove PHP-CS-Fixer deprecations by @yguedidi https://github.com/wallabag/wallabag/pull/5914
|
||||
* Upgrade FOSUserBundle to 2.1 by @yguedidi https://github.com/wallabag/wallabag/pull/5782
|
||||
* Add TwigCS by @yguedidi https://github.com/wallabag/wallabag/pull/5759
|
||||
* Use FQCN as service name by @yguedidi https://github.com/wallabag/wallabag/pull/5748
|
||||
* Migrate to new template reference notation by @yguedidi https://github.com/wallabag/wallabag/pull/5758
|
||||
* Migrate from old colon notation to FQCN by @yguedidi https://github.com/wallabag/wallabag/pull/5943
|
||||
* Use autowiring by @yguedidi https://github.com/wallabag/wallabag/pull/5946
|
||||
* Use FQCN to fetch services by @yguedidi https://github.com/wallabag/wallabag/pull/5951
|
||||
* Run tests without memory limit by @yguedidi https://github.com/wallabag/wallabag/pull/5953
|
||||
* Import used classes by @yguedidi https://github.com/wallabag/wallabag/pull/5952
|
||||
* Rework command tests by @yguedidi https://github.com/wallabag/wallabag/pull/5954
|
||||
* Switch to Swagger for api documentation by @caspermeijn https://github.com/wallabag/wallabag/pull/6062
|
||||
* Remove some deprecation by @j0k3r https://github.com/wallabag/wallabag/pull/6085
|
||||
* Remove deprecated options from FOSRest by @j0k3r https://github.com/wallabag/wallabag/pull/6095
|
||||
* Remove LiipThemeBundle by @j0k3r https://github.com/wallabag/wallabag/pull/6097
|
||||
* Upgrade PHPStan and move to level 2 with baseline by @j0k3r https://github.com/wallabag/wallabag/pull/6098
|
||||
* Upgrade to Symfony 4.4 by @j0k3r https://github.com/wallabag/wallabag/pull/6099
|
||||
* Update to FOSUserBundle 3.1 by @j0k3r https://github.com/wallabag/wallabag/pull/6136
|
||||
* Update to scheb/2fa-bundle by @j0k3r https://github.com/wallabag/wallabag/pull/6144
|
||||
* Upgrade to Twig 3 by @j0k3r https://github.com/wallabag/wallabag/pull/6151
|
||||
* Move translations files to /translations by @j0k3r https://github.com/wallabag/wallabag/pull/6153
|
||||
* Fix EventDispatcher & events by @j0k3r https://github.com/wallabag/wallabag/pull/6154
|
||||
* Replace SwiftMailer by Symfony Mailer by @j0k3r https://github.com/wallabag/wallabag/pull/6150
|
||||
* Remove ContainerAwareCommand from commands by @j0k3r https://github.com/wallabag/wallabag/pull/6152
|
||||
* Update all Doctrine deps by @j0k3r https://github.com/wallabag/wallabag/pull/6143
|
||||
* Update PagerFanta by @j0k3r https://github.com/wallabag/wallabag/pull/6145
|
||||
* Move to controller as a service by @j0k3r https://github.com/wallabag/wallabag/pull/6159
|
||||
* Add RabbitMQConsumerTotalProxy to lazy RabbitMQ services for messages by @j0k3r https://github.com/wallabag/wallabag/pull/6166
|
||||
* Properly handle json_array type removal by @j0k3r https://github.com/wallabag/wallabag/pull/6171
|
||||
* Fix database_path in Docker env by @j0k3r https://github.com/wallabag/wallabag/pull/6174
|
||||
* Docker: database_table_prefix may be configured from environment by @fcatt https://github.com/wallabag/wallabag/pull/6196
|
||||
* Update annotations to OpenApi 3 by @caspermeijn https://github.com/wallabag/wallabag/pull/6182
|
||||
* Fix public folder for Symfony 4+ by @kdecherf https://github.com/wallabag/wallabag/pull/6217
|
||||
* Fix API allowed_registration by @caspermeijn https://github.com/wallabag/wallabag/pull/6315
|
||||
* Enable PHP 8.2 in CI by @j0k3r https://github.com/wallabag/wallabag/pull/6469
|
||||
* Fix/build stylelint error by @Simounet https://github.com/wallabag/wallabag/pull/6586
|
||||
|
||||
## [2.5.4](https://github.com/wallabag/wallabag/tree/2.5.4)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.5.3...2.5.4)
|
||||
|
||||
### Security fixes
|
||||
* Fix adding tag to entries from other people by @j0k3r in https://github.com/wallabag/wallabag/pull/6290
|
||||
* Fix XSS on username on share page by @j0k3r in https://github.com/wallabag/wallabag/pull/6288
|
||||
* Fix CSRF on user deletion by @j0k3r in https://github.com/wallabag/wallabag/pull/6289
|
||||
|
||||
### Meta
|
||||
* Fix release script by @j0k3r in https://github.com/wallabag/wallabag/pull/6275
|
||||
|
||||
## [2.5.3](https://github.com/wallabag/wallabag/tree/2.5.3)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.5.2...2.5.3)
|
||||
|
||||
### Security fixes
|
||||
* Fix GHSA-qwx8-mxxx-mg96 https://github.com/wallabag/wallabag/commit/0f7460dbab9e29f4f7d2944aca20210f828b6abb by @Kdecherf, thanks to @bAuh0lz
|
||||
* Fix GHSA-mrqx-mjc4-vfh3 https://github.com/wallabag/wallabag/commit/5ac6b6bff9e2e3a87fd88c2904ff3c6aac40722e by @Kdecherf, thanks to @bAuh0lz
|
||||
|
||||
### Meta
|
||||
* Update deps before 2.5.3 by @j0k3r in https://github.com/wallabag/wallabag/pull/6241
|
||||
|
||||
## [2.5.2](https://github.com/wallabag/wallabag/tree/2.5.2)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.5.1...2.5.2)
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ ifdef DB
|
||||
endif
|
||||
-php bin/console doctrine:database:drop --force --env=test
|
||||
php bin/console doctrine:database:create --env=test
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test -vv
|
||||
php bin/console doctrine:migrations:migrate --no-interaction --env=test
|
||||
|
||||
fixtures: ## Load fixtures into database
|
||||
php bin/console doctrine:fixtures:load --no-interaction --env=test
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# wallabag
|
||||
|
||||

|
||||
[](https://scrutinizer-ci.com/g/wallabag/wallabag/?branch=master)
|
||||
[](https://gitter.im/wallabag/wallabag)
|
||||
[](https://liberapay.com/wallabag/donate)
|
||||
[](https://hosted.weblate.org/engage/wallabag/?utm_source=widget)
|
||||
@ -17,8 +18,6 @@ You can install it on your own server, or you can create an account on [wallabag
|
||||
* Android app: [wallabag/android-app](https://github.com/wallabag/android-app)
|
||||
* iOS app: [wallabag/ios-app](https://github.com/wallabag/ios-app)
|
||||
* Browser extension: [wallabag/wallabagger](https://github.com/wallabag/wallabagger)
|
||||
* GNOME (Linux) app: [read-it-later](https://gitlab.gnome.org/World/read-it-later) (not maintained by this project)
|
||||
* All resources about wallabag ecosystem are listed here: https://github.com/wallabag/wallabag/wiki/wallabag-ecosystem
|
||||
|
||||
## Documentation
|
||||
|
||||
|
||||
@ -17,9 +17,9 @@ During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE` (li
|
||||
#### Create a new release on GitHub
|
||||
|
||||
- [Create the new release on GitHub](https://github.com/wallabag/wallabag/releases/new) by targetting the `master` branch or any appropriate branch (for instance backports).
|
||||
- Update [website](https://github.com/wallabag/website) to change the redirect rule for `/latest-v2-package` & `/latest-v2`. They both should redirect to the asset of the GitHub release.
|
||||
- Update nginx config to change the redirect rule for `https://wllbg.org/latest-v2-package` & `http://wllbg.org/latest-v2` (they both redirect to the asset of the GitHub release)
|
||||
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
|
||||
- Update [website](https://github.com/wallabag/website) website (downloads, MD5 sum, releases and new blog post)
|
||||
- Update wallabag.org website (downloads, MD5 sum, releases and new blog post)
|
||||
- Put the next patch version suffixed with `-dev` in `app/config/wallabag.yml` (`wallabag_core.version`)
|
||||
- Drink a :beer:!
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ class AppKernel extends Kernel
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||
new FOS\RestBundle\FOSRestBundle(),
|
||||
@ -20,6 +21,7 @@ class AppKernel extends Kernel
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
|
||||
new Nelmio\CorsBundle\NelmioCorsBundle(),
|
||||
new Liip\ThemeBundle\LiipThemeBundle(),
|
||||
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
|
||||
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
|
||||
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
|
||||
@ -34,7 +36,6 @@ class AppKernel extends Kernel
|
||||
new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
|
||||
new Http\HttplugBundle\HttplugBundle(),
|
||||
new Sentry\SentryBundle\SentryBundle(),
|
||||
new Twig\Extra\TwigExtraBundle\TwigExtraBundle(),
|
||||
|
||||
// wallabag bundles
|
||||
new Wallabag\CoreBundle\WallabagCoreBundle(),
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20160401000000 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
||||
|
||||
@ -164,7 +164,7 @@ SQL
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql("DROP TABLE {$this->getTable('craue_config_setting')}");
|
||||
$this->addSql("DROP TABLE {$this->getTable('tagging_rule')}");
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20160410190541 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -24,14 +24,14 @@ class Version20160410190541 extends WallabagMigration
|
||||
$sharePublic = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_public'");
|
||||
|
||||
if (false === $sharePublic) {
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('share_public', '1', 'entry')");
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$entryTable->dropColumn('uid');
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20160812120952 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
|
||||
@ -31,7 +31,7 @@ class Version20160812120952 extends WallabagMigration
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20160911214952 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$redis = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis'");
|
||||
|
||||
if (false === $redis) {
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('import_with_redis', 0, 'import')");
|
||||
@ -24,7 +24,7 @@ class Version20160911214952 extends WallabagMigration
|
||||
$rabbitmq = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq'");
|
||||
|
||||
if (false === $rabbitmq) {
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('import_with_rabbitmq', 0, 'import')");
|
||||
@ -33,7 +33,7 @@ class Version20160911214952 extends WallabagMigration
|
||||
$this->skipIf(false !== $rabbitmq && false !== $redis, 'It seems that you already played this migration.');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_redis';");
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'import_with_rabbitmq';");
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20160916201049 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
|
||||
@ -20,7 +20,7 @@ class Version20160916201049 extends WallabagMigration
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'pocket_consumer_key';");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
$configTable->dropColumn('pocket_consumer_key');
|
||||
|
||||
@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161001072726 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
@ -24,8 +24,9 @@ class Version20161001072726 extends WallabagMigration
|
||||
WHERE TABLE_NAME = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "' AND CONSTRAINT_NAME LIKE 'FK_%'
|
||||
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
|
||||
);
|
||||
$query->execute();
|
||||
|
||||
foreach ($query->fetchAllAssociative() as $fk) {
|
||||
foreach ($query->fetchAll() as $fk) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||
}
|
||||
break;
|
||||
@ -41,8 +42,9 @@ class Version20161001072726 extends WallabagMigration
|
||||
AND conrelid::regclass::text = '" . $this->getTable('entry_tag', WallabagMigration::UN_ESCAPED_TABLE) . "'
|
||||
AND n.nspname = 'public';"
|
||||
);
|
||||
$query->execute();
|
||||
|
||||
foreach ($query->fetchAllAssociative() as $fk) {
|
||||
foreach ($query->fetchAll() as $fk) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP CONSTRAINT ' . $fk['conname']);
|
||||
}
|
||||
break;
|
||||
@ -63,8 +65,9 @@ class Version20161001072726 extends WallabagMigration
|
||||
AND COLUMN_NAME = 'entry_id'
|
||||
AND TABLE_SCHEMA = '" . $this->connection->getDatabase() . "'"
|
||||
);
|
||||
$query->execute();
|
||||
|
||||
foreach ($query->fetchAllAssociative() as $fk) {
|
||||
foreach ($query->fetchAll() as $fk) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||
}
|
||||
break;
|
||||
@ -81,8 +84,9 @@ class Version20161001072726 extends WallabagMigration
|
||||
AND n.nspname = 'public'
|
||||
AND pg_get_constraintdef(c.oid) LIKE '%entry_id%';"
|
||||
);
|
||||
$query->execute();
|
||||
|
||||
foreach ($query->fetchAllAssociative() as $fk) {
|
||||
foreach ($query->fetchAll() as $fk) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP CONSTRAINT ' . $fk['conname']);
|
||||
}
|
||||
break;
|
||||
@ -91,7 +95,7 @@ class Version20161001072726 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ADD CONSTRAINT FK_annotation_entry FOREIGN KEY (entry_id) REFERENCES ' . $this->getTable('entry') . ' (id) ON DELETE CASCADE');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161022134138 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
|
||||
@ -38,7 +38,7 @@ class Version20161022134138 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE `name` `name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ class Version20161024212538 extends WallabagMigration
|
||||
{
|
||||
private $constraintName = 'IDX_user_oauth_client';
|
||||
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
|
||||
@ -29,7 +29,7 @@ class Version20161024212538 extends WallabagMigration
|
||||
);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
|
||||
|
||||
@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161031132655 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$images = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled'");
|
||||
|
||||
$this->skipIf(false !== $images, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('download_images_enabled', 0, 'misc')");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_images_enabled';");
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ class Version20161104073720 extends WallabagMigration
|
||||
{
|
||||
private $indexName = 'IDX_entry_created_at';
|
||||
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
|
||||
@ -20,7 +20,7 @@ class Version20161104073720 extends WallabagMigration
|
||||
$entryTable->addIndex(['created_at'], $this->indexName);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161106113822 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
|
||||
@ -22,7 +22,7 @@ class Version20161106113822 extends WallabagMigration
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
|
||||
|
||||
@ -10,12 +10,12 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161117071626 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$share = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark'");
|
||||
|
||||
if (false === $share) {
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('share_unmark', 0, 'entry')");
|
||||
@ -24,7 +24,7 @@ class Version20161117071626 extends WallabagMigration
|
||||
$unmark = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url'");
|
||||
|
||||
if (false === $unmark) {
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('unmark_url', 'https://unmark.it', 'entry')");
|
||||
@ -33,7 +33,7 @@ class Version20161117071626 extends WallabagMigration
|
||||
$this->skipIf(false !== $share && false !== $unmark, 'It seems that you already played this migration.');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_unmark';");
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'unmark_url';");
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161118134328 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -22,7 +22,7 @@ class Version20161118134328 extends WallabagMigration
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161122144743 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$access = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access'");
|
||||
|
||||
$this->skipIf(false !== $access, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('restricted_access', 0, 'entry')");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'restricted_access';");
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161122203647 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$userTable = $schema->getTable($this->getTable('user'));
|
||||
|
||||
@ -28,7 +28,7 @@ class Version20161122203647 extends WallabagMigration
|
||||
$userTable->dropColumn('credentials_expired');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$userTable = $schema->getTable($this->getTable('user'));
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161128084725 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
$this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.');
|
||||
@ -18,7 +18,7 @@ class Version20161128084725 extends WallabagMigration
|
||||
$configTable->addColumn('list_mode', 'integer', ['notnull' => false]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
$configTable->dropColumn('list_mode');
|
||||
|
||||
@ -16,7 +16,7 @@ class Version20161128131503 extends WallabagMigration
|
||||
'expires_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$userTable = $schema->getTable($this->getTable('user'));
|
||||
|
||||
@ -26,7 +26,7 @@ class Version20161128131503 extends WallabagMigration
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$userTable = $schema->getTable($this->getTable('user'));
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20161214094402 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -32,7 +32,7 @@ class Version20161214094402 extends WallabagMigration
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ class Version20161214094403 extends WallabagMigration
|
||||
{
|
||||
private $indexName = 'IDX_entry_uid';
|
||||
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
|
||||
@ -20,7 +20,7 @@ class Version20161214094403 extends WallabagMigration
|
||||
$entryTable->addIndex(['uid'], $this->indexName);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
|
||||
|
||||
@ -13,7 +13,7 @@ class Version20170127093841 extends WallabagMigration
|
||||
private $indexStarredName = 'IDX_entry_starred';
|
||||
private $indexArchivedName = 'IDX_entry_archived';
|
||||
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf($entryTable->hasIndex($this->indexStarredName) && $entryTable->hasIndex($this->indexArchivedName), 'It seems that you already played this migration.');
|
||||
@ -22,7 +22,7 @@ class Version20170127093841 extends WallabagMigration
|
||||
$entryTable->addIndex(['is_archived'], $this->indexArchivedName);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf(false === $entryTable->hasIndex($this->indexStarredName) && false === $entryTable->hasIndex($this->indexArchivedName), 'It seems that you already played this migration.');
|
||||
|
||||
@ -10,12 +10,12 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170327194233 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$scuttle = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle'");
|
||||
|
||||
$this->skipIf(false !== $scuttle, 'It seems that you already played this migration.');
|
||||
|
||||
@ -23,7 +23,7 @@ class Version20170327194233 extends WallabagMigration
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('scuttle_url', 'http://scuttle.org', 'entry')");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'share_scuttle';");
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'scuttle_url';");
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170405182620 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -27,7 +27,7 @@ class Version20170405182620 extends WallabagMigration
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170407200919 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf(!$entryTable->hasColumn('is_public'), 'It seems that you already played this migration.');
|
||||
@ -18,7 +18,7 @@ class Version20170407200919 extends WallabagMigration
|
||||
$entryTable->dropColumn('is_public');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf($entryTable->hasColumn('is_public'), 'It seems that you already played this migration.');
|
||||
|
||||
@ -10,17 +10,17 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170420134133 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_pictures';");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$downloadPictures = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_pictures'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'download_pictures'");
|
||||
|
||||
$this->skipIf(false !== $downloadPictures, 'It seems that you already played this migration.');
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170501115751 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf($schema->hasTable($this->getTable('site_credential')), 'It seems that you already played this migration.');
|
||||
|
||||
@ -31,7 +31,7 @@ class Version20170501115751 extends WallabagMigration
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$schema->dropTable($this->getTable('site_credential'));
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ class Version20170510082609 extends WallabagMigration
|
||||
'email_canonical',
|
||||
];
|
||||
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
|
||||
@ -26,7 +26,7 @@ class Version20170510082609 extends WallabagMigration
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170511115400 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -21,7 +21,7 @@ class Version20170511115400 extends WallabagMigration
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170511211659 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
@ -62,7 +62,7 @@ EOD
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$tableName = $this->getTable('annotation');
|
||||
|
||||
|
||||
@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170602075214 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$apiUserRegistration = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration'");
|
||||
|
||||
$this->skipIf(false !== $apiUserRegistration, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('api_user_registration', '0', 'api')");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'api_user_registration';");
|
||||
}
|
||||
|
||||
@ -11,21 +11,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170606155640 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf(!$schema->hasTable($this->getTable('craue_config_setting')), 'Table already renamed');
|
||||
|
||||
$apiUserRegistration = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
|
||||
|
||||
$this->skipIf(false === $apiUserRegistration, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'wallabag_url'");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('wallabag_url', 'wallabag.me', 'misc')");
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170719231144 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
@ -21,12 +21,13 @@ class Version20170719231144 extends WallabagMigration
|
||||
GROUP BY LOWER(label)
|
||||
HAVING COUNT(*) > 1'
|
||||
);
|
||||
$dupTags->execute();
|
||||
|
||||
foreach ($dupTags->fetchAllAssociative() as $duplicates) {
|
||||
foreach ($dupTags->fetchAll() as $duplicates) {
|
||||
$label = $duplicates['lower_label'];
|
||||
|
||||
// Retrieve all duplicate tags for a given tag
|
||||
$tags = $this->connection->query('
|
||||
$tags = $this->connection->executeQuery('
|
||||
SELECT id
|
||||
FROM ' . $this->getTable('tag') . '
|
||||
WHERE LOWER(label) = :label
|
||||
@ -40,7 +41,7 @@ class Version20170719231144 extends WallabagMigration
|
||||
$newId = null;
|
||||
$ids = [];
|
||||
|
||||
foreach ($tags->fetchAllAssociative() as $tag) {
|
||||
foreach ($tags->fetchAll() as $tag) {
|
||||
// Ignore the first tag as we use it as the new reference tag
|
||||
if ($first) {
|
||||
$first = false;
|
||||
@ -85,7 +86,7 @@ class Version20170719231144 extends WallabagMigration
|
||||
);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20170824113337 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -21,7 +21,7 @@ class Version20170824113337 extends WallabagMigration
|
||||
]);
|
||||
}
|
||||
|
||||
public function postUp(Schema $schema): void
|
||||
public function postUp(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf(!$entryTable->hasColumn('starred_at'), 'Unable to add starred_at colum');
|
||||
@ -34,7 +34,7 @@ class Version20170824113337 extends WallabagMigration
|
||||
);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20171008195606 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
@ -26,7 +26,7 @@ class Version20171008195606 extends WallabagMigration
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20171105202000 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -21,7 +21,7 @@ class Version20171105202000 extends WallabagMigration
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20171120163128 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$storeArticleHeaders = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers'");
|
||||
|
||||
$this->skipIf(false !== $storeArticleHeaders, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('store_article_headers', '0', 'entry')");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'store_article_headers';");
|
||||
}
|
||||
|
||||
@ -10,19 +10,19 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20171125164500 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$shaarliShareOriginUrl = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url'");
|
||||
|
||||
$this->skipIf(false !== $shaarliShareOriginUrl, 'It seems that you already played this migration.');
|
||||
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('craue_config_setting') . " (name, value, section) VALUES ('shaarli_share_origin_url', '0', 'entry')");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->addSql('DELETE FROM ' . $this->getTable('craue_config_setting') . " WHERE name = 'shaarli_share_origin_url';");
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20180405182455 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -21,7 +21,7 @@ class Version20180405182455 extends WallabagMigration
|
||||
]);
|
||||
}
|
||||
|
||||
public function postUp(Schema $schema): void
|
||||
public function postUp(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
$this->skipIf(!$entryTable->hasColumn('archived_at'), 'Unable to add archived_at colum');
|
||||
@ -34,7 +34,7 @@ class Version20180405182455 extends WallabagMigration
|
||||
);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20181128203230 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||
|
||||
@ -25,7 +25,7 @@ class Version20181128203230 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `value` `value` varchar(191)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||
|
||||
|
||||
@ -118,13 +118,13 @@ final class Version20190129120000 extends WallabagMigration
|
||||
],
|
||||
];
|
||||
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
foreach ($this->settings as $setting) {
|
||||
$settingEnabled = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = '" . $setting['name'] . "'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('craue_config_setting') . " WHERE name = '" . $setting['name'] . "'");
|
||||
|
||||
if (false !== $settingEnabled) {
|
||||
continue;
|
||||
@ -134,7 +134,7 @@ final class Version20190129120000 extends WallabagMigration
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->skipIf(true, 'These settings are required and should not be removed.');
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20190401105353 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -24,7 +24,7 @@ class Version20190401105353 extends WallabagMigration
|
||||
$entryTable->addIndex(['user_id', 'hashed_url'], 'hashed_url_user_id', [], ['lengths' => [null, 40]]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
*/
|
||||
class Version20190601125843 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
@ -31,7 +31,7 @@ class Version20190601125843 extends WallabagMigration
|
||||
$entryTable->addIndex(['user_id', 'hashed_given_url'], 'hashed_given_url_user_id', [], ['lengths' => [null, 40]]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$entryTable = $schema->getTable($this->getTable('entry'));
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ final class Version20190826204730 extends WallabagMigration
|
||||
$previous_rule = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
->fetchOne('SELECT * FROM ' . $this->getTable('ignore_origin_instance_rule') . " WHERE rule = '" . $entity['rule'] . "'");
|
||||
->fetchArray('SELECT * FROM ' . $this->getTable('ignore_origin_instance_rule') . " WHERE rule = '" . $entity['rule'] . "'");
|
||||
|
||||
if (false === $previous_rule) {
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('ignore_origin_instance_rule') . " (rule) VALUES ('" . $entity['rule'] . "');");
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Drop theme fields from config table.
|
||||
*/
|
||||
final class Version20221123132612 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
|
||||
$this->skipIf(!$configTable->hasColumn('theme'), 'It seems that you already played this migration.');
|
||||
|
||||
$configTable->dropColumn('theme');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
|
||||
$this->skipIf($configTable->hasColumn('theme'), 'It seems that you already played this migration.');
|
||||
|
||||
$configTable->addColumn('theme', 'string', [
|
||||
'notnull' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove the deprecated (and removed in DBAL v3) `json_array` type.
|
||||
*/
|
||||
final class Version20221221092957 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$userTable = $this->getTable('user');
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM ' . $userTable);
|
||||
$this->addSql('DROP TABLE ' . $userTable);
|
||||
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json)
|
||||
, emailTwoFactor BOOLEAN NOT NULL)');
|
||||
$this->addSql('INSERT INTO ' . $userTable . ' (id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes) SELECT id, username, username_canonical, email, email_canonical, enabled, password, last_login, password_requested_at, name, created_at, updated_at, authCode, emailTwoFactor, salt, confirmation_token, roles, googleAuthenticatorSecret, backupCodes FROM __temp__wallabag_user');
|
||||
$this->addSql('DROP TABLE __temp__wallabag_user');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $userTable . ' (username_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupcodes TYPE JSON USING backupcodes::json');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$userTable = $this->getTable('user');
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_user AS SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM ' . $userTable);
|
||||
$this->addSql('DROP TABLE ' . $userTable);
|
||||
$this->addSql('CREATE TABLE ' . $userTable . ' (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, username VARCHAR(180) NOT NULL, username_canonical VARCHAR(180) NOT NULL, email VARCHAR(180) NOT NULL, email_canonical VARCHAR(180) NOT NULL, enabled BOOLEAN NOT NULL, salt VARCHAR(255) DEFAULT NULL, password VARCHAR(255) NOT NULL, last_login DATETIME DEFAULT NULL, confirmation_token VARCHAR(180) DEFAULT NULL, password_requested_at DATETIME DEFAULT NULL, roles CLOB NOT NULL --(DC2Type:array)
|
||||
, name CLOB DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, authCode INTEGER DEFAULT NULL, googleAuthenticatorSecret VARCHAR(255) DEFAULT NULL, backupCodes CLOB DEFAULT NULL --(DC2Type:json_array)
|
||||
, emailTwoFactor BOOLEAN NOT NULL)');
|
||||
$this->addSql('INSERT INTO ' . $userTable . ' (id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor) SELECT id, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_requested_at, roles, name, created_at, updated_at, authCode, googleAuthenticatorSecret, backupCodes, emailTwoFactor FROM __temp__wallabag_user');
|
||||
$this->addSql('DROP TABLE __temp__wallabag_user');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $userTable . ' (username_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $userTable . ' (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON ' . $userTable . ' (confirmation_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||
break;
|
||||
case 'postgresql':
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupCodes TYPE TEXT');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added a new setting to display or not thumbnails.
|
||||
*/
|
||||
final class Version20230613121354 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
|
||||
$this->skipIf($configTable->hasColumn('display_thumbnails'), 'It seems that you already played this migration.');
|
||||
|
||||
$configTable->addColumn('display_thumbnails', 'integer', [
|
||||
'default' => 1,
|
||||
'notnull' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$configTable = $schema->getTable($this->getTable('config'));
|
||||
$configTable->dropColumn('display_thumbnails');
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ settings_changed: Configuración actualizada
|
||||
download_pictures: Descargar imágenes en el servidor
|
||||
diaspora_url: URL de diaspora*, si el servicio está activado
|
||||
export_epub: Activar exportación a ePub
|
||||
export_mobi: Activar exportación a .mobi (deprecado, se eliminará pronto)
|
||||
export_mobi: Activar exportación a .mobi
|
||||
export_pdf: Activar exportación a PDF
|
||||
export_csv: Activar exportación a CSV
|
||||
export_json: Activar exportación a JSON
|
||||
@ -20,12 +20,10 @@
|
||||
|
||||
{% for section in sections|craue_sortSections %}
|
||||
<div id="set-{{ section }}" class="col s12">
|
||||
{% for setting in form.settings %}
|
||||
{% if setting.vars.value.section == section %}
|
||||
{{ form_row(setting.value, {
|
||||
'label': setting.vars.value.name|trans({}, 'CraueConfigBundle'),
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% for setting in form.settings if setting.vars.value.section == section %}
|
||||
{{ form_row(setting.value, {
|
||||
'label': setting.vars.value.name|trans({}, 'CraueConfigBundle'),
|
||||
}) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user