diff options
Diffstat (limited to 'db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb')
-rw-r--r-- | db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb b/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb deleted file mode 100644 index b82ee3569c9..00000000000 --- a/db/post_migrate/20180502134117_migrate_import_attributes_data_from_projects_to_project_mirror_data.rb +++ /dev/null @@ -1,37 +0,0 @@ -class MigrateImportAttributesDataFromProjectsToProjectMirrorData < ActiveRecord::Migration[4.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - UP_MIGRATION = 'PopulateImportState'.freeze - DOWN_MIGRATION = 'RollbackImportStateData'.freeze - - BATCH_SIZE = 1000 - DELAY_INTERVAL = 5.minutes - - disable_ddl_transaction! - - class Project < ActiveRecord::Base - include EachBatch - - self.table_name = 'projects' - end - - class ProjectImportState < ActiveRecord::Base - include EachBatch - - self.table_name = 'project_mirror_data' - end - - def up - projects = Project.where.not(import_status: :none) - - queue_background_migration_jobs_by_range_at_intervals(projects, UP_MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end - - def down - import_state = ProjectImportState.where.not(status: :none) - - queue_background_migration_jobs_by_range_at_intervals(import_state, DOWN_MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end -end |