Commit graph

154 commits

Author SHA1 Message Date
Jeremy Benoist
1576905e03
Rename internal settings table
In fact it's not _just_ a rename.
We are now able to use our own entity with the CraueConfigBundle which allow us to enforce a custom length on string field and avoid error with utf8mb4 on MySQL.
To fix that issue before we were in need to fork CraueConfigBundle to hard apply these length changes.

The recent 2.3.0 release fix that issue. That's why we are in need to rename the table (getting rid of the bundle name from it)

Also updating deps:
  - Updating symfony/polyfill-mbstring (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-ctype (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-php70 (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-util (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-php56 (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-intl-icu (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-apcu (v1.11.0 => v1.12.0)
  - Updating j0k3r/graby-site-config (1.0.88 => 1.0.89)
  - Updating php-http/message (1.7.2 => 1.8.0)
  - Updating symfony/polyfill-php73 (v1.11.0 => v1.12.0)
  - Updating symfony/http-client (v4.3.2 => v4.3.3)
  - Updating symfony/polyfill-php72 (v1.11.0 => v1.12.0)
  - Updating symfony/polyfill-intl-idn (v1.11.0 => v1.12.0)
  - Updating symfony/mime (v4.3.2 => v4.3.3)
  - Updating craue/config-bundle (dev-utf8mb4 46cfd37 => 2.3.0)
  - Updating masterminds/html5 (2.6.0 => 2.7.0)
  - Updating nette/di (v3.0.0 => v3.0.1)
  - Updating symfony/polyfill-iconv (v1.11.0 => v1.12.0)
  - Updating wallabag/php-mobi (1.0.1 => 1.1.0)
2019-08-08 16:03:20 +02:00
Jeremy Benoist
00567d9ccd
CS 2019-08-08 11:45:39 +02:00
Jeremy Benoist
0810c75e0b
Add tag_label & config_feed_token index 2019-08-08 09:36:03 +02:00
Olivier Mehani
2b0f4e86b2
Add user_created index
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-07 22:02:37 +10:00
Olivier Mehani
588de419e0
Add user_archived index
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-07 21:44:00 +10:00
Jeremy Benoist
b700b38e17
Fix PG migration 2019-08-07 11:46:58 +02:00
Jeremy Benoist
24acf2e0f3
Fix migrations 2019-08-07 11:25:55 +02:00
Olivier Mehani
5071c8c9cf
Add index on starred entries
Fixes #4079

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-06 23:21:47 +10:00
Olivier Mehani
d1dbe10e84
Update language in Entry model, and add index
Fixes #4080

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
2019-08-06 23:21:18 +10:00
Jeremy Benoist
41022cb289
Add ability to manually define the reading speed
Instead of using a select, let the user decide its own speed.
2019-07-08 20:18:59 +02:00
Jeremy Benoist
b8fa1b13a6
Fix hardcoded wallabag_ prefix in migration
Again.
Looks like there are still some which were missing to be replaced.
2019-07-01 13:38:53 +02:00
Jérémy Benoist
bd6a7622d3
Merge pull request #4020 from wallabag/fix/sqlite-reading-time-null
Fix `reading_time` being NULL on SQLite
2019-06-24 07:31:13 +02:00
Jeremy Benoist
c1a5dfe5e4
Use skipIf instead of abortIf
This is to avoid migration using an other SGBD to break.
2019-06-21 09:15:35 +02:00
Jeremy Benoist
1f36a21887
Fix reading_time being NULL on SQLite 2019-06-20 09:50:07 +02:00
Jeremy Benoist
227e44d49c
Fix PG migration 2019-06-19 09:06:58 +02:00
Jeremy Benoist
22807de7c5
Fix migration with prefix table name
Looks like we missed one `wallabag_user` in migration.
It can work for most people but if someone use a different prefix, it'll break.
2019-06-18 22:10:46 +02:00
Jérémy Benoist
c19845a7ae
Merge pull request #3959 from wallabag/mig-tag-collation
mysql: change collation of tag label
2019-06-06 12:03:37 +02:00
Jeremy Benoist
70df4c3359
Use two indexes instead of one for hashed urls
When using `OR` in a where clause, a composite index can't be used. We should use a `UNION` to take advantages of it.
Instead, create 2 indexes on each hashed urls and make 2 queries to find an url. It'll be faster than the previous solution.
2019-06-05 10:53:15 +02:00
Jeremy Benoist
f3bfb875e9
Use hash given url to avoid duplicate
Using hashed url we can ensure an index on them to ensure it's fast.
2019-05-29 15:56:20 +02:00
Nicolas Lœuillet
b7fa51ae7d
Added given_url in entry table
- Added index on entry table for given_url field
- Fix tests:

    The previous `bit.ly` url redirected to doc.wallabag but that url doesn't exist in the fixtures.
    I used our own internal "redirector" to create a redirect to an url which exist in the fixtures.

Also, updating current migration to use the new `WallabagMigration`.
2019-05-29 13:50:59 +02:00
Kevin Decherf
feb239ea10 mysql: change collation of tag table
utf8mb4_unicode_ci considers that 'caché' is equal to 'cache' which
can lead to attaching incorrect tags to entries. This issue is due to
some unicode normalization done by MySQL.

utf8mb4_bin makes no unicode normalization, letting wallabag to consider
'cache' and 'caché' as two different tags.

We change the collation of the whole table as Doctrine does not support
setting a collation on a column for a specific platform (it tries to
apply utf8mb4_bin even for pgsql and sqlite).

Fixes #3302

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2019-05-19 23:37:49 +02:00
Jeremy Benoist
754bf12e67
Fix SQLite constraint 2019-05-10 21:15:46 +02:00
Jeremy Benoist
d2ef2d6df8
Fix SQLite migration 2019-05-10 20:36:45 +02:00
Jeremy Benoist
637f0df976
Cascade delete on oauth2 table when deleting a user 2019-05-10 20:36:45 +02:00
Jeremy Benoist
f277bc042c
Fix tests & cs & migration 2019-04-26 12:53:21 +02:00
Jeremy Benoist
5cc0646e66
Fix index on MySQL 2019-04-01 15:45:17 +02:00
Jeremy Benoist
c579ce2306
Some cleanup
Also, do not run the hashed_url migration into a Doctrine migration
2019-04-01 14:34:20 +02:00
Jeremy Benoist
8a64566298
Use a better index for hashed_url
It'll most often be used in addition to the `user_id`.
Also, automatically generate the hash when saving the url.
Switch from `md5` to `sha1`.
2019-04-01 13:51:57 +02:00
Jeremy Benoist
9c2b2aae70
Keep url in exists endpoint
- Add migration
- Use md5 instead of sha512 (we don't need security here, just a hash)
- Update tests
2019-04-01 13:24:40 +02:00
Jeremy Benoist
85403dae04
Disable down for that migration 2019-03-01 20:26:59 +01:00
Jeremy Benoist
fcd54e2447
Test each internal settings before creating them 2019-03-01 20:26:58 +01:00
Nadrieril
c2efb5a306
Add missing entries in craue_config_setting.
Should fix https://github.com/wallabag/wallabag/issues/3662
2019-03-01 20:26:58 +01:00
Jeremy Benoist
842af5c357
Add SQLite & PG migration
Also remove the forced `server_version` from dbal config to avoid an
hard overriding across all database.
2019-01-23 13:28:23 +01:00
Jeremy Benoist
dfd0a7bc5f
Add backup codes 2019-01-23 13:28:03 +01:00
Jeremy Benoist
a6b242a1fd
Enable OTP 2FA
- Update SchebTwoFactorBundle to version 3
- Enable Google 2fa on the bundle
- Disallow ability to use both email and google as 2fa
- Update Ocramius Proxy Manager to handle typed function & attributes (from PHP 7)
- use `$this->addFlash` shortcut instead of `$this->get('session')->getFlashBag()->add`
- update admin to be able to create/reset the 2fa
2019-01-23 13:28:02 +01:00
Jeremy Benoist
1e0d8ad7b7
Enable PHPStan
- Fix error for level 0 & 1 (level 7 has 699 errors...)
- Add `updated_at` to site_credential (so the `timestamps()` method applies correctly)
2019-01-18 15:25:50 +01:00
Jeremy Benoist
877787e5fe
Fix utf8mb4 on vendor tables
When creating the schema for test these tables use default length for
string: 255. Which fail when using utf8mb4.

> Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Also move the `setKeepStaticConnections` in before and after class to
avoid:

> SAVEPOINT DOCTRINE2_SAVEPOINT_2 does not exist

See https://github.com/dmaicher/doctrine-test-bundle#troubleshooting
2018-11-28 22:04:55 +01:00
Sébastien Viande
7975395d10
Entry: add archived_at property and updateArchived method 2018-09-21 10:33:33 +02:00
Kevin Decherf
2a1ceb67b4 php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 14:25:32 +02:00
Jeremy Benoist
49b4c87598
We should able to get the table name unescaped
When we want to perform complex queries to retrieve metadata from the database
2018-06-14 14:15:07 +02:00
Jeremy Benoist
bfe7a69226
Fixed migrations with dash into db name 2018-06-14 13:43:09 +02:00
Jérémy Benoist
d1f260e2d7
Merge pull request #3504 from aaa2000/fix-initial-migration-with-table-prefix
Fix initial migration when using custom table prefix
2017-12-16 22:24:06 +01:00
Jeremy Benoist
ccb52fb461
Use getTable() to retrieve prefixed table name 2017-12-16 22:08:00 +01:00
Nicolas Lœuillet
caf719f163
Fixed lower case tags migration 2017-12-15 13:59:02 +01:00
adev
f1f2cf2bce Fix initial migration when using custom table prefix
Fix #3503
2017-12-14 19:14:10 +01:00
Jeremy Benoist
3fadf42a1c
CS 2017-12-12 14:30:22 +01:00
Jeremy Benoist
ad46f2fb46
Use hasTable instead of try/catch 2017-12-12 13:41:44 +01:00
Jeremy Benoist
43e1711eb6
Change the way to check for initial migration 2017-12-12 11:17:16 +01:00
Kevin Decherf
40a63c8b11 migrations: fix duplicate violation during lowercase tag migration
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-10 19:31:30 +01:00
Kevin Decherf
6c5904ba7f Replace raw query with named parameter
Fix possible issue with special chars on #3139

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-12-10 18:22:41 +01:00