summaryrefslogtreecommitdiffstats
path: root/core/Command/Db
Commit message (Collapse)AuthorAgeFilesLines
* Fix strict comparisonJoas Schilling2022-04-271-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix type fixingJoas Schilling2022-04-251-1/+1
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Give hints on correct migration versioningJoas Schilling2022-04-251-0/+32
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Additional index on oc_preferences to make sure that gettingh values without ↵Julius Härtl2022-04-191-0/+13
| | | | | | a user filter is fast Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Merge pull request #31735 from nextcloud/fix/noid/mig-generator-copyrightCôme Chilliet2022-03-291-0/+24
|\ | | | | migration generator also includes copyright section
| * migration generator also includes copyright sectionArthur Schiwon2022-03-281-0/+24
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* | Merge pull request #31609 from nextcloud/fix/migrate-away-from-iloggerCôme Chilliet2022-03-291-10/+8
|\ \ | |/ |/| Migrate from ILogger to LoggerInterface in lib/private
| * Adapt more code to migration to LoggerInterfaceCôme Chilliet2022-03-241-10/+8
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Don't create cards_abiduri it if already existsLouis Chemineau2022-03-241-5/+9
|/ | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Merge pull request #31304 from nextcloud/feature/dry_run_for_add_indicesChristoph Wurst2022-02-283-37/+130
|\ | | | | Add --dry-run option for add-missing-* cmd
| * Add --dry-run option for db:add-missing-* cmdLouis Chemineau2022-02-243-37/+130
| | | | | | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* | Improve performance when converting between DBsCarl Schwan2022-02-161-15/+25
|/ | | | | | | | | Use a transaction when doing multiple inserts increase the writing speed. Ref: https://stackoverflow.com/a/68495887 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add index for direct editing cleanup jobJulius Härtl2022-02-071-0/+13
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Check style updateCarl Schwan2022-01-132-2/+2
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Add missing index for propertypath only queries against propertiesChristoph Wurst2021-12-231-0/+13
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add an index for selecting the next jobJoas Schilling2021-12-011-0/+13
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* disable path prefix index on postgresql for nowRobin Appelman2021-10-081-1/+2
| | | | | | | having the index work properly for the queries we need it for requires some additional options which dbal does not support at the momement. to prevent making it harder to add the correct index later on we don't create the index for now on postgresql Signed-off-by: Robin Appelman <robin@icewind.nl>
* add a prefix index to filecache.pathRobin Appelman2021-10-081-0/+7
| | | | | | | | | | | | The reason that `filecache.path` hasn't had an index added is the mysql limitation of ~1kb for indexeded fields, which is to small for the `path`, however mysql supports indexing only the first N bytes of a column instead of the entire column, allowing us to add an index even if the column is to long. Because the index doesn't cover the entire column it can't be used in all situations where a normal index would be used, but it does cover the `path like 'folder/path/%'` queries that are used in various places. Sqlite and Postgresql don't support prefix indexes, but they also don't have the 1kb limit and DBAL handles the differences in index creation. Signed-off-by: Robin Appelman <robin@icewind.nl>
* add better index for finding unindexed pathsRobin Appelman2021-10-071-0/+7
| | | | | | | | | | for the following query 'SELECT "path" FROM "oc_filecache" WHERE ("storage" = $storage) AND ("size" < 0) ORDER BY "fileid" DESC LIMIT 1;' currently the database will in some cases decide to priorize the sort by fileid over the filter when picking what index to use, resulting in a much slower query. by creating an index that allows first sorting by fileid and also filter by storage and size this case will be greatly sped up Signed-off-by: Robin Appelman <robin@icewind.nl>
* Convert command option defaults to stringsChristoph Wurst2021-06-091-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #27429 from nextcloud/bug/26085/wrong-data-add-order-byChristoph Wurst2021-06-091-5/+2
|\ | | | | Don't pass a column object to addOrderBy
| * Fix #26085Daniel Kesselberg2021-06-081-5/+2
| | | | | | | | | | | | | | | | addOrderBy expects a order expression. For the migration scenario we have column objects. Column objects are not supported by quoteColumnName yet. A column object as order expression is most likely an edgy thing when migration database information. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Update php licensesJohn Molakvoæ (skjnldsv)2021-06-0410-15/+12
|/ | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Revert "add a prefix index to filecache.path"Roeland Jago Douma2021-04-081-7/+0
|
* Cleanup unneeded code around database.xmlMorris Jobke2021-03-242-207/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Bye bye database.xmlJoas Schilling2021-03-241-11/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* add a prefix index to filecache.pathRobin Appelman2021-03-191-0/+7
| | | | | | | | | | | | The reason that `filecache.path` hasn't had an index added is the mysql limitation of ~1kb for indexeded fields, which is to small for the `path`, however mysql supports indexing only the first N bytes of a column instead of the entire column, allowing us to add an index even if the column is to long. Because the index doesn't cover the entire column it can't be used in all situations where a normal index would be used, but it does cover the `path like 'folder/path/%'` queries that are used in various places. Sqlite and Postgresql don't support prefix indexes, but they also don't have the 1kb limit and DBAL handles the differences in index creation. Signed-off-by: Robin Appelman <robin@icewind.nl>
* DB conversion: improve console outputSimon Spannagel2021-03-171-1/+4
| | | | Signed-off-by: Simon Spannagel <simonspa@kth.se>
* Migrate internal classes to the OCP db col typesChristoph Wurst2021-01-122-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-0811-48/+52
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2020-12-301-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make oc_files_trash.auto_id a bigintVincent Petry2020-12-231-0/+1
| | | | | | | Adjusted migration. Added to occ command to update existing tables. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-164-6/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #23044 from nextcloud/migration-10.5Roeland Jago Douma2020-12-101-0/+33
|\ | | | | Handle owncloud migration to latest release
| * Add missing index on oc_cards and rename if it previously existedJulius Härtl2020-12-091-0/+33
| | | | | | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* | Move columns to bigintJulius Härtl2020-12-081-0/+2
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Create primary keys on all tables and add a command to create the afterwardsJoas Schilling2020-11-101-0/+181
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update ConvertFilecacheBigInt.phptimm2k2020-10-261-0/+1
|
* Make the migration template typedJoas Schilling2020-10-151-3/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-052-19/+19
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* add size index for filecacheRobin Appelman2020-09-221-0/+7
| | | | | | improves performance of #23004 Signed-off-by: Robin Appelman <robin@icewind.nl>
* Remove @suppress SqlInjectionCheckerMorris Jobke2020-09-161-1/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update the license headers for Nextcloud 20Christoph Wurst2020-08-243-1/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #21599 from nextcloud/debt/noid/type-to-typesRoeland Jago Douma2020-07-021-2/+3
|\ | | | | Replace TYPE with TYPES
| * Replace TYPE with TYPESDaniel Kesselberg2020-06-301-2/+3
| | | | | | | | | | | | As TYPE::* is deprecated. Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Add return value to all commandsJoas Schilling2020-06-2610-11/+16
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Add index to properties tableMario Danic2020-04-301-0/+14
| | | | Signed-off-by: Mario Danic <mario@lovelyhq.com>
* Update license headers for 19Christoph Wurst2020-04-292-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-108-13/+4
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>