summaryrefslogtreecommitdiff
path: root/db/migrate
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'jej/backport-authorized-keys-to-ce' into 'master'Douwe Maan2018-01-092-0/+36
|\ | | | | | | | | | | | | Backport authorized_keys Closes gitlab-ee#3953 See merge request gitlab-org/gitlab-ce!16014
| * Avoid adding index if already existsPaco Guzman2018-01-081-1/+2
| |
| * Backport authorized_keys_enabled defaults to true'Michael Kozono2018-01-081-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Backport authorized_keys branch 'find-key-by-fingerprint'Pablo Carranza2018-01-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add find key by base64 key or fingerprint to the internal API See merge request !250 Squashed changes: Add unique index to fingerprint Add new index to schema Add internal api to get ssh key by fingerprint Change API endpoint to authorized_keys Add InsecureKeyFingerprint that calculates the fingerprint without shelling out Add require for gitlab key fingerprint Remove uniqueness of fingerprint index Remove unique option from migration Fix spec style in fingerprint test Fix rubocop complain Extract insecure key fingerprint to separate file Change migration to support building index concurrently Remove those hideous tabs
* | Merge branch '41249-clearing-the-cache' into 'master'Kamil Trzciński2018-01-061-0/+13
|\ \ | | | | | | | | | | | | | | | | | | Resolve "Clearing the cache" Closes #41249 See merge request gitlab-org/gitlab-ce!16067
| * \ Merge branch 'master' into 41249-clearing-the-cacheMatija Čupić2018-01-051-0/+7
| |\ \ | | |/
| * | Fix jobs_cache_index migration class nameMatija Čupić2018-01-051-1/+1
| | |
| * | Merge branch 'master' into 41249-clearing-the-cacheMatija Čupić2018-01-046-2/+166
| |\ \
| * | | 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-8/+2
| | | |
| * | | Add cache_index migrationMatija Čupić2017-12-221-0/+19
| | | |
* | | | Add the EE `rebase_commit_sha` migration back in its original locationRobert Speicher2018-01-051-0/+22
| | | |
* | | | Fix rebase commit SHA migration namefix-ce-migration-timestampSean McGivern2018-01-052-7/+15
| |_|/ |/| | | | | | | | | | | This already existed in EE with a different timestamp, so rename for CE and make it idempotent.
* | | Backport 'Rebase' feature from EE to CEjprovazn-rebaseJan Provaznik2018-01-051-0/+7
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | 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 'mdelaossa/gitlab-ce-31995-project-limit-default-fix'Dmitriy Zaporozhets2018-01-041-0/+38
|\ \ | | | | | | | | | 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-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Cache merged and closed events data in merge_request_metrics tableOswaldo Ferreira2018-01-021-0/+37
| | |
* | | Fix user membership destroy relationFrancisco Javier López2018-01-022-0/+52
| | |
* | | Merge branch ↵Sean McGivern2018-01-021-0/+25
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | '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-0/+25
| | |
* | | Simplify implementation and allow for batch updates in MySQLStan Hu2017-12-271-27/+16
| | |
* | | Fix PostgreSQL implementation of migrationsh-fix-mysql-migration-10-3Stan Hu2017-12-271-1/+3
| | |
* | | Fix migration for removing orphaned issues.moved_to_id values in MySQLStan Hu2017-12-261-2/+23
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | According to https://dev.mysql.com/doc/refman/5.7/en/update.html, "You cannot update a table and select from the same table in a subquery." Attempting to do so results in the error: ``` Mysql2::Error: Table 'issues' is specified twice, both as a target for 'UPDATE' and as a separate source for data ``` Instead, we can use a LEFT JOIN on the same table to make MySQL do the right thing. Closes #41498
* | Extend Cluster Applications to allow installation of PrometheusMayra Cabrera2017-12-221-0/+18
| |
* | Add index on namespaces lower(name) for UsersController#existsindex-namespaces-lower-nameGreg Stark2017-12-211-0/+30
| |
* | Fix missing WHERE clause in 20171106135924_issues_milestone_id_foreign_key ↵Stan Hu2017-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | migration If milestone_id is NULL, we shouldn't need to update it to be NULL again. This was causing us to touch almost all rows in the issues table for no good reason. Closes https://gitlab.com/gitlab-com/infrastructure/issues/3416
* | Clears the current Appearance cache otherwise it breaks since ↵41041-undefined-method-new_project_guidelines_html-unable-to-load-from-cacheRémy Coutable2017-12-121-0/+6
| | | | | | | | | | | | | | | | new_project_guidelines_html would be missing Solves https://gitlab.com/gitlab-org/gitlab-ce/issues/41041. Signed-off-by: Rémy Coutable <remy@rymai.me>
* | Merge branch 'fix-remove-branch-name-migration' into 'master'Sean McGivern2017-12-121-14/+0
|\ \ | | | | | | | | | | | | Fix migration that removes issues.branch_name See merge request gitlab-org/gitlab-ce!15858
| * | Fix migration that removes issues.branch_namefix-remove-branch-name-migrationYorick Peterse2017-12-111-13/+0
| | |
* | | Add cop for use of remove_columnadd-remove-column-copSean McGivern2017-12-1113-0/+13
|/ / | | | | | | | | | | | | remove_column should only be used in the up (or change) step of a migration if it's a post-deployment migration. Otherwise there will be downtime due to the ActiveRecord column cache, which we can avoid by using the IgnorableColumn concern in combination with a post-deployment migration.
* | Allow git pull/push on project redirectsMayra Cabrera2017-12-082-0/+37
| |
* | Move the circuitbreaker check out in a separate processbvl-circuitbreaker-processBob Van Landuyt2017-12-081-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'mk-add-old-attachments-to-uploads-table' into 'master'Stan Hu2017-12-071-0/+25
|\ \ | |/ |/| | | | | Add old files to uploads table See merge request gitlab-org/gitlab-ce!15270
| * Fix uploads.path length for long filenamesMichael Kozono2017-12-011-0/+25
| | | | | | | | This will prevent our other migration for adding old files to the uploads table from breaking.
* | Merge branch 'feature/custom-text-for-new-projects' into 'master'Rémy Coutable2017-12-051-0/+12
|\ \ | | | | | | | | | | | | | | | | | | 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/+12
| |/
* | Merge index during table creationKamil Trzcinski2017-12-052-16/+1
| |
* | Remove index on file_typeKamil Trzcinski2017-12-041-2/+2
| |
* | 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-0/+16
| |
* | Fix legacy migration testZeger-Jan van de Weg2017-12-031-2/+2
| |
* | Fix most test failuresZeger-Jan van de Weg2017-12-031-1/+3
| |
* | Rename Artifact to JobArtifact, split metadata outZeger-Jan van de Weg2017-12-032-21/+19
| | | | | | | | | | | | | | | | | | 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-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Create ci_artifacts tableZeger-Jan van de Weg2017-12-031-3/+19
| |
* | WIPZeger-Jan van de Weg2017-12-031-0/+8
|/
* Merge branch 'remove-mr-diff-serialised-columns' into 'master'Yorick Peterse2017-11-292-2/+49
|\ | | | | | | | | | | | | Remove serialised diff and commit columns Closes #39533 See merge request gitlab-org/gitlab-ce!15582
| * Remove serialised diff and commit columnsSean McGivern2017-11-282-2/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The st_commits and st_diffs columns on merge_request_diffs historically held the YAML-serialised data for a merge request diff, in a variety of formats. Since 9.5, these have been migrated in the background to two new tables: merge_request_diff_commits and merge_request_diff_files. That has the advantage that we can actually query the data (for instance, to find out how many commits we've stored), and that it can't be in a variety of formats, but must match the new schema. This is the final step of that journey, where we drop those columns and remove all references to them. This is a breaking change to the importer, because we can no longer import diffs created in the old format, and we cannot guarantee the export will be in the new format unless it was generated after this commit.
* | Add timeouts for Gitaly callsAndrew Newdigate2017-11-291-0/+31
|/