summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/database
Commit message (Collapse)AuthorAgeFilesLines
...
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-191-0/+56
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-171-0/+94
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-061-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-02-051-3/+3
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-311-0/+19
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-301-17/+0
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-291-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-291-1/+1
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-281-0/+362
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-232-0/+144
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-151-1/+5
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-081-0/+42
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2020-01-061-0/+19
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-201-2/+2
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-171-0/+13
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-171-11/+16
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-122-0/+3
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-021-37/+149
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-12-011-5/+16
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-11-051-1/+0
|
* Add rake task `db:obsolete_ignored_columns`Peter Leitzen2019-09-111-0/+43
| | | | Show a list of obsolete `ignored_columns`
* Use stub_rails_env for Rails.env stubbing66966-convert-rails-env-stub-usages-to-use-railshelpers-stub_rails_env-insteadAsh McKenzie2019-09-051-17/+3
| | | | | RailsHelpers.stub_rails_env takes care of stubbing Rails.env
* Add helper to exactly undo cleanup_concurrent_column_renameReuben Pereira2019-08-251-0/+106
| | | | - Also add helper to undo rename_column_concurrently.
* Drop existing trigger before creating new oneReuben Pereira2019-08-241-0/+8
| | | | | | | | | | | | | | - When renaming a column concurrently, drop any existing trigger before attempting to create a new one. When running migration specs multiple times (as it happens during local development), the down method of previous migrations are called. If any of the called methods contains a call to rename_column_concurrently, a trigger will be created and not removed. So, the next time a migration spec is run, if the same down method is executed again, it will cause an error when attempting to create the trigger (since it already exists). Dropping the trigger if it already exists will prevent this problem.
* Further remove code branches by database typeAndreas Brandl2019-07-291-5/+1
| | | | | | | | We dropped MySQL support and a lot of mysql specific code has been removed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29608. This comes in from the other direction and removes any `if postgresql?` branches.
* Merge branch 'frozen_string_spec_lib' into 'master'Stan Hu2019-07-2612-0/+24
|\ | | | | | | | | Add frozen_string_literal to spec/lib (part 1) See merge request gitlab-org/gitlab-ce!31130
| * Add frozen_string_literal to spec/lib (part 1)Thong Kuah2019-07-2612-0/+24
| | | | | | | | | | Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
* | Remove code related to object hierarchy in MySQLremove-nested-groups-checksHeinrich Lee Yu2019-07-253-3/+3
|/ | | | | These are not required because MySQL is not supported anymore
* Enable tablesample count strategy by defaultAndreas Brandl2019-07-244-59/+2
| | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/58792
* Remove dead MySQL codeNick Thomas2019-07-232-415/+144
| | | | None of this code can be reached any more, so it can all be removed
* Improves add_timestamps_with_timezone helperAlex Kalderimis2019-07-181-3/+74
| | | | | | | | | This improves the `add_timestamps_with_timezone` helper by allowing the column names to be configured. This has the advantage that unnecessary columns can be avoided, saving space. A helper for removing the columns is also provided, to be used in the `down` method of migrations.
* Support jsonb Default Value in add_column_with_default Migration HelperJason Goodman2019-06-281-0/+18
|
* Remove import columns from projects tablesh-remove-import-columns-from-projectsStan Hu2019-06-191-2/+2
| | | | | | | | | | | | | | | | | | In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21497, we migrated all project import data into a separate table, `project_import_data`. In addition, we also added: ``` ignore_column :import_status, :import_jid, :import_error ``` In https://gitlab.com/gitlab-com/gl-infra/production/issues/908, we observed some of these `import_error` columns consumed megabytes of error backtraces and caused slow loading of projects whenever a `SELECT * from projects` query loaded the row into memory. Since we have long migrated away from these columns, we can now drop these columns entirely.
* Allow custom names for concurrent foreign keysYorick Peterse2019-06-171-0/+27
| | | | | This is necessary for backporting the EE schema to ensure backported foreign keys use the same key names.
* Autocorrect with RSpec/ExampleWording copThong Kuah2019-04-051-2/+2
| | | | | | | - rewords examples starting with 'should' - rewords examples starting with 'it' Note: I had to manually fixup "onlies" to "only"
* Fix counting of groups in admin dashboardStan Hu2019-03-112-3/+32
| | | | | | | | | | | | | | | | | 1. Ignore tables that use STI in reltuples count strategy. Models that use Rails' single-type inheritance, such as `Group` and `CiService`, need an additional WHERE clause to count the total properly, which isn't supported by the reltuples strategy. For now, we just omit these from the statistics sampling and rely on the other strategies to get this data. 2. Fix tablesample count strategy not counting groups properly. Models such as `Group` needs a WHERE clause to distinguish it from namespaces. We now add in the WHERE clause if STI is in use. Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/7435
* Fix misspellings in app/spec executable linesTakuya Noguchi2019-02-271-1/+1
| | | | Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
* Remove rails 4 support in CI, Gemfiles, bin/ and config/Jasper Maes2018-12-141-6/+1
|
* Use approximate counts for big tablesJan Provaznik2018-12-061-0/+6
|
* Move strategies in their own filesAndreas Brandl2018-12-034-124/+147
| | | | This improves readability quite a bit.
* Limit some specs to PostgreSQL only.Andreas Brandl2018-12-031-2/+2
|
* Fix rubocop offenses.Andreas Brandl2018-12-031-4/+4
|
* Add feature flag for tablesample counting.Andreas Brandl2018-12-031-0/+4
|
* Implement TablesampleCountStrategy.Andreas Brandl2018-12-031-0/+53
| | | | | | | | | | | A tablesample count executes in two phases: * Estimate table sizes based on reltuples. * Based on the estimate: * If the table is considered 'small', execute an exact relation count. * Otherwise, count on a sample of the table using TABLESAMPLE. The size of the sample is chosen in a way that we always roughly scan the same amount of rows (see TABLESAMPLE_ROW_TARGET).
* Finish refactoring specs.Andreas Brandl2018-12-031-56/+15
| | | | The goal is to reflect separation of concern also in specs.
* Move things to their right scope in specs.Andreas Brandl2018-12-031-44/+45
|
* More specs for fallback testing.Andreas Brandl2018-12-031-0/+33
|
* Refactor specs to separate concerns.Andreas Brandl2018-12-031-18/+63
|
* Flexible approximate counts with fallback strategies.Andreas Brandl2018-12-031-7/+14
|
* Simplify to use models instead of tables.Andreas Brandl2018-12-031-2/+2
|