summaryrefslogtreecommitdiff
path: root/db
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert to `id: :integer`"Peter Leitzen2019-06-252-3/+22
| | | | This reverts commit 51340f9b47e8339cdabce11d0a17ac724278bff0.
* Merge branch 'sh-recover-ee-schema-backport-migration-failure' into 'master'Rémy Coutable2019-06-251-0/+48
|\ | | | | | | | | | | | | Prevent EE backport migrations from running if CE is not migrated Closes #63612 See merge request gitlab-org/gitlab-ce!30002
| * Prevent EE backport migrations from running if CE is not migratedsh-recover-ee-schema-backport-migration-failureStan Hu2019-06-251-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a user upgraded to any GitLab 11.x EE version but switched back to CE, it's possible the state of the EE tables are not in the right state for the EE backport migration to work properly. In particular, there were three tables that had trouble: * epics * geo_event_log * vulnerability_feedback The EE backport migration would fail while trying to add foreign key constraints because a key didn't exist in the table. This happens because any EE migration that add or removed columns between v11.0.0 and v11.11.3 are not guaranteed to be applied in an CE installation. The EE backport schema does not individually backport these migrations. We now check if certain columns are present to determine whether the backport migration is in the proper state. CE users are required to upgrade to v11.11.3 EE if they ever installed EE previously before they can go back to v12.x CE. Tested via: ``` git checkout -f v11.0.0-ee bundle exec rake db:reset git checkout .; git checkout -f v11.11.3 bundle exec rake db:migrate git checkout .; git checkout -f v12.0.0 bundle exec rake db:migrate <failure happens> ```
* | Rename to time_tracking_limit_to_hours30355-use-hours-only-for-time-trackingHeinrich Lee Yu2019-06-252-4/+4
| | | | | | | | Changes migration and all other places the attribute is used
* | Limit time tracking values to hoursJon Kolb2019-06-252-0/+22
|/ | | | | Adds an instance setting to limit display of time tracking values to hours only
* Renew Let's Encrypt certificatesVladimir Shushlin2019-06-242-0/+26
| | | | | | | | Add index for pages domain ssl auto renewal Add PagesDomain.needs_ssl_renewal scope Add cron worker for ssl renewal Add worker for ssl renewal Add pages ssl renewal worker queues settings
* Merge branch 'sync-merge-ref-upon-mergeability-check' into 'master'Douwe Maan2019-06-242-1/+26
|\ | | | | | | | | Automatically update MR merge-ref along merge status See merge request gitlab-org/gitlab-ce!29569
| * Automatically update MR merge-ref along merge statusOswaldo Ferreira2019-06-202-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | This couples the code that transitions the `MergeRequest#merge_status` and refs/merge-requests/:iid/merge ref update. In general, instead of directly telling `MergeToRefService` to update the merge ref, we should rely on `MergeabilityCheckService` to keep both the merge status and merge ref synced. Now, if the merge_status is `can_be_merged` it means the merge-ref is also updated to the latest. We've also updated the logic to be more systematic and less user-based.
* | Don't show private keys for letsencrypt certsVladimir Shushlin2019-06-212-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds enum certificate_source to pages_domains table with default manually_uploaded Mark certificates as 'gitlab_provided' if the were obtained through Let's Encrypt Mark certificates as 'user_provided' if they were uploaded through controller or api Only show private key in domain edit form if it is 'user_provided' Only show LetsEncrypt option if is enabled by application settings (and feature flag) Refactor and fix some specs to match new logic Don't show Let's Encrypt certificates as well
* | Merge branch 'db/update-geo-nodes-primary' into 'master'Andreas Brandl2019-06-212-1/+21
|\ \ | | | | | | | | | | | | | | | | | | Disallow `NULL` values for `geo_nodes.primary` column Closes gitlab-ee#12061 See merge request gitlab-org/gitlab-ce!29818
| * \ Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ↵Arun Kumar Mohan2019-06-203-4/+29
| |\ \ | | |/ | | | | | | db/update-geo-nodes-primary
| * | Disallow `NULL` values for `geo_nodes.primary` columnArun Kumar Mohan2019-06-182-2/+22
| | |
* | | Merge branch '62772-migrate-managed-clusters-to-unmanaged' into 'master'Thong Kuah2019-06-211-0/+48
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Migrate managed clusters that aren't using managed features to unmanaged Closes #62772 See merge request gitlab-org/gitlab-ce!29251
| * | | Migrate project level clusters with no Kubernetes namespace to unmanaged62772-migrate-managed-clusters-to-unmanagedTiger2019-06-141-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These clusters were created before we introduced the option to manage your own cluster, and not having a Kubernetes namespace present means that we have tried and failed to create one - and therefore we cannot manage your cluster for you. The 5 minute window should prevent a race condition where a cluster has only just been created and we haven't had a chance to create any resources for it yet.
* | | | Migrate clusters with no token to unmanagedTiger2019-06-211-0/+48
| |_|/ |/| | | | | | | | | | | | | | | | | | | | There are clusters that have Kubernetes namespaces stored which are missing a service account token. These namespaces are unable to be used for deployments, so marking the clusters as unmanaged will allow the platform credentials to be used instead.
* | | Remove import columns from projects tablesh-remove-import-columns-from-projectsStan Hu2019-06-192-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Backport of 12014-incremental-es-wiki-updatesce-12014-incremental-es-wiki-updatesMario de la Ossa2019-06-182-0/+14
| |/ |/| | | | | Bringing in the DB migration and some light changes for CE classes
* | Merge branch 'backport-report_approver-migration-to-ce' into 'master'Yorick Peterse2019-06-182-0/+14
|\ \ | | | | | | | | | | | | Backport approval MR rules report_type migration to CE See merge request gitlab-org/gitlab-ce!29766
| * | Backport approval MR rules report_type migration to CEbackport-report_approver-migration-to-ceLucas Charles2019-06-172-0/+14
| | |
* | | Merge branch '57918-encrypt-feature-flags-tokens' into 'master'Kamil Trzciński2019-06-185-1/+70
|\ \ \ | | | | | | | | | | | | | | | | Add migrations needed to encrypt feature flags client tokens See merge request gitlab-org/gitlab-ce!29320
| * | | Add migrations needed to encrypt feature flags client tokens57918-encrypt-feature-flags-tokensKrasimir Angelov2019-06-185-1/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make plaintext token column not null, add new token_encrypted column and index on project_id & token_encrypted. Post deployment migration to encrypt existing tokens.
* | | | Merge branch 'mc/feature/required-template-inclusion-single-commit-ce' into ↵Grzegorz Bizon2019-06-182-0/+16
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Enforce template inclusion in pipelines - CE See merge request gitlab-org/gitlab-ce!29296
| * | | | Backport CE changesmc/feature/required-template-inclusion-single-commit-ceMatija Čupić2019-06-172-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Backports CE changes from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14011/
* | | | | Merge branch 'ashmckenzie/add-created-at-index-to-events' into 'master'Thong Kuah2019-06-182-0/+27
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add index to events and audit_events tables Closes gitlab-com/Product#309 See merge request gitlab-org/gitlab-ce!29194
| * | | | | Add index to events and audit_events tablesashmckenzie/add-created-at-index-to-eventsAsh McKenzie2019-06-182-0/+27
| | |/ / / | |/| | | | | | | | | | | | | Index on created_at, author_id
* | | | | Merge branch 'migrate_k8s_service_integration' into 'master'Thong Kuah2019-06-171-0/+104
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Migrate Kubernetes service integration templates to clusters See merge request gitlab-org/gitlab-ce!28534
| * | | | | When an instance cluster already exists migrate disabledmigrate_k8s_service_integrationJames Fargher2019-05-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assume that if an instance level cluster already exists, then the KubernetesService was not being used, but allow the admin to re-enable it if required
| * | | | | Migrate Kubernetes service integration templates to clustersJames Fargher2019-05-301-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The migration uses active record model stubs so that field encryption can be more easily used.
* | | | | | Merge branch 'issue-62685-new' into 'master'Andreas Brandl2019-06-172-0/+22
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | Add index on invite-email to members See merge request gitlab-org/gitlab-ce!29768
| * | | | | Add index on invite-email to membersyguo2019-06-172-0/+22
| | |_|/ / | |/| | |
* | | | | Hashed Storage is enabled by default on new installationshashed-storage-enabled-defaultGabriel Mazetto2019-06-172-2/+17
|/ / / / | | | | | | | | | | | | updated documentation for Geo
* | | | Merge branch 'backport-schema-changes' into 'master'Robert Speicher2019-06-1746-933/+3907
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport the EE schema to CE Closes gitlab-ee#9686 See merge request gitlab-org/gitlab-ce!26940
| * | | | Backport the EE schema and migrations to CEYorick Peterse2019-06-1746-933/+3907
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backports all EE schema changes to CE, including EE migrations, ensuring both use the same schema. == Updated tests A spec related to ghost and support bot users had to be modified to make it pass. The spec in question assumes that the "support_bot" column exists when defining the spec. In the single codebase setup this is not the case, as the column is backported in a later migration. Any attempt to use a different schema version or use of "around" blocks to conditionally disable specs won't help, as reverting the backport migration would also drop the "support_bot" column. Removing the "support_bot" tests entirely appears to be the only solution. We also need to update some foreign key tests now that we have backported the EE columns. Fortunately, these changes are very minor. == Backporting migrations This commit moves EE specific migrations (except those for the Geo tracking database) and related files to CE, and also removes any traces of the ee/db directory. Some migrations had to be modified or removed, as they no longer work with the schema being backported. These migrations were all quite old, so we opted for removing them where modifying them would take too much time and effort. Some old migrations were modified in EE, while also existing in CE. In these cases we took the EE code, and in one case removed them entirely. It's not worth spending time trying to merge these changes somehow as we plan to remove old migrations around the release of 12.0, see https://gitlab.com/gitlab-org/gitlab-ce/issues/59177 for more details.
* | | | | CE port of IP address restriction for groupsImre Farkas2019-06-172-0/+27
|/ / / /
* | | | Merge branch '58886-issue-tracker-fields' into 'master'Sean McGivern2019-06-173-0/+80
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Create models for issue trackers data See merge request gitlab-org/gitlab-ce!28598
| * | | | Create models for issue trackers data58886-issue-tracker-fieldsJarka Košanová2019-06-133-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | - create tables for storing issue trackers properties - add model and basic logic & spec
* | | | | CE backport for changes in EE MR 138949490-record-repository_type-on-lfs_objects_projects-ceLuke Duncalfe2019-06-173-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backports to CE changes that allow the recording of the repository_type in the table lfs_objects_projects. This is in order to allow future pruning of unreferenced LFS objects, as we will need to know which repository to look in for the LFS pointer file. The EE MR that contains the original code and a full explanation of the changes is https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894 EE Issue https://gitlab.com/gitlab-org/gitlab-ee/issues/9490 Note that there was a lot of CE code changed in the EE MR because we want to allow the wiki repository to also use LFS. See https://gitlab.com/gitlab-org/gitlab-ce/issues/43721. As the wiki is an unlicensed feature, a full backport is required to enable this.
* | | | | Merge branch '4354-lock-memberships-to-ldap-sync-part-1' into 'master'Stan Hu2019-06-142-0/+21
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | EE migration port: add app-wide LDAP membership lock field See merge request gitlab-org/gitlab-ce!29302
| * | | | | EE port: add app-wide LDAP membership lock field4354-lock-memberships-to-ldap-sync-part-1Pavel Shutsin2019-06-132-0/+21
| | | | | |
* | | | | | Add index on public_emails for users tableyguo2019-06-132-0/+24
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up issue-62684 Update issue-62684 changelog Update down migrate for issue-62684
* | | | | Backport of gitlab-ee!13735Rubén Dávila2019-06-122-0/+13
| | | | |
* | | | | Merge branch 'jc-migration-for-source-project-id' into 'master'Andreas Brandl2019-06-121-0/+19
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix null source_project_id in pool_repositories Closes gitaly#1653 See merge request gitlab-org/gitlab-ce!29157
| * | | | | Fix null source_project_id in pool_repositoriesjc-migration-for-source-project-idJohn Cai2019-06-111-0/+19
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | Due to a bug, some pool_repositories in production have a null source_project_id column. This migration aims to fix those rows.
* | | | | Add db migrationMałgorzata Ksionek2019-06-112-0/+21
|/ / / /
* | | | Persist target project id and target branch in merge trains tableShinya Maeda2019-06-112-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to optimize the query performance, we should use target project id and target branch intead of cross-joining merge_requests table. Fix schema Fix schema
* | | | Avoid DB timeouts when scheduling migrationsOswaldo Ferreira2019-06-101-10/+5
|/ / /
* | | Revert "Merge branch '50070-legacy-attachments' into 'master'"sh-revert-mr-24679Stan Hu2019-06-091-32/+0
| | | | | | | | | | | | | | | This reverts commit fd19f887dfeeeedb483c4a4fb32f9f768e89389c, reversing changes made to abb2d4c601d796339c8d7cb0c00946696730f198.
* | | Merge branch '62418-project-default-git-depth' into 'master'Kamil Trzciński2019-06-072-0/+12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Add project level git depth setting Closes #59688 See merge request gitlab-org/gitlab-ce!28919
| * | | Add project level git depth settingKrasimir Angelov2019-06-062-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce default_git_depth in project's CI/CD settings and set it to 50. Use it if there is no GIT_DEPTH variable specified. Apply this default only to newly created projects and keep it nil for old ones in order to not break pipelines that rely on non-shallow clones. default_git_depth can be updated from CI/CD Settings in the UI, must be either nil or integer between 0 and 1000 (incl). Inherit default_git_depth from the origin project when forking projects. MR pipelines are run on a MR ref (refs/merge-requests/:iid/merge) and it contains unique commit (i.e. merge commit) which doesn't exist in the other branch/tags refs. We need to add it cause otherwise it may break pipelines for old projects that have already enabled Pipelines for merge results and have git depth 0. Document new default_git_depth project CI/CD setting
* | | | Merge branch '50070-legacy-attachments' into 'master'Kamil Trzciński2019-06-071-0/+32
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate legacy uploads Closes #57217 See merge request gitlab-org/gitlab-ce!24679