summaryrefslogtreecommitdiff
path: root/db/schema.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use limit for search count queriessearch-100Jan Provaznik2018-01-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | Search query is especially slow if a user searches a generic string which matches many records, in such case search can take tens of seconds or time out. To speed up the search query, we search only for first 1000 records, if there is >1000 matching records we just display "1000+" instead of precise total count supposing that with such amount the exact count is not so important for the user. Because for issues even limited search was not fast enough, 2-phase approach is used for issues: first we use simpler/faster query to get all public issues, if this exceeds the limit, we just return the limit. If the amount of matching results is lower than limit, we re-run more complex search query (which includes also confidential issues). Re-running the complex query should be fast enough in such case because the amount of matching issues is lower than limit. Because exact total_count is now limited, this patch also switches to to "prev/next" pagination. Related #40540
* Merge branch 'fix-redirect-routes-schema' into 'master'Yorick Peterse2018-01-191-3/+1
|\ | | | | | | | | rework indexes on redirect_routes See merge request gitlab-org/gitlab-ce!16211
| * Rework indexes on redirect_routes to be more effective and enforce a case ↵fix-redirect-routes-schemaGreg Stark2018-01-181-3/+1
| | | | | | | | insensitive unique path
* | Resolve conflicts in VERSION, db/schema.rb, and spec/models/service_spec.rbStan Hu2018-01-161-4/+0
| |
* | Merge branch 'sh-migrate-can-push-to-deploy-keys-projects-10-3' into ↵Douwe Maan2018-01-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | 'security-10-3' [10.3] Migrate `can_push` column from `keys` to `deploy_keys_project` See merge request gitlab/gitlabhq!2276 (cherry picked from commit f6ca52d31bac350a23938e0aebf717c767b4710c) 1f2bd3c0 Backport to 10.3
* | Last push widget will show banner for new pushes to previously merged branchDrew Blessing2018-01-151-0/+1
| | | | | | | | | | | | Previously, the last push widget would only show when the branch never had a merge request associated with it - even merged or closed ones. Now the widget will disregard merge requests that are merged or closed.
* | Display related merge requests in commit detail pageHiroyuki Sato2018-01-121-0/+1
|/
* Merge branch 'remove-soft-removals' into 'master'Douwe Maan2018-01-111-8/+0
|\ | | | | | | | | | | | | Remove soft removals related code Closes #37447 See merge request gitlab-org/gitlab-ce!15789
| * Remove soft removals related codeYorick Peterse2018-01-081-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes all usage of soft removals except for the "pending delete" system implemented for projects. This in turn simplifies all the query plans of the models that used soft removals. Since we don't really use soft removals for anything useful there's no point in keeping it around. This _does_ mean that hard removals of issues (which only admins can do if I'm not mistaken) can influence the "iid" values, but that code is broken to begin with. More on this (and how to fix it) can be found in https://gitlab.com/gitlab-org/gitlab-ce/issues/31114. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37447
* | Denormalize commits count for merge request diffs38068-commits-countJan Provaznik2018-01-101-1/+2
| | | | | | | | | | | | | | | | | | For each MR diff an extra 'SELECT COUNT()' is executed to get number of commits for the diff. Overall time to get counts for all MR diffs may be quite expensive. To speed up loading of MR info, information about number of commits is stored in a MR diff's extra column. Closes #38068
* | Merge branch 'jej/backport-authorized-keys-to-ce' into 'master'Douwe Maan2018-01-091-0/+1
|\ \ | |/ |/| | | | | | | | | Backport authorized_keys Closes gitlab-ee#3953 See merge request gitlab-org/gitlab-ce!16014
| * Backport authorized_keys_enabled defaults to true'Michael Kozono2018-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally from branch 'fix-authorized-keys-enabled-default-2738' via merge request https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2240 Removed background migrations which were intended to fix state after using Gitlab without a default having been set Squashed commits: Locally, if Spring was not restarted, `current_application_settings` was still cached, which prevented the migration from editing the file. This will also ensure that any app server somehow hitting old cache data will properly default this setting regardless. Retroactively fix migration This allows us to identify customers who ran the broken migration. Their `authorized_keys_enabled` column does not have a default at this point. We will fix the column after we fix the `authorized_keys` file. Fix authorized_keys file if needed Add default to authorized_keys_enabled setting Reminder: The original migration was fixed retroactively a few commits ago, so people who did not ever run GitLab 9.3.0 already have a column that defaults to true and disallows nulls. I have tested on PostgreSQL and MySQL that it is safe to run this migration regardless. Affected customers who did run 9.3.0 are the ones who need this migration to fix the authorized_keys_enabled column. The reason for the retroactive fix plus this migration is that it allows us to run a migration in between to fix the authorized_keys file only for those who ran 9.3.0. Tweaks to address feedback Extract work into background migration Move batch-add-logic to background migration Do the work synchronously to avoid multiple workers attempting to add batches of keys at the same time. Also, make the delete portion wait until after adding is done. Do read and delete work in background migration Fix Rubocop offenses Add changelog entry Inform the user of actions taken or not taken Prevent unnecessary `select`s and `remove_key`s Add logs for action taken Fix optimization Reuse `Gitlab::ShellAdapter` Guarantee the earliest key Fix migration spec for MySQL
| * Backport option to disable writing to `authorized_keys` fileMichael Kozono2018-01-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally branch 'mk-toggle-writing-to-auth-keys-1631' See merge request !2004 Squashed commits: Add authorized_keys_enabled to Application Settings Ensure default settings are exposed in UI Without this change, `authorized_keys_enabled` is unchecked when it is nil, even if it should be checked by default. Add “Speed up SSH operations” documentation Clarify the reasons for disabling writes Add "How to go back" section Tweak copy Update Application Setting screenshot
* | Merge branch 'master' into 41249-clearing-the-cacheMatija Čupić2018-01-051-1/+2
|\ \ | |/
| * Backport 'Rebase' feature from EE to CEjprovazn-rebaseJan Provaznik2018-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a project uses fast-forward merging strategy user has to rebase MRs to target branch before it can be merged. Now user can do rebase in UI by clicking 'Rebase' button instead of doing rebase locally. This feature was already present in EE, this is only backport of the feature to CE. Couple of changes: * removed rebase license check * renamed migration (changed timestamp) Closes #40301
* | Merge branch 'master' into 41249-clearing-the-cacheMatija Čupić2018-01-041-6/+12
|\ \ | |/
| * Merge branch 'mdelaossa/gitlab-ce-31995-project-limit-default-fix'Dmitriy Zaporozhets2018-01-041-2/+2
| |\ | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| | * User#projects_limit remove DB default and added NOT NULL constraintMario de la Ossa2017-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This change is required because otherwise if a user is created with a value for `projects_limit` that matches the DB default, it gets overwritten by `current_application_settings.default_projects_limit`. By removing the default we once again can allow a user to be created with a limit of 10 projects without the risk that it'll change to 10000
| * | Merge branch 'change-issues-closed-at-background-migration' into 'master'Sean McGivern2018-01-041-1/+1
| |\ \ | | | | | | | | | | | | | | | | Use a background migration for migrating issues.closed_at See merge request gitlab-org/gitlab-ce!16083
| | * | Use a background migration for issues.closed_atchange-issues-closed-at-background-migrationYorick Peterse2018-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a previous attempt (rolled back in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16021) we tried to migrate `issues.closed_at` from timestamp to timestamptz using a regular migration. This has a bad impact on GitLab.com and as such was rolled back. This commit re-implements the original migrations using generic background migrations, allowing us to still migrate the data in a single release but without a negative impact on availability. To ensure the database schema is up to date the background migrations are performed inline in development and test environments. We also make sure to not migrate that that doesn't need migrating in the first place or has already been migrated.
| * | | Cache merged and closed events data in merge_request_metrics tableOswaldo Ferreira2018-01-021-0/+5
| |/ /
| * | Fix user membership destroy relationFrancisco Javier López2018-01-021-0/+1
| | |
| * | Merge branch ↵Sean McGivern2018-01-021-4/+4
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | '39289-local-schema-rb-automatically-reverts-datetime-to-datetime_with_timezone-after-migrations' into 'master' Prevent schema.rb reverting from datetime_with_timezone to datetime Closes #39289 See merge request gitlab-org/gitlab-ce!14956
| | * Prevent schema.rb reverting from datetime_with_timezone to datetime39289-local-schema-rb-automatically-reverts-datetime-to-datetime_with_timezone-after-migrationsJames Edwards-Jones2017-12-071-4/+4
| | |
* | | Rename Project#cache_index to jobs_cache_indexMatija Čupić2018-01-041-1/+1
| | |
* | | Remove default value from cache_index migrationMatija Čupić2017-12-221-1/+1
| | |
* | | Add cache_index migrationMatija Čupić2017-12-221-1/+2
|/ /
* | Extend Cluster Applications to allow installation of PrometheusMayra Cabrera2017-12-221-0/+9
| |
* | Add index on namespaces lower(name) for UsersController#existsindex-namespaces-lower-nameGreg Stark2017-12-211-1/+1
| |
* | LDAP extern_uids are not normalized when updated via APIFrancisco Javier López2017-12-211-1/+1
| |
* | Remove unused queuesdm-dedicated-sidekiq-queuesDouwe Maan2017-12-131-1/+1
| |
* | Remove issues.assignee_id columnValery Sizov2017-12-111-2/+0
| |
* | Allow git pull/push on project redirectsMayra Cabrera2017-12-081-1/+3
| |
* | Move the circuitbreaker check out in a separate processbvl-circuitbreaker-processBob Van Landuyt2017-12-081-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving the check out of the general requests, makes sure we don't have any slowdown in the regular requests. To keep the process performing this checks small, the check is still performed inside a unicorn. But that is called from a process running on the same server. Because the checks are now done outside normal request, we can have a simpler failure strategy: The check is now performed in the background every `circuitbreaker_check_interval`. Failures are logged in redis. The failures are reset when the check succeeds. Per check we will try `circuitbreaker_access_retries` times within `circuitbreaker_storage_timeout` seconds. When the number of failures exceeds `circuitbreaker_failure_count_threshold`, we will block access to the storage. After `failure_reset_time` of no checks, we will clear the stored failures. This could happen when the process that performs the checks is not running.
* | The API isn't using the appropriate services for managing forksFrancisco Javier López2017-12-071-1/+1
| |
* | Merge branch 'mk-add-old-attachments-to-uploads-table' into 'master'Stan Hu2017-12-071-1/+1
|\ \ | |/ |/| | | | | Add old files to uploads table See merge request gitlab-org/gitlab-ce!15270
| * Fix uploads.path length for long filenamesMichael Kozono2017-12-011-1/+1
| | | | | | | | This will prevent our other migration for adding old files to the uploads table from breaking.
| * Exclude `untracked_files_for_uploads` from schemaMichael Kozono2017-12-011-10/+0
| | | | | | | | | | | | Because it is a temporary table meant only to facilitate a migration of data. It is referenced only by the post-deploy migration and 2 related background migrations. It should be dropped when the data migration is finished.
| * Rename table to untracked_files_for_uploadsMichael Kozono2017-12-011-3/+3
| |
| * Add TrackUntrackedUploads post-deploy migrationMichael Kozono2017-12-011-0/+10
| | | | | | | | To create the table, and schedule the background migration that begins the work.
* | Merge branch 'feature/custom-text-for-new-projects' into 'master'Rémy Coutable2017-12-051-0/+2
|\ \ | | | | | | | | | | | | | | | | | | Add custom brand text on new project pages Closes #15265 See merge request gitlab-org/gitlab-ce!15541
| * | Add custom brand text on new project pagesMarkus Koller2017-12-041-0/+2
| |/
* | Move config_source earlierKamil Trzcinski2017-12-051-1/+1
| |
* | Merge index during table creationKamil Trzcinski2017-12-051-1/+1
| |
* | Remove index on file_typeKamil Trzcinski2017-12-041-2/+0
| |
* | Store expire_at in ci_job_artifactsKamil Trzcinski2017-12-031-1/+2
| |
* | Add unique index on job_id and file_typeZeger-Jan van de Weg2017-12-031-1/+2
| |
* | Fix most test failuresZeger-Jan van de Weg2017-12-031-2/+3
| |
* | Rename Artifact to JobArtifact, split metadata outZeger-Jan van de Weg2017-12-031-15/+16
| | | | | | | | | | | | | | | | | | Two things at ones, as there was no clean way to seperate the commit and give me feedback from the tests. But the model Artifact is now JobArtifact, and the table does not have a type anymore, but the metadata is now its own model: Ci::JobArtifactMetadata.
* | Create Ci::ArtifactsZeger-Jan van de Weg2017-12-031-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To allow jobs/builds to have multiple artifacts, and to start seperating concerns from Ci::Build a new model is created: Ci::Artifact. Changes include the updating of the ArtifactUploader to adapt to a slightly different interface. The uploader expects to be initialized with a `Ci::Build`. Futher a migration with the minimal fields, the needed foreign keys and an index. Last, the way this works is by prepending a module to Ci::Build so we can basically override behaviour but if needed use `super` to get the original behaviour.