diff options
author | Felipe Artur <felipefac@gmail.com> | 2019-03-27 21:19:12 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2019-03-27 21:19:12 +0300 |
commit | 16a3fea3998e813b95d7d09ea31f6a88dc908102 (patch) | |
tree | f896b456433d21ab5d8b3dd24625348175ac06a6 /db/post_migrate | |
parent | 294c5c41beaac1fbc60c67df2c8745f7583544a1 (diff) | |
parent | 97f8d4e96870324c4ce6534022397d33c4bf5dbc (diff) |
Merge master
Diffstat (limited to 'db/post_migrate')
4 files changed, 68 insertions, 0 deletions
diff --git a/db/post_migrate/20181101091005_steal_digest_column.rb b/db/post_migrate/20181101091005_steal_digest_column.rb new file mode 100644 index 00000000000..58ea710c18a --- /dev/null +++ b/db/post_migrate/20181101091005_steal_digest_column.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class StealDigestColumn < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + Gitlab::BackgroundMigration.steal('DigestColumn') + end + + def down + # raise ActiveRecord::IrreversibleMigration + end +end diff --git a/db/post_migrate/20181101091124_remove_token_from_personal_access_tokens.rb b/db/post_migrate/20181101091124_remove_token_from_personal_access_tokens.rb new file mode 100644 index 00000000000..415373068d5 --- /dev/null +++ b/db/post_migrate/20181101091124_remove_token_from_personal_access_tokens.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveTokenFromPersonalAccessTokens < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + remove_column :personal_access_tokens, :token, :string + end +end diff --git a/db/post_migrate/20190301081611_migrate_project_migrate_sidekiq_queue.rb b/db/post_migrate/20190301081611_migrate_project_migrate_sidekiq_queue.rb new file mode 100644 index 00000000000..6af7902e0c4 --- /dev/null +++ b/db/post_migrate/20190301081611_migrate_project_migrate_sidekiq_queue.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class MigrateProjectMigrateSidekiqQueue < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + DOWNTIME = false + + def up + sidekiq_queue_migrate 'project_migrate_hashed_storage', to: 'hashed_storage:hashed_storage_project_migrate' + end + + def down + sidekiq_queue_migrate 'hashed_storage:hashed_storage_project_migrate', to: 'project_migrate_hashed_storage' + end +end diff --git a/db/post_migrate/20190322132835_schedule_populate_merge_request_assignees_table.rb b/db/post_migrate/20190322132835_schedule_populate_merge_request_assignees_table.rb new file mode 100644 index 00000000000..1ecb38e1a86 --- /dev/null +++ b/db/post_migrate/20190322132835_schedule_populate_merge_request_assignees_table.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class SchedulePopulateMergeRequestAssigneesTable < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + BATCH_SIZE = 10_000 + MIGRATION = 'PopulateMergeRequestAssigneesTable' + DELAY_INTERVAL = 8.minutes.to_i + + disable_ddl_transaction! + + def up + say 'Scheduling `PopulateMergeRequestAssigneesTable` jobs' + # We currently have ~4_500_000 merge request records on GitLab.com. + # This means it'll schedule ~450 jobs (10k MRs each) with a 8 minutes gap, + # so this should take ~60 hours for all background migrations to complete. + queue_background_migration_jobs_by_range_at_intervals(MergeRequest, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) + end +end |