- Feb 21, 2020
-
-
GitLab Bot authored
-
- Feb 19, 2020
-
-
GitLab Bot authored
-
- Feb 05, 2020
-
-
GitLab Bot authored
-
- Jan 29, 2020
-
-
GitLab Bot authored
-
- Jan 28, 2020
-
-
GitLab Bot authored
-
- Jan 23, 2020
-
-
GitLab Bot authored
-
- Jan 15, 2020
-
-
GitLab Bot authored
-
- Jan 08, 2020
-
-
GitLab Bot authored
-
- Jan 06, 2020
-
-
GitLab Bot authored
-
- Dec 17, 2019
-
-
GitLab Bot authored
-
- Dec 02, 2019
-
-
GitLab Bot authored
-
- Nov 05, 2019
-
-
GitLab Bot authored
-
- Sep 05, 2019
-
-
Ash McKenzie authored
RailsHelpers.stub_rails_env takes care of stubbing Rails.env
-
- Aug 25, 2019
-
-
Reuben Pereira authored
- Also add helper to undo rename_column_concurrently.
-
- Aug 24, 2019
-
-
Reuben Pereira authored
- 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.
-
- Jul 26, 2019
-
-
Thong Kuah authored
Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
-
- Jul 23, 2019
-
-
Nick Thomas authored
None of this code can be reached any more, so it can all be removed
-
- Jul 18, 2019
-
-
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.
-
- Jun 28, 2019
-
-
- Jun 19, 2019
-
-
Stan Hu authored
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.
-
- Jun 17, 2019
-
-
Yorick Peterse authored
This is necessary for backporting the EE schema to ensure backported foreign keys use the same key names.
-
- Dec 14, 2018
-
-
Jasper Maes authored
-
- Nov 14, 2018
-
-
Jan Provaznik authored
We want to run CI with rails 4 for a short-term (until we are sure that we will ship with rails 5). The problem is that rails 4 can not handle rails 5 schema.rb properly - specifically `t.index` directive can not handle multiple indexes on the same column. Because combination of rails 4 + rails 5 schema will be used only in CI for a short-term, we can just ignore these incompatibility failures. This patch adds `rails5` helper for specs.
-
- Aug 11, 2018
-
-
Gabriel Mazetto authored
it will decide the method for disable statement_timeout upon per transaction or per session, based on how it's called. When calling with a block, block will be executed and it will use session based statement_timeout, otherwise will default to existing behavior.
-
- Aug 10, 2018
-
-
Gabriel Mazetto authored
-
Gabriel Mazetto authored
By default statement_timeout will only be enabled during transaction lifetime, therefore not leaking outside of it. With `transaction: false` it will set for entire session, but requires a block to passed. It yields control and cleans up session after block finishes, also preventing leaking outside of it.
-
- Jun 26, 2018
-
-
Sean McGivern authored
This works the same way as change_column_type_using_background_migration, but for renaming a column. It takes a table, not a relation, to match its concurrent counterpart. Also, generalise the cleanup migrations to reduce code duplication.
-
- Mar 28, 2018
-
-
Bob Van Landuyt authored
This will use the same query as `\di` to find an index on postgresql.
-
- Mar 20, 2018
-
-
Andreas Brandl authored
Closes #43887.
-
Andreas Brandl authored
Index creation does not have an effect if the index is present already. Index removal does not have an affect if the index is not present. This helps to avoid patterns like this in migrations: ``` if index_exists?(...) remove_concurrent_index(...) end ```
-
- Jan 18, 2018
-
-
Yorick Peterse authored
Prior to this commit we would essentially update all rows in a table, even those where the source column (e.g. `issues.closed_at`) was NULL. This in turn could lead to statement timeouts when using the default batch size of 10 000 rows per job. To work around this we don't schedule jobs for rows where the source value is NULL. We also don't update rows where the source column is NULL (as an extra precaution) or the target column already has a non-NULL value. Using this approach it should be possible to update 10 000 rows in the "issues" table in about 7.5 - 8 seconds. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/42158
-
- Jan 05, 2018
-
-
Yorick Peterse authored
This adds a minimum interval to BackgroundMigrationWorker, ensuring background migrations of the same class only run once every 5 minutes. This prevents a thundering herd problem where scheduled migrations all run at once due to their delays having been expired (e.g. as the result of a queue being paused for a long time). If a job was recently executed it's rescheduled with a delay that equals the remaining time of the job's lease. This means that if the lease expires in two minutes we only need to wait two minutes, instead of five. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/41624
-
- Jan 03, 2018
-
-
Yorick Peterse authored
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.
-
- Dec 05, 2017
-
-
Douwe Maan authored
-
- Sep 14, 2017
-
-
Michael Kozono authored
-
Michael Kozono authored
-
- Aug 29, 2017
-
-
Yorick Peterse authored
This adds a bunch of checks to migrations that may create or drop triggers. Dropping triggers/functions is done using "IF EXISTS" so we don't throw an error if the object in question has already been dropped. We now also raise a custom error (message) when the user does not have TRIGGER privileges. This should prevent the schema from entering an inconsistent state while also providing the user with enough information on how to solve the problem. The recommendation of using SUPERUSER permissions is a bit extreme but we require this anyway (Omnibus also configures users with this permission). Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
-
- Aug 22, 2017
-
-
Grzegorz Bizon authored
-
Grzegorz Bizon authored
-
- Aug 02, 2017
-
-
Robert Speicher authored
-