Compare commits
129 Commits
feature/fl
...
fix-bad-ur
| Author | SHA1 | Date | |
|---|---|---|---|
| 94303c92e6 | |||
| ec4d23b584 | |||
| c0414355aa | |||
| aaf4ab2d2a | |||
| 56983b01a8 | |||
| 6b7e9ec1df | |||
| f052f6f580 | |||
| 16a92c54a7 | |||
| 13b2752e8d | |||
| 634997c9b5 | |||
| ca608ece65 | |||
| 027042cc1a | |||
| cf9243151a | |||
| e9a837a0ac | |||
| abef36fd2b | |||
| 2f86dd9c73 | |||
| 3d22442f8c | |||
| c99a733aff | |||
| 85065b509f | |||
| ca879c36de | |||
| ffcc5c9062 | |||
| 78b0b55c40 | |||
| 94a6bc0dad | |||
| 383dcc5c45 | |||
| de5aa004cb | |||
| dca910e2a6 | |||
| bc491e3712 | |||
| 40d7ca11da | |||
| 89d38b23e0 | |||
| 7be1a4e1b2 | |||
| 4d890868ed | |||
| 1d0200c5b9 | |||
| 6a5e7dba89 | |||
| 6f23eba62d | |||
| d87237484c | |||
| 46ebbfc9a4 | |||
| 8ee95437a0 | |||
| ef5b43f55c | |||
| a465db607f | |||
| 985c7add1d | |||
| 3d9986d6fc | |||
| 4b7a6eaf39 | |||
| 3e8cc92dcd | |||
| 6172071a64 | |||
| cf3adbfaea | |||
| 24e6311c05 | |||
| 69b96fe179 | |||
| ffa2e68c5f | |||
| b338c68945 | |||
| f67486a6df | |||
| 33c72bb9fc | |||
| 78dc311c72 | |||
| 48226ad6e5 | |||
| f33d1f8e48 | |||
| 97810f7335 | |||
| 15230f488a | |||
| 89ca32e705 | |||
| a71d95e38a | |||
| fa2e1d933f | |||
| 181fe7e1e9 | |||
| 905d61eb49 | |||
| c78f2706c9 | |||
| dbbb5f3cfb | |||
| 33d22c149b | |||
| cc33fcb4ba | |||
| 24db3d6862 | |||
| c3d1f92278 | |||
| a9893d754f | |||
| f4fd8e4675 | |||
| 0ccbd653fa | |||
| 70452cfc3f | |||
| 826e310687 | |||
| b81054697b | |||
| ddd8754a11 | |||
| ac1c1ff571 | |||
| 815158fefa | |||
| e1928c78ff | |||
| 65915004e0 | |||
| 60cb8c0294 | |||
| f6e85e88af | |||
| a4b0a01b6d | |||
| 1bed15fd9b | |||
| 59860d9526 | |||
| 807d473564 | |||
| ed17e61db2 | |||
| 6159c92f27 | |||
| bf176121c4 | |||
| ec33ec14e5 | |||
| 2aa7e7e121 | |||
| 093003d9af | |||
| 58a0ca2622 | |||
| 1ba1ed23f1 | |||
| 7beb535b7a | |||
| 9870785d59 | |||
| 53a2874351 | |||
| bb6b9f9f05 | |||
| 526ef23e1a | |||
| 8d3d916d4a | |||
| e90daf0690 | |||
| 9729db75de | |||
| ced2ea4015 | |||
| 7d78e2ae06 | |||
| f43d8fa947 | |||
| f48f982025 | |||
| 667ea14d42 | |||
| e93fdca2d3 | |||
| fcf6d3c3f8 | |||
| c2bfc0f359 | |||
| 8281920f2c | |||
| d4913c50c2 | |||
| 19d3e878cf | |||
| c659a42c51 | |||
| cb411e8dcd | |||
| fec8a993d9 | |||
| 31542bc4b1 | |||
| 827dded754 | |||
| 39bcddfd8b | |||
| 8cfa1cd551 | |||
| 649e1e56a9 | |||
| c1ed66aad5 | |||
| 9beadfde59 | |||
| 090f873ffc | |||
| 1b7d756be0 | |||
| d6f63d5d51 | |||
| c1cba72a19 | |||
| e80a169435 | |||
| 97fee36fa6 | |||
| fbccae8a79 | |||
| 13bd448e01 |
77
.env
@ -1,77 +0,0 @@
|
||||
# In all environments, the following files are loaded if they exist,
|
||||
# the latter taking precedence over the former:
|
||||
#
|
||||
# * .env contains default values for the environment variables needed by the app
|
||||
# * .env.local uncommitted file with local overrides
|
||||
# * .env.$APP_ENV committed environment-specific defaults
|
||||
# * .env.$APP_ENV.local uncommitted environment-specific overrides
|
||||
#
|
||||
# Real environment variables win over .env files.
|
||||
#
|
||||
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
||||
# https://symfony.com/doc/current/configuration/secrets.html
|
||||
#
|
||||
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
||||
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
||||
|
||||
DOMAIN_NAME=https://your-wallabag-instance.wallabag.org
|
||||
SERVER_NAME="Your wallabag instance"
|
||||
|
||||
# two factor stuff
|
||||
TWOFACTOR_AUTH=true
|
||||
TWOFACTOR_SENDER=no-reply@wallabag.org
|
||||
|
||||
# fosuser stuff
|
||||
FOSUSER_REGISTRATION=true
|
||||
FOSUSER_CONFIRMATION=true
|
||||
|
||||
# how long the access token should live in seconds for the API
|
||||
FOS_OAUTH_SERVER_ACCESS_TOKEN_LIFETIME=3600
|
||||
# how long the refresh token should life in seconds for the API
|
||||
FOS_OAUTH_SERVER_REFRESH_TOKEN_LIFETIME=1209600
|
||||
|
||||
FROM_EMAIL=no-reply@wallabag.org
|
||||
|
||||
RSS_LIMIT=50
|
||||
|
||||
LOCALE=en
|
||||
DATABASE_TABLE_PREFIX=wallabag_
|
||||
|
||||
# redis stuff
|
||||
REDIS_SCHEME=tcp
|
||||
REDIS_HOST=localhost
|
||||
REDIS_PORT=6379
|
||||
REDIS_PATH=null
|
||||
REDIS_PASSWORD=null
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
DATABASE_URL="sqlite:///%kernel.project_dir%/data/db/wallabag.sqlite"
|
||||
# DATABASE_URL="mysql://root:@127.0.0.1:3306/wallabag?serverVersion=8&charset=utf8mb4"
|
||||
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=14&charset=utf8"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> nelmio/cors-bundle ###
|
||||
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$'
|
||||
###< nelmio/cors-bundle ###
|
||||
|
||||
###> php-amqplib/rabbitmq-bundle ###
|
||||
RABBITMQ_URL=amqp://guest:guest@localhost:5672
|
||||
###< php-amqplib/rabbitmq-bundle ###
|
||||
|
||||
###> sentry/sentry-symfony ###
|
||||
SENTRY_DSN=
|
||||
###< sentry/sentry-symfony ###
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
APP_ENV=dev
|
||||
APP_SECRET=b6b54475f34a3238dec16508c4903ca0
|
||||
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
|
||||
#TRUSTED_HOSTS='^(localhost|example\.com)$'
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> symfony/mailer ###
|
||||
MAILER_DSN=smtp://127.0.0.1
|
||||
###< symfony/mailer ###
|
||||
@ -1,7 +0,0 @@
|
||||
# define your env variables for the test env here
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
SYMFONY_DEPRECATIONS_HELPER=999999
|
||||
PANTHER_APP_ENV=panther
|
||||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
|
||||
DATABASE_URL="mysql://root:root@127.0.0.1:3306/wallabag_test?serverVersion=8&charset=utf8mb4"
|
||||
@ -1,7 +0,0 @@
|
||||
# define your env variables for the test env here
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
SYMFONY_DEPRECATIONS_HELPER=999999
|
||||
PANTHER_APP_ENV=panther
|
||||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
|
||||
DATABASE_URL="mysql://root:root@127.0.0.1:3306/wallabag_test?serverVersion=8&charset=utf8mb4"
|
||||
@ -1,7 +0,0 @@
|
||||
# define your env variables for the test env here
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
SYMFONY_DEPRECATIONS_HELPER=999999
|
||||
PANTHER_APP_ENV=panther
|
||||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
|
||||
DATABASE_URL="postgresql://wallabag:wallabagrocks@localhost:5432/wallabag_test?serverVersion=14&charset=utf8"
|
||||
@ -1,7 +0,0 @@
|
||||
# define your env variables for the test env here
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
SYMFONY_DEPRECATIONS_HELPER=999999
|
||||
PANTHER_APP_ENV=panther
|
||||
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
|
||||
DATABASE_URL="sqlite:///%test_database_path%"
|
||||
1
.gitattributes
vendored
@ -3,6 +3,5 @@
|
||||
/.github export-ignore
|
||||
/.gitignore export-ignore
|
||||
/phpstan.neon export-ignore
|
||||
/phpstan-baseline.neon export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
/tests export-ignore
|
||||
|
||||
2
.github/workflows/assets.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 2.*
|
||||
- "2.**"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
4
.github/workflows/coding-standards.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 2.*
|
||||
- "2.**"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@ -48,7 +48,7 @@ jobs:
|
||||
run: "php bin/phpstan analyse --no-progress --error-format=checkstyle | cs2pr"
|
||||
|
||||
- name: "Run TwigCS"
|
||||
run: "php bin/twigcs --severity=error --display=blocking --reporter checkstyle templates/ | cs2pr"
|
||||
run: "php bin/twigcs --severity=error --display=blocking --reporter checkstyle app/ src/ | cs2pr"
|
||||
|
||||
- name: "Run ergebnis/composer-normalize"
|
||||
run: "composer normalize --dry-run --no-check-lock"
|
||||
|
||||
2
.github/workflows/continuous-integration.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 2.*
|
||||
- "2.**"
|
||||
|
||||
env:
|
||||
PGPASSWORD: wallabagrocks
|
||||
|
||||
2
.github/workflows/translations.yml
vendored
@ -5,7 +5,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 2.*
|
||||
- "2.**"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
2
.github/workflows/upload-release-package.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "${{ matrix.php }}"
|
||||
tools: pecl
|
||||
tools: pecl, composer:2.2
|
||||
extensions: pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
||||
ini-values: "date.timezone=Europe/Paris"
|
||||
env:
|
||||
|
||||
53
.gitignore
vendored
@ -1,27 +1,35 @@
|
||||
# Cache, log & sessions
|
||||
# Cache, logs & sessions
|
||||
/var/*
|
||||
!/var/cache
|
||||
/var/cache/*
|
||||
!var/cache/.gitkeep
|
||||
!/var/log
|
||||
/var/log/*
|
||||
!var/log/.gitkeep
|
||||
!/var/logs
|
||||
/var/logs/*
|
||||
!var/logs/.gitkeep
|
||||
!/var/sessions
|
||||
/var/sessions/*
|
||||
!var/sessions/.gitkeep
|
||||
/bin/*
|
||||
!/bin/console
|
||||
.php-cs-fixer.php
|
||||
.php-cs-fixer.cache
|
||||
.phpunit.result.cache
|
||||
phpunit.xml
|
||||
docker-compose.override.yml
|
||||
|
||||
# Parameters
|
||||
/app/config/parameters.yml
|
||||
|
||||
# Managed by Composer
|
||||
/vendor/
|
||||
|
||||
# Assets and user uploads
|
||||
public/uploads/
|
||||
/public/bundles/*
|
||||
!/public/bundles/.gitkeep
|
||||
/public/assets/images/*
|
||||
!public/assets/images/.gitkeep
|
||||
/public/wallassets/*.dev.js
|
||||
web/uploads/
|
||||
/web/bundles/*
|
||||
!/web/bundles/.gitkeep
|
||||
/web/assets/images/*
|
||||
!web/assets/images/.gitkeep
|
||||
/web/wallassets/*.dev.js
|
||||
|
||||
# Build
|
||||
/app/build
|
||||
@ -40,6 +48,9 @@ data/db/wallabag*.sqlite
|
||||
# assets stuff
|
||||
node_modules/
|
||||
bin
|
||||
app/Resources/build/
|
||||
!/src/Wallabag/CoreBundle/Resources/public
|
||||
/src/Wallabag/CoreBundle/Resources/public/*
|
||||
|
||||
# Test-generated files
|
||||
admin-export.json
|
||||
@ -47,24 +58,4 @@ specialexport.json
|
||||
/data/site-credentials-secret-key.txt
|
||||
|
||||
# Custom CSS file
|
||||
public/custom.css
|
||||
|
||||
###> friendsofphp/php-cs-fixer ###
|
||||
/.php-cs-fixer.php
|
||||
/.php-cs-fixer.cache
|
||||
###< friendsofphp/php-cs-fixer ###
|
||||
|
||||
###> symfony/phpunit-bridge ###
|
||||
.phpunit.result.cache
|
||||
/phpunit.xml
|
||||
###< symfony/phpunit-bridge ###
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
/.env.local
|
||||
/.env.local.php
|
||||
/.env.*.local
|
||||
/config/secrets/prod/prod.decrypt.private.php
|
||||
/public/bundles/
|
||||
/var/
|
||||
/vendor/
|
||||
###< symfony/framework-bundle ###
|
||||
web/custom.css
|
||||
|
||||
49
CHANGELOG.md
@ -1,5 +1,54 @@
|
||||
# Changelog
|
||||
|
||||
## [2.6.5](https://github.com/wallabag/wallabag/tree/2.6.5)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.4...2.6.5)
|
||||
|
||||
### Fixes
|
||||
* "Fix checkboxes pointer-events disabled" by @Simounet https://github.com/wallabag/wallabag/pull/6874
|
||||
* "Fix nav input styles" by @Simounet https://github.com/wallabag/wallabag/pull/6877
|
||||
* "Change domain status filters html types" by @Simounet https://github.com/wallabag/wallabag/pull/6888
|
||||
|
||||
## [2.6.4](https://github.com/wallabag/wallabag/tree/2.6.4)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.3...2.6.4)
|
||||
|
||||
### Fixes
|
||||
* Fix API token generation by @nicosomb https://github.com/wallabag/wallabag/pull/6869
|
||||
* Fix checkboxes which were broken by @nicosomb https://github.com/wallabag/wallabag/pull/6864
|
||||
|
||||
## [2.6.3](https://github.com/wallabag/wallabag/tree/2.6.3)
|
||||
[Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.2...2.6.3)
|
||||
|
||||
### Security fixes
|
||||
* Replace GET way to POST way to reset data user by @nicosomb https://github.com/wallabag/wallabag/commit/78b0b55c40511e1f22d5bbb4897aa10fca68441c
|
||||
* Replace GET way to POST way to delete API client by @nicosomb https://github.com/wallabag/wallabag/commit/ffcc5c9062fcc8cd922d7d6d65edbe5efae96806
|
||||
|
||||
### Improvement
|
||||
* Add confirmation before reload entry by @nicosomb https://github.com/wallabag/wallabag/pull/6778
|
||||
* Remove external dependencies on howto page by @viktoriussuwandi https://github.com/wallabag/wallabag/pull/6775
|
||||
|
||||
### Fixes
|
||||
* Use Session instead of Referrer for Redirection by @Spoons https://github.com/wallabag/wallabag/pull/6119
|
||||
* Reduce risk of collision for #content by @kdecherf https://github.com/wallabag/wallabag/pull/6829
|
||||
* Update dependencies to fix vulnerabilities by @nicosomb https://github.com/wallabag/wallabag/pull/6783
|
||||
* Fix failing randomly test by @nicosomb https://github.com/wallabag/wallabag/pull/6763
|
||||
|
||||
### Technical stuff
|
||||
* Add check if git is installed by @nicosomb https://github.com/wallabag/wallabag/pull/6788
|
||||
* Replace kernel.root_dir by kernel.project_dir by @yguedidi https://github.com/wallabag/wallabag/pull/6809
|
||||
* Split symfony/symfony by @yguedidi https://github.com/wallabag/wallabag/pull/6817
|
||||
* Make Crawler::extract get an array by @yguedidi https://github.com/wallabag/wallabag/pull/6812
|
||||
* Use PSR-17 and PSR-18 by @yguedidi https://github.com/wallabag/wallabag/pull/6816
|
||||
* Replace Client by KernelBrowser by @yguedidi https://github.com/wallabag/wallabag/pull/6813
|
||||
* Replace Debug component by ErrorHandler component by @yguedidi https://github.com/wallabag/wallabag/pull/6810
|
||||
* Make ImportController extends AbstractController by @yguedidi https://github.com/wallabag/wallabag/pull/6808
|
||||
* Use Twig instead of templating by @yguedidi https://github.com/wallabag/wallabag/pull/6797
|
||||
* Identify platforms by their class by @yguedidi https://github.com/wallabag/wallabag/pull/6799
|
||||
* Move from transchoice to trans by @yguedidi https://github.com/wallabag/wallabag/pull/6800
|
||||
* Replace GetResponseEvent by RequestEvent by @yguedidi https://github.com/wallabag/wallabag/pull/6811
|
||||
* Ensure the kernel is shut down before calling createClient by @yguedidi https://github.com/wallabag/wallabag/pull/6803
|
||||
* Ignore docker-compose.override.yml by @yguedidi https://github.com/wallabag/wallabag/pull/6814
|
||||
* Add composer normalizer by @nicosomb https://github.com/wallabag/wallabag/pull/6762
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ build: ## Run webpack
|
||||
|
||||
prepare: clean ## Prepare database for testsuite
|
||||
ifdef DB
|
||||
cp .env.test.$(DB) .env.test
|
||||
cp app/config/tests/parameters_test.$(DB).yml app/config/parameters_test.yml
|
||||
endif
|
||||
-php bin/console doctrine:database:drop --force --env=test
|
||||
php bin/console doctrine:database:create --env=test
|
||||
|
||||
@ -9,7 +9,7 @@ During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE` (li
|
||||
#### Prepare the release
|
||||
|
||||
- Update these files with new information
|
||||
- `config/wallabag.yaml` (`wallabag.version`)
|
||||
- `app/config/wallabag.yml` (`wallabag_core.version`)
|
||||
- `CHANGELOG.md`
|
||||
- Create a PR named "Prepare $LAST_WALLABAG_RELEASE release".
|
||||
- Wait for test to be ok, merge it.
|
||||
@ -19,7 +19,7 @@ During this documentation, we assume the release is `$LAST_WALLABAG_RELEASE` (li
|
||||
- [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 MD5 sum and create the release blog post (based on the changelog).
|
||||
- Update Dockerfile https://github.com/wallabag/docker (and create a new tag)
|
||||
- Put the next patch version suffixed with `-dev` in `config/wallabag.yaml` (`wallabag.version`)
|
||||
- Put the next patch version suffixed with `-dev` in `app/config/wallabag.yml` (`wallabag_core.version`)
|
||||
- Drink a :beer:!
|
||||
|
||||
### Target PHP version
|
||||
|
||||
7
app/.htaccess
Normal file
@ -0,0 +1,7 @@
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
7
app/AppCache.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
|
||||
|
||||
class AppCache extends HttpCache
|
||||
{
|
||||
}
|
||||
101
app/AppKernel.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
public function registerBundles()
|
||||
{
|
||||
$bundles = [
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||
new FOS\RestBundle\FOSRestBundle(),
|
||||
new FOS\UserBundle\FOSUserBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
|
||||
new Nelmio\CorsBundle\NelmioCorsBundle(),
|
||||
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
|
||||
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
|
||||
new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
|
||||
new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
|
||||
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
|
||||
new Craue\ConfigBundle\CraueConfigBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
|
||||
new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(),
|
||||
new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
|
||||
new Http\HttplugBundle\HttplugBundle(),
|
||||
new Sentry\SentryBundle\SentryBundle(),
|
||||
new Twig\Extra\TwigExtraBundle\TwigExtraBundle(),
|
||||
|
||||
// wallabag bundles
|
||||
new Wallabag\CoreBundle\WallabagCoreBundle(),
|
||||
new Wallabag\ApiBundle\WallabagApiBundle(),
|
||||
new Wallabag\UserBundle\WallabagUserBundle(),
|
||||
new Wallabag\ImportBundle\WallabagImportBundle(),
|
||||
new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
|
||||
];
|
||||
|
||||
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
|
||||
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
|
||||
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
||||
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
|
||||
|
||||
if ('test' === $this->getEnvironment()) {
|
||||
$bundles[] = new DAMA\DoctrineTestBundle\DAMADoctrineTestBundle();
|
||||
}
|
||||
|
||||
if ('dev' === $this->getEnvironment()) {
|
||||
$bundles[] = new Symfony\Bundle\MakerBundle\MakerBundle();
|
||||
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
|
||||
}
|
||||
}
|
||||
|
||||
return $bundles;
|
||||
}
|
||||
|
||||
public function getCacheDir()
|
||||
{
|
||||
return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment();
|
||||
}
|
||||
|
||||
public function getLogDir()
|
||||
{
|
||||
return dirname(__DIR__) . '/var/logs';
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load($this->getProjectDir() . '/app/config/config_' . $this->getEnvironment() . '.yml');
|
||||
|
||||
$loader->load(function ($container) {
|
||||
if ($container->getParameter('use_webpack_dev_server')) {
|
||||
$container->loadFromExtension('framework', [
|
||||
'assets' => [
|
||||
'base_url' => 'http://localhost:8080/',
|
||||
],
|
||||
]);
|
||||
} else {
|
||||
$container->loadFromExtension('framework', [
|
||||
'assets' => [
|
||||
'base_url' => $container->getParameter('domain_name'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
$loader->load(function (ContainerBuilder $container) {
|
||||
// $container->setParameter('container.autowiring.strict_mode', true);
|
||||
// $container->setParameter('container.dumper.inline_class_loader', true);
|
||||
$container->addObjectResource($this);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Initial database structure.
|
||||
@ -14,8 +17,10 @@ class Version20160401000000 extends WallabagMigration
|
||||
{
|
||||
$this->skipIf($schema->hasTable($this->getTable('entry')), 'Database already initialized');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||
@ -58,7 +63,7 @@ SQL
|
||||
}
|
||||
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_5D9649505E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
CREATE TABLE {$this->getTable('entry')} (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, is_archived TINYINT(1) NOT NULL, is_starred TINYINT(1) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype LONGTEXT DEFAULT NULL, language LONGTEXT DEFAULT NULL, reading_time INT DEFAULT NULL, domain_name LONGTEXT DEFAULT NULL, preview_picture LONGTEXT DEFAULT NULL, is_public TINYINT(1) DEFAULT '0', INDEX IDX_F4D18282A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
|
||||
@ -91,7 +96,7 @@ SQL
|
||||
$this->addSql($query);
|
||||
}
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$sql = <<<SQL
|
||||
CREATE TABLE {$this->getTable('craue_config_setting')} (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, PRIMARY KEY(name));
|
||||
CREATE UNIQUE INDEX UNIQ_5D9649505E237E06 ON {$this->getTable('craue_config_setting')} (name);
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added foreign keys for account resetting.
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added name field on wallabag_oauth2_clients.
|
||||
@ -15,7 +16,7 @@ class Version20160812120952 extends WallabagMigration
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
$this->skipIf($clientsTable->hasColumn('name'), 'It seems that you already played this migration.');
|
||||
|
||||
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
// Can't use $clientsTable->addColumn('name', 'blob');
|
||||
// because of the error:
|
||||
// SQLSTATE[HY000]: General error: 1 Cannot add a NOT NULL column with default value NULL
|
||||
@ -35,7 +36,7 @@ class Version20160812120952 extends WallabagMigration
|
||||
{
|
||||
$clientsTable = $schema->getTable($this->getTable('oauth2_clients'));
|
||||
|
||||
if ('sqlite' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
$databaseTablePrefix = $this->container->getParameter('database_table_prefix');
|
||||
$this->addSql('DROP INDEX IDX_635D765EA76ED395');
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $databaseTablePrefix . 'oauth2_clients AS SELECT id, random_id, redirect_uris, secret, allowed_grant_types FROM ' . $databaseTablePrefix . 'oauth2_clients');
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added settings for RabbitMQ and Redis imports.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added pocket_consumer_key field on wallabag_config.
|
||||
@ -1,10 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added pocket_consumer_key field on wallabag_config.
|
||||
@ -13,11 +16,13 @@ class Version20161001072726 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
// remove all FK from entry_tag
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$query = $this->connection->query("
|
||||
SELECT CONSTRAINT_NAME
|
||||
FROM information_schema.key_column_usage
|
||||
@ -29,7 +34,7 @@ class Version20161001072726 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry_tag') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||
}
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||
$query = $this->connection->query("
|
||||
SELECT conrelid::regclass AS table_from
|
||||
@ -53,8 +58,8 @@ class Version20161001072726 extends WallabagMigration
|
||||
|
||||
// remove entry FK from annotation
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$query = $this->connection->query("
|
||||
SELECT CONSTRAINT_NAME
|
||||
FROM information_schema.key_column_usage
|
||||
@ -68,7 +73,7 @@ class Version20161001072726 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' DROP FOREIGN KEY ' . $fk['CONSTRAINT_NAME']);
|
||||
}
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
// http://dba.stackexchange.com/questions/36979/retrieving-all-pk-and-fk
|
||||
$query = $this->connection->query("
|
||||
SELECT conrelid::regclass AS table_from
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Converted database to utf8mb4 encoding (for MySQL only).
|
||||
@ -12,7 +13,7 @@ class Version20161022134138 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;');
|
||||
|
||||
@ -40,7 +41,7 @@ class Version20161022134138 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER DATABASE `' . $this->connection->getParams()['dbname'] . '` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;');
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added user_id column on oauth2_clients to prevent users to delete API clients from other users.
|
||||
@ -37,7 +38,7 @@ class Version20161024212538 extends WallabagMigration
|
||||
|
||||
$clientsTable->dropColumn('user_id', 'integer');
|
||||
|
||||
if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) {
|
||||
if (!$this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
$clientsTable->removeForeignKey($this->constraintName);
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added the internal setting to enable/disable downloading pictures.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added created_at index on entry table.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added action_mark_as_read field on config table.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added the internal setting to share articles to unmark.it.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add http_status in `entry_table`.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add the restricted_access internal setting for articles with paywall.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Methods and properties removed from `FOS\UserBundle\Model\User`.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added list_mode in user config.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Removed locked, credentials_expire_at and expires_at.
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Renamed uuid to uid in entry table.
|
||||
@ -16,18 +19,20 @@ class Version20161214094402 extends WallabagMigration
|
||||
|
||||
$this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__wallabag_entry AS SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP TABLE ' . $this->getTable('entry'));
|
||||
$this->addSql('CREATE TABLE ' . $this->getTable('entry') . ' (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, uid CLOB DEFAULT NULL COLLATE BINARY, title CLOB DEFAULT NULL COLLATE BINARY, url CLOB DEFAULT NULL COLLATE BINARY, is_archived BOOLEAN NOT NULL, is_starred BOOLEAN NOT NULL, content CLOB DEFAULT NULL COLLATE BINARY, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, mimetype CLOB DEFAULT NULL COLLATE BINARY, language CLOB DEFAULT NULL COLLATE BINARY, reading_time INTEGER DEFAULT NULL, domain_name CLOB DEFAULT NULL COLLATE BINARY, preview_picture CLOB DEFAULT NULL COLLATE BINARY, is_public BOOLEAN DEFAULT "0", PRIMARY KEY(id));');
|
||||
$this->addSql('INSERT INTO ' . $this->getTable('entry') . ' (id, user_id, uid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public) SELECT id, user_id, uuid, title, url, is_archived, is_starred, content, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, is_public FROM __temp__wallabag_entry;');
|
||||
$this->addSql('DROP TABLE __temp__wallabag_entry');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uuid uid VARCHAR(23)');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uuid TO uid');
|
||||
}
|
||||
}
|
||||
@ -38,14 +43,16 @@ class Version20161214094402 extends WallabagMigration
|
||||
|
||||
$this->skipIf($entryTable->hasColumn('uuid'), 'It seems that you already played this migration.');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE uid uuid VARCHAR(23)');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' RENAME uid TO uuid');
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added index on wallabag_entry.uid.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added indexes on wallabag_entry.is_starred and wallabag_entry.is_archived.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add the share_scuttle internal setting.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add published_at and published_by in `entry` table.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove isPublic in Entry Table.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove download_pictures in craue_config_setting.
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add site credential table to store username & password for some website (behind authentication or paywall).
|
||||
@ -25,7 +26,7 @@ class Version20170501115751 extends WallabagMigration
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
|
||||
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
$schema->dropSequence('site_credential_id_seq');
|
||||
$schema->createSequence('site_credential_id_seq');
|
||||
}
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table.
|
||||
@ -19,7 +20,7 @@ class Version20170510082609 extends WallabagMigration
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
foreach ($this->fields as $field) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
|
||||
@ -28,7 +29,7 @@ class Version20170510082609 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
foreach ($this->fields as $field) {
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added `headers` field in entry table.
|
||||
@ -1,10 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Increase the length of the "quote" column of "annotation" table.
|
||||
@ -13,8 +16,10 @@ class Version20170511211659 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$annotationTableName = $this->getTable('annotation', true);
|
||||
$userTableName = $this->getTable('user', true);
|
||||
$entryTableName = $this->getTable('entry', true);
|
||||
@ -53,10 +58,10 @@ EOD
|
||||
);
|
||||
$this->addSql('DROP TABLE __temp__wallabag_annotation');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT');
|
||||
break;
|
||||
}
|
||||
@ -66,14 +71,16 @@ EOD
|
||||
{
|
||||
$tableName = $this->getTable('annotation');
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
throw new SkipMigrationException('Too complex ...');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)');
|
||||
break;
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add api_user_registration in craue_config_setting.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove wallabag_url from craue_config_setting.
|
||||
@ -13,7 +13,7 @@ class Version20170606155640 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf(!$schema->hasTable($this->getTable('craue_config_setting')), 'Old migration (table name has changed)');
|
||||
$this->skipIf(!$schema->hasTable($this->getTable('craue_config_setting')), 'Table already renamed');
|
||||
|
||||
$apiUserRegistration = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Changed tags to lowercase.
|
||||
@ -12,7 +13,7 @@ class Version20170719231144 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$this->skipIf($this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
// Find tags which need to be merged
|
||||
$dupTags = $this->connection->query('
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add starred_at column and set its value to updated_at for is_starred entries.
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Changed reading_time field to prevent null value.
|
||||
@ -12,14 +15,16 @@ class Version20171008195606 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11) NOT NULL;');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('UPDATE ' . $this->getTable('entry') . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time SET NOT NULL;');
|
||||
break;
|
||||
@ -28,13 +33,15 @@ class Version20171008195606 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('sqlite' === $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'mysql':
|
||||
$this->skipIf($platform instanceof SqlitePlatform, 'Migration can only be executed safely on \'mysql\' or \'postgresql\'.');
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' CHANGE reading_time reading_time INT(11);');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER COLUMN reading_time DROP NOT NULL;');
|
||||
break;
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add origin_url column.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add store_article_headers in craue_config_setting.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add shaarli_share_origin_url in craue_config_setting.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add archived_at column and set its value to updated_at for is_archived entries.
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Fix varchar field from vendor to work with utf8mb4.
|
||||
@ -12,7 +13,7 @@ class Version20181128203230 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
||||
@ -27,7 +28,7 @@ class Version20181128203230 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration can only be applied on \'mysql\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration can only be applied on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add 2fa OTP stuff.
|
||||
@ -12,8 +15,10 @@ final class Version20181202073750 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||
@ -28,13 +33,13 @@ final class Version20181202073750 extends WallabagMigration
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON ' . $this->getTable('user', true) . ' (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E592FC23A8 ON ' . $this->getTable('user', true) . ' (username_canonical)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE twoFactorAuthentication emailTwoFactor BOOLEAN NOT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD backupCodes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD googleAuthenticatorSecret VARCHAR(191) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN twofactorauthentication TO emailTwoFactor');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP trusted');
|
||||
@ -45,8 +50,10 @@ final class Version20181202073750 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E592FC23A8');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5A0D96FBF');
|
||||
$this->addSql('DROP INDEX UNIQ_1D63E7E5C05FB297');
|
||||
@ -59,13 +66,13 @@ final class Version20181202073750 extends WallabagMigration
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5A0D96FBF ON "' . $this->getTable('user', true) . '" (email_canonical)');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D63E7E5C05FB297 ON "' . $this->getTable('user', true) . '" (confirmation_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP googleAuthenticatorSecret');
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` CHANGE emailtwofactor twoFactorAuthentication BOOLEAN NOT NULL');
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` ADD trusted TEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE `' . $this->getTable('user') . '` DROP backupCodes');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' DROP googleAuthenticatorSecret');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' RENAME COLUMN emailTwoFactor TO twofactorauthentication');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('user') . ' ADD trusted TEXT DEFAULT NULL');
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add updated_at fields to site_credential table.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add missing entries in craue_config_setting.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add hashed_url in entry.
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Rename rss_token & rss_limit to feed_token & feed_limit.
|
||||
@ -12,8 +15,10 @@ final class Version20190425115043 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, rss_token, rss_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM ' . $this->getTable('config', true));
|
||||
$this->addSql('DROP TABLE ' . $this->getTable('config', true));
|
||||
@ -22,11 +27,11 @@ final class Version20190425115043 extends WallabagMigration
|
||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON ' . $this->getTable('config', true) . ' (user_id)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_token feed_token VARCHAR(255) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE rss_limit feed_limit INT DEFAULT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_token TO feed_token');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN rss_limit TO feed_limit');
|
||||
break;
|
||||
@ -35,8 +40,10 @@ final class Version20190425115043 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX UNIQ_87E64C53A76ED395');
|
||||
$this->addSql('CREATE TEMPORARY TABLE __temp__' . $this->getTable('config', true) . ' AS SELECT id, user_id, theme, items_per_page, language, feed_token, feed_limit, reading_speed, pocket_consumer_key, action_mark_as_read, list_mode FROM "' . $this->getTable('config', true) . '"');
|
||||
$this->addSql('DROP TABLE "' . $this->getTable('config', true) . '"');
|
||||
@ -45,11 +52,11 @@ final class Version20190425115043 extends WallabagMigration
|
||||
$this->addSql('DROP TABLE __temp__' . $this->getTable('config', true));
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_87E64C53A76ED395 ON "' . $this->getTable('config', true) . '" (user_id)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_token rss_token');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' CHANGE feed_limit rss_limit');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_token TO rss_token');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('config') . ' RENAME COLUMN feed_limit TO rss_limit');
|
||||
break;
|
||||
@ -1,10 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Enable cascade delete when deleting a user on:
|
||||
@ -17,8 +20,10 @@ final class Version20190510141130 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX IDX_368A4209A76ED395');
|
||||
$this->addSql('DROP INDEX IDX_368A420919EB6921');
|
||||
$this->addSql('DROP INDEX UNIQ_368A42095F37A13B');
|
||||
@ -60,7 +65,7 @@ final class Version20190510141130 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX IDX_EE52E3FAA76ED395 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (user_id)');
|
||||
$this->addSql('CREATE INDEX IDX_EE52E3FA19EB6921 ON ' . $this->getTable('oauth2_auth_codes', true) . ' (client_id)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP FOREIGN KEY FK_368A4209A76ED395');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||
|
||||
@ -75,7 +80,7 @@ final class Version20190510141130 extends WallabagMigration
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' DROP FOREIGN KEY FK_EE52E3FAA76ED395');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' ADD CONSTRAINT FK_EE52E3FAA76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' DROP CONSTRAINT FK_368A4209A76ED395');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' ADD CONSTRAINT FK_368A4209A76ED395 FOREIGN KEY (user_id) REFERENCES ' . $this->getTable('user') . ' (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
|
||||
@ -2,10 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Convert tab label to utf8mb4_bin (MySQL only).
|
||||
@ -14,7 +15,7 @@ final class Version20190511165128 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
|
||||
@ -22,7 +23,7 @@ final class Version20190511165128 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof MySQLPlatform, 'This migration only apply to MySQL');
|
||||
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added `given_url` & `hashed_given_url` field in entry table.
|
||||
@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Change reading_time field on SQLite to be integer NOT NULL
|
||||
@ -14,7 +15,7 @@ final class Version20190619093534 extends WallabagMigration
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
||||
|
||||
$this->addSql('UPDATE ' . $this->getTable('entry', true) . ' SET reading_time = 0 WHERE reading_time IS NULL;');
|
||||
|
||||
@ -42,7 +43,7 @@ final class Version20190619093534 extends WallabagMigration
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->skipIf('sqlite' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'sqlite\'.');
|
||||
$this->skipIf(!$this->connection->getDatabasePlatform() instanceof SqlitePlatform, 'Migration can only be executed safely on \'sqlite\'.');
|
||||
|
||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||
$this->addSql('DROP INDEX created_at');
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Change reading speed value.
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Adding more index to kill some slow queries:
|
||||
@ -18,8 +21,10 @@ final class Version20190806130304 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX uid');
|
||||
$this->addSql('DROP INDEX created_at');
|
||||
$this->addSql('DROP INDEX hashed_url_user_id');
|
||||
@ -44,7 +49,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag', true) . ' (label)');
|
||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config', true) . ' (feed_token)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language VARCHAR(20) DEFAULT NULL');
|
||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||
@ -53,7 +58,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX tag_label ON ' . $this->getTable('tag') . ' (label (255))');
|
||||
$this->addSql('CREATE INDEX config_feed_token ON ' . $this->getTable('config') . ' (feed_token (255))');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE VARCHAR(20)');
|
||||
$this->addSql('CREATE INDEX user_language ON ' . $this->getTable('entry') . ' (language, user_id)');
|
||||
$this->addSql('CREATE INDEX user_archived ON ' . $this->getTable('entry') . ' (user_id, is_archived, archived_at)');
|
||||
@ -67,8 +72,10 @@ final class Version20190806130304 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('DROP INDEX IDX_F4D18282A76ED395');
|
||||
$this->addSql('DROP INDEX created_at');
|
||||
$this->addSql('DROP INDEX uid');
|
||||
@ -93,7 +100,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('CREATE INDEX hashed_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_url)');
|
||||
$this->addSql('CREATE INDEX hashed_given_url_user_id ON ' . $this->getTable('entry', true) . ' (user_id, hashed_given_url)');
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' MODIFY language LONGTEXT DEFAULT NULL');
|
||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||
@ -102,7 +109,7 @@ final class Version20190806130304 extends WallabagMigration
|
||||
$this->addSql('DROP INDEX tag_label ON ' . $this->getTable('tag'));
|
||||
$this->addSql('DROP INDEX config_feed_token ON ' . $this->getTable('config'));
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('entry') . ' ALTER language TYPE TEXT');
|
||||
$this->addSql('DROP INDEX user_language ON ' . $this->getTable('entry'));
|
||||
$this->addSql('DROP INDEX user_archived ON ' . $this->getTable('entry'));
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Change the internal setting table name.
|
||||
@ -12,14 +15,16 @@ final class Version20190808124957 extends WallabagMigration
|
||||
{
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting', true) . ' RENAME TO ' . $this->getTable('internal_setting', true));
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME ' . $this->getTable('internal_setting'));
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' RENAME TO ' . $this->getTable('internal_setting'));
|
||||
break;
|
||||
}
|
||||
@ -27,14 +32,16 @@ final class Version20190808124957 extends WallabagMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting', true) . ' RENAME TO ' . $this->getTable('craue_config_setting', true));
|
||||
break;
|
||||
case 'mysql':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME ' . $this->getTable('craue_config_setting'));
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $this->getTable('internal_setting') . ' RENAME TO ' . $this->getTable('craue_config_setting'));
|
||||
break;
|
||||
}
|
||||
@ -2,10 +2,11 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Add tables for the ignore origin rules.
|
||||
@ -23,7 +24,7 @@ final class Version20190826204730 extends WallabagMigration
|
||||
$userTable->setPrimaryKey(['id']);
|
||||
$userTable->addForeignKeyConstraint($this->getTable('config'), ['config_id'], ['id'], [], 'fk_config');
|
||||
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
$schema->dropSequence('ignore_origin_user_rule_id_seq');
|
||||
$schema->createSequence('ignore_origin_user_rule_id_seq');
|
||||
}
|
||||
@ -35,7 +36,7 @@ final class Version20190826204730 extends WallabagMigration
|
||||
$instanceTable->addColumn('rule', 'string', ['length' => 255]);
|
||||
$instanceTable->setPrimaryKey(['id']);
|
||||
|
||||
if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
|
||||
if ($this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
|
||||
$schema->dropSequence('ignore_origin_instance_rule_id_seq');
|
||||
$schema->createSequence('ignore_origin_instance_rule_id_seq');
|
||||
}
|
||||
@ -44,7 +45,7 @@ final class Version20190826204730 extends WallabagMigration
|
||||
|
||||
public function postUp(Schema $schema): void
|
||||
{
|
||||
foreach ($this->container->getParameter('wallabag.default_ignore_origin_instance_rules') as $entity) {
|
||||
foreach ($this->container->getParameter('wallabag_core.default_ignore_origin_instance_rules') as $entity) {
|
||||
$previous_rule = $this->container
|
||||
->get('doctrine.orm.default_entity_manager')
|
||||
->getConnection()
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Migrations\SkipMigrationException;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove baggy theme.
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Renamed Piwik to Matomo in configuration.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Drop theme fields from config table.
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Remove the deprecated (and removed in DBAL v3) `json_array` type.
|
||||
@ -13,8 +16,10 @@ final class Version20221221092957 extends WallabagMigration
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$userTable = $this->getTable('user');
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$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)
|
||||
@ -26,10 +31,10 @@ final class Version20221221092957 extends WallabagMigration
|
||||
$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':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupcodes TYPE JSON USING backupcodes::json');
|
||||
break;
|
||||
}
|
||||
@ -38,8 +43,10 @@ final class Version20221221092957 extends WallabagMigration
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$userTable = $this->getTable('user');
|
||||
switch ($this->connection->getDatabasePlatform()->getName()) {
|
||||
case 'sqlite':
|
||||
$platform = $this->connection->getDatabasePlatform();
|
||||
|
||||
switch (true) {
|
||||
case $platform instanceof SqlitePlatform:
|
||||
$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)
|
||||
@ -51,10 +58,10 @@ final class Version20221221092957 extends WallabagMigration
|
||||
$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':
|
||||
case $platform instanceof MySQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' CHANGE backupCodes backupCodes JSON DEFAULT NULL COMMENT \'(DC2Type:json_array)\'');
|
||||
break;
|
||||
case 'postgresql':
|
||||
case $platform instanceof PostgreSQLPlatform:
|
||||
$this->addSql('ALTER TABLE ' . $userTable . ' ALTER backupCodes TYPE TEXT');
|
||||
break;
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
namespace Application\Migrations;
|
||||
|
||||
use App\Doctrine\WallabagMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Wallabag\CoreBundle\Doctrine\WallabagMigration;
|
||||
|
||||
/**
|
||||
* Added a new setting to display or not thumbnails.
|
||||
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 891 B After Width: | Height: | Size: 891 B |
|
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 451 B |
|
Before Width: | Height: | Size: 995 B After Width: | Height: | Size: 995 B |
|
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 1012 B |
|
Before Width: | Height: | Size: 718 B After Width: | Height: | Size: 718 B |
|
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 138 B After Width: | Height: | Size: 138 B |
@ -3,7 +3,7 @@
|
||||
========================================================================== */
|
||||
|
||||
main {
|
||||
#content {
|
||||
div#content {
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
}
|
||||