summaryrefslogtreecommitdiff
path: root/lib/tasks/migrate
Commit message (Collapse)AuthorAgeFilesLines
* Increase text limit for GPG keys (mysql only).ab-46530-mediumtext-for-gpg-keysAndreas Brandl2018-05-221-0/+2
| | | | Closes #46530.
* Migration to add/drop primary key constraints for composite keys.ab-43706-composite-primary-keysAndreas Brandl2018-05-211-0/+15
| | | | Closes #43706.
* Fix: Use case in-sensitive ordering by name for groupsHarish Ved2018-05-171-0/+2
|
* Refactoring ci_job_trace to ci_build_traceShinya Maeda2018-04-261-2/+2
|
* Add rake task and timestamped migration file for mysql raw_data MIDIUMTEXTShinya Maeda2018-04-061-0/+2
|
* Add the RedirectRoute#path index setup_postgresqlBob Van Landuyt2018-03-281-0/+2
|
* Don't run ReworkRedirectRoutesIndexes during setupBob Van Landuyt2018-03-281-2/+0
| | | | | Since the `permanent` column is not there anymore, we don't need to create these indexes.
* Optimise searching for users using short queriesYorick Peterse2018-02-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This optimises searching for users when using queries consisting out of one or two characters such as "ab". We optimise such cases by searching for `LOWER(name)` and `LOWER(username)` instead of using `ILIKE`. Using `LOWER` produces a _much_ better performing query. For example, when searching for all users matching the term "a" we'd produce the following plan: Limit (cost=637.69..637.74 rows=20 width=805) (actual time=41.983..41.995 rows=20 loops=1) Buffers: shared hit=8330 -> Sort (cost=637.69..638.61 rows=368 width=805) (actual time=41.982..41.990 rows=20 loops=1) Sort Key: (CASE WHEN ((name)::text = 'a'::text) THEN 0 WHEN ((username)::text = 'a'::text) THEN 1 WHEN ((email)::text = 'a'::text) THEN 2 ELSE 3 END), name Sort Method: top-N heapsort Memory: 35kB Buffers: shared hit=8330 -> Bitmap Heap Scan on users (cost=75.47..627.89 rows=368 width=805) (actual time=9.452..41.305 rows=277 loops=1) Recheck Cond: (((name)::text ~~* 'a'::text) OR ((username)::text ~~* 'a'::text) OR ((email)::text = 'a'::text)) Rows Removed by Index Recheck: 7601 Heap Blocks: exact=7636 Buffers: shared hit=8327 -> BitmapOr (cost=75.47..75.47 rows=368 width=0) (actual time=8.290..8.290 rows=0 loops=1) Buffers: shared hit=691 -> Bitmap Index Scan on index_users_on_name_trigram (cost=0.00..38.85 rows=180 width=0) (actual time=4.369..4.369 rows=4071 loops=1) Index Cond: ((name)::text ~~* 'a'::text) Buffers: shared hit=360 -> Bitmap Index Scan on index_users_on_username_trigram (cost=0.00..34.41 rows=188 width=0) (actual time=3.896..3.896 rows=4140 loops=1) Index Cond: ((username)::text ~~* 'a'::text) Buffers: shared hit=328 -> Bitmap Index Scan on users_email_key (cost=0.00..1.94 rows=1 width=0) (actual time=0.022..0.022 rows=0 loops=1) Index Cond: ((email)::text = 'a'::text) Buffers: shared hit=3 Planning time: 3.912 ms Execution time: 42.171 ms With the changes in this commit we now produce the following plan instead: Limit (cost=13257.48..13257.53 rows=20 width=805) (actual time=1.567..1.579 rows=20 loops=1) Buffers: shared hit=287 -> Sort (cost=13257.48..13280.93 rows=9379 width=805) (actual time=1.567..1.572 rows=20 loops=1) Sort Key: (CASE WHEN ((name)::text = 'a'::text) THEN 0 WHEN ((username)::text = 'a'::text) THEN 1 WHEN ((email)::text = 'a'::text) THEN 2 ELSE 3 END), name Sort Method: top-N heapsort Memory: 35kB Buffers: shared hit=287 -> Bitmap Heap Scan on users (cost=135.66..13007.91 rows=9379 width=805) (actual time=0.194..1.107 rows=277 loops=1) Recheck Cond: ((lower((name)::text) = 'a'::text) OR (lower((username)::text) = 'a'::text) OR ((email)::text = 'a'::text)) Heap Blocks: exact=277 Buffers: shared hit=287 -> BitmapOr (cost=135.66..135.66 rows=9379 width=0) (actual time=0.152..0.152 rows=0 loops=1) Buffers: shared hit=10 -> Bitmap Index Scan on yorick_test_users (cost=0.00..124.75 rows=9377 width=0) (actual time=0.101..0.101 rows=277 loops=1) Index Cond: (lower((name)::text) = 'a'::text) Buffers: shared hit=4 -> Bitmap Index Scan on index_on_users_lower_username (cost=0.00..1.94 rows=1 width=0) (actual time=0.035..0.035 rows=1 loops=1) Index Cond: (lower((username)::text) = 'a'::text) Buffers: shared hit=3 -> Bitmap Index Scan on users_email_key (cost=0.00..1.94 rows=1 width=0) (actual time=0.014..0.014 rows=0 loops=1) Index Cond: ((email)::text = 'a'::text) Buffers: shared hit=3 Planning time: 0.303 ms Execution time: 1.687 ms Here we can see the new query is 25 times faster compared to the old query.
* Eliminate the warnings for databaseLin Jen-Shin2018-01-261-11/+9
|
* Rework indexes on redirect_routes to be more effective and enforce a case ↵fix-redirect-routes-schemaGreg Stark2018-01-181-0/+2
| | | | insensitive unique path
* Adds Rubocop rule for line break around conditionals🙈 jacopo beschi 🙉2018-01-111-0/+3
|
* Add index on namespaces lower(name) for UsersController#existsindex-namespaces-lower-nameGreg Stark2017-12-211-0/+2
|
* Add lower path index to redirect_routesmk-add-lower-path-index-to-redirect-routesMichael Kozono2017-07-251-0/+2
|
* Add table for files in merge request diffsSean McGivern2017-06-161-0/+2
| | | | | | | | | | | | | | | | This adds an ID-less table containing one row per file, per merge request diff. It has a column for each attribute on Gitlab::Git::Diff that is serialised currently, with the advantage that we can easily query the attributes of this new table. It does not migrate existing data, so we have fallback code when the legacy st_diffs column is present instead. For a merge request diff to be valid, it should have at most one of: * Rows in this new table, with the correct merge_request_diff_id. * A non-NULL st_diffs column. It may have neither, if the diff is empty.
* Add index_redirect_routes_path_for_link migration to setup_postgresql.rakeLuke "Jared" Bennett2017-05-081-0/+1
|
* Index redirect_routes path for LIKEMichael Kozono2017-05-051-0/+1
|
* Fix caching large snippet HTML content on MySQL databasesNick Thomas2017-05-031-0/+2
|
* Add LIKE index for routes.pathYorick Peterse2017-03-211-0/+2
| | | | | | | | Nested groups support uses queries along the lines of `path LIKE 'X/%'`. For these queries to use an index on PostgreSQL we need to use either the varchar_pattern_ops or text_pattern_ops operator class. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/29554
* Don’t exclude some file in lib from rubocopDouwe Maan2017-02-231-1/+1
|
* Add AddLowerPathIndexToRoutes to setup_postgresql.rakeDmitriy Zaporozhets2016-12-131-0/+4
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Replace colorize gem with rainbow.Connor Shea2016-06-031-3/+3
| | | | | | | | | | | | | Colorize is a gem licensed under the GPLv2, so we can’t use it in GitLab without relicensing GitLab under the terms of the GPL. Rainbow is licensed under the MIT license and does the exact same thing as Colorize, so Rainbow was added in place of Colorize. The syntax is slightly different for Rainbow vs. Colorize, and was updated in accordance. The gem is still a dependency of Spinach, so it’s included in the development/test environments, but won’t be packaged with the actual product, and therefore doesn’t require we relicense the product. An attempt at relicensing Colorize was made, but didn’t succeed as the library owner never responded. Rainbow library: https://github.com/sickill/rainbow Relevant issue regarding licensing in GitLab's gems: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3775
* Improve performance of User.by_loginuser-by-login-performanceYorick Peterse2015-10-151-0/+2
| | | | | | | | | | | | | | | | | Performance is improved in two steps: 1. On PostgreSQL an expression index is used for checking lower(email) and lower(username). 2. The check to determine if we're searching for a username or Email is moved to Ruby. Thanks to @haynes for suggesting and writing the initial implementation of this. Moving the check to Ruby makes this method an additional 1.5 times faster compared to doing the check in the SQL query. With performance being improved I've now also tweaked the amount of iterations required by the User.by_login benchmark. This method now runs between 900 and 1000 iterations per second.
* Added dedicated Rake task for setting up PostgresYorick Peterse2015-10-081-0/+6
| | | | | This ensures any PostgreSQL specific schema changes (e.g. expression indexes) are created when setting up the database.
* Replace GITLAB with GitLab in rake task descriptionsDmitriy Zaporozhets2015-06-232-2/+2
|
* Adjust MySQL limits for existing installationsJacob Vosmaer2014-04-231-9/+2
|
* Add mysql limits to db during setupDmitriy Zaporozhets2014-03-131-0/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Changed limits to a higher orderJeroen van Baarsen2014-03-121-3/+3
|
* Added rake task to add limits back in mysqlJeroen van Baarsen2014-03-111-0/+13
|
* Remove old migration tasksDmitriy Zaporozhets2013-08-267-110/+0
| | | | | | You should update to 6.0 before proceed with update to higher version. So its no reason to keep old tasks any more. It should be still available in 6-0-stable but not in master
* Add iids to milestones. Moved iids logic to separate concernDmitriy Zaporozhets2013-08-211-0/+15
|
* Fix migrate_iids for issuesDmitriy Zaporozhets2013-08-201-1/+1
|
* Merge branch 'feature/internal_ids' of /home/git/repositories/gitlab/gitlabhqDmitriy Zaporozhets2013-08-201-0/+33
|\
| * Iid improvemetsDmitriy Zaporozhets2013-08-191-2/+4
| | | | | | | | | | | | * call set_iid before validation * make rake task pass event if objects are invalid * show iid in comment event at dashboard
| * Create task to create iid for existing issues/mrDmitriy Zaporozhets2013-08-191-0/+31
| |
* | Better message for migrating global projectsDmitriy Zaporozhets2013-08-201-2/+9
|/
* Move diff parsing to own class. Correctly identify note diff lineDmitriy Zaporozhets2013-08-041-1/+1
|
* Store diff with line note. It makes possible to see inline notes with proper ↵Dmitriy Zaporozhets2013-08-041-0/+16
| | | | diff even if MR diff changed
* Delete duplicate keys in migrate_keys taskJacob Vosmaer2013-08-021-0/+5
|
* Fix typosJohannes Schleifenbaum2013-07-291-1/+1
|
* store and display public key fingerprintDmitriy Zaporozhets2013-06-241-0/+15
|
* You should not be able to remove a Group ownerDmitriy Zaporozhets2013-06-221-0/+16
|
* Migrate global project taks. Removed more teams related functionalityDmitriy Zaporozhets2013-06-191-3/+7
|
* Remove Global namespace from options. Prepared file for migration of global ↵Dmitriy Zaporozhets2013-06-191-0/+12
| | | | projects
* Migrate notes.line_code format.baba2013-05-111-0/+13
| | | | | | | | | Since version 4.1, notes.line_code means: {SHA1 hash of file path}_{old line}_{new line} but the older version means: {file index of the commit}_{old line}_{new line} This rake task migrate the above differences.
* migrate milestones with nil stateDmitriy Zaporozhets2013-04-161-0/+4
|
* Warn user about losing merge request diffDmitriy Zaporozhets2013-04-151-0/+7
|
* Remove wiki migrator. We dont need it any more. Users should migrate to 5.0 ↵Dmitriy Zaporozhets2013-04-101-42/+0
| | | | first
* separate rake task for migration and persistent oneDmitriy Zaporozhets2013-04-052-0/+53