Commit Graph

136 Commits

Author SHA1 Message Date
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
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
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
754bf12e67 Fix SQLite constraint 2019-05-10 21:15:46 +02:00
d2ef2d6df8 Fix SQLite migration 2019-05-10 20:36:45 +02:00
637f0df976 Cascade delete on oauth2 table when deleting a user 2019-05-10 20:36:45 +02:00
f277bc042c Fix tests & cs & migration 2019-04-26 12:53:21 +02:00
5cc0646e66 Fix index on MySQL 2019-04-01 15:45:17 +02:00
c579ce2306 Some cleanup
Also, do not run the hashed_url migration into a Doctrine migration
2019-04-01 14:34:20 +02:00
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
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
85403dae04 Disable down for that migration 2019-03-01 20:26:59 +01:00
fcd54e2447 Test each internal settings before creating them 2019-03-01 20:26:58 +01:00
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
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
dfd0a7bc5f Add backup codes 2019-01-23 13:28:03 +01:00
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
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
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
7975395d10 Entry: add archived_at property and updateArchived method 2018-09-21 10:33:33 +02:00
2a1ceb67b4 php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2018-09-05 14:25:32 +02:00
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
bfe7a69226 Fixed migrations with dash into db name 2018-06-14 13:43:09 +02:00
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
ccb52fb461 Use getTable() to retrieve prefixed table name 2017-12-16 22:08:00 +01:00
caf719f163 Fixed lower case tags migration 2017-12-15 13:59:02 +01:00
f1f2cf2bce Fix initial migration when using custom table prefix
Fix #3503
2017-12-14 19:14:10 +01:00
3fadf42a1c CS 2017-12-12 14:30:22 +01:00
ad46f2fb46 Use hasTable instead of try/catch 2017-12-12 13:41:44 +01:00
43e1711eb6 Change the way to check for initial migration 2017-12-12 11:17:16 +01:00
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
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
893fd6434f Add craue setting to enable sharing of origin url to Shaarli
Also fix the field name used in the query string and add it to baggy
theme

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-25 17:07:55 +01:00
f4e7a0df0e Fix phpcs 2017-11-21 22:07:37 +01:00
18865cec86 Implements down migration 2017-11-21 21:35:17 +01:00
2680b0bc8c Fix installation command 2017-11-21 21:35:17 +01:00
18fb777b89 Add an initial migration 2017-11-21 21:35:16 +01:00
95b7d92ea5 Merge pull request #3425 from wallabag/add-setting-for-headers
Added internal setting to enable/disable headers storage
2017-11-21 13:26:24 +01:00
b3d85e69e9 Fix MySQL issue on mig from #3373
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-20 22:39:33 +01:00
8a21985474 Added internal setting to enable/disable headers storage 2017-11-20 18:47:48 +01:00
eae8138b33 Fix phpcs
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-19 15:26:13 +01:00
e0ef1a1c8b Add originUrl property to Entry, handle that in EntryRestController, handle migration
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-11-19 15:02:11 +01:00
abce2f05dd Fixed @Kdecherf's review 2017-10-13 10:11:24 +02:00
705d3c38dc CS 2017-10-13 09:35:44 +02:00
88bac4a33e Changed reading_time field to prevent null values 2017-10-13 09:35:44 +02:00
3ef055ced3 CS 2017-10-09 16:47:15 +02:00
3af5d41759 Merge pull request #3139 from Kdecherf/2502-tag-case
Ignore tag's case
2017-09-03 20:25:15 +02:00
7b4f66881d php-cs-fixer on DoctrineMigrations/Version20170719231144
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-08-27 16:59:02 +02:00
bd164a75c4 Add migration to change case of tags
This migration does not support SQLite as long as this engine does not
support Unicode in LOWER().

This migration starts by retrieving the list of lowercase tags which
need to be migrated. Then it retrieves the list of tags for each tags
from the previous step in order to migrate entries. It handles deletion
of empty tags. At the end the migration makes a full scan to update the
label of all remaining tags.

WARNING: THIS MIGRATION IS IRREVERSIBLE.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2017-08-27 16:51:23 +02:00
a991c46eed Set a starred_at field when an entry is starred.
This date is used to sort starred entries.

Can not use Entry::timestamps method otherwise starred_at will be updated each time entry is updated.
Add an updateStar method into Entry class
A migration script has been added in order to set starred_at field.
2017-08-25 21:19:47 +02:00