diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-19 21:06:47 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-19 23:30:41 +0300 |
commit | 6c0bc9abdd2542cc0951bd34b150a5824b987636 (patch) | |
tree | 45ebaac4246f5c5b95e1973035a49533d174c96b /db/post_migrate | |
parent | 4a5bda06900b2b623f7f9fcdce6b36cdcf73bc51 (diff) |
Remove import columns from projects table
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.
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20190619175843_remove_import_columns_from_projects.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/db/post_migrate/20190619175843_remove_import_columns_from_projects.rb b/db/post_migrate/20190619175843_remove_import_columns_from_projects.rb new file mode 100644 index 00000000000..85f776ac99c --- /dev/null +++ b/db/post_migrate/20190619175843_remove_import_columns_from_projects.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RemoveImportColumnsFromProjects < ActiveRecord::Migration[5.1] + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + def change + remove_column :projects, :import_status, :string + remove_column :projects, :import_jid, :string + remove_column :projects, :import_error, :text + end +end |