diff --git a/lib/api/entities/batched_background_migration.rb b/lib/api/entities/batched_background_migration.rb index 08e4681e0aa1975cee2fdda75e93cdf615948593..65e9de4b2bd0666a1d9748fc58ce7425a9d8b3ee 100644 --- a/lib/api/entities/batched_background_migration.rb +++ b/lib/api/entities/batched_background_migration.rb @@ -6,6 +6,7 @@ class BatchedBackgroundMigration < Grape::Entity expose :id, documentation: { type: :string, example: "1234" } expose :job_class_name, documentation: { type: :string, example: "CopyColumnUsingBackgroundMigrationJob" } expose :table_name, documentation: { type: :string, example: "events" } + expose :column_name, documentation: { type: :string, example: "id" } expose :status_name, as: :status, override: true, documentation: { type: :string, example: "active" } expose :progress, documentation: { type: :float, example: 50 } expose :created_at, documentation: { type: :dateTime, example: "2022-11-28T16:26:39+02:00" } diff --git a/spec/requests/api/admin/batched_background_migrations_spec.rb b/spec/requests/api/admin/batched_background_migrations_spec.rb index 180b6c7abd6bccd7ca7eb522390085dd9b327c08..2b205ca656f92aecacb8827c6ed44114e1d3938d 100644 --- a/spec/requests/api/admin/batched_background_migrations_spec.rb +++ b/spec/requests/api/admin/batched_background_migrations_spec.rb @@ -100,6 +100,7 @@ expect(json_response.first['id']).to eq(migration.id) expect(json_response.first['job_class_name']).to eq(migration.job_class_name) expect(json_response.first['table_name']).to eq(migration.table_name) + expect(json_response.first['column_name']).to eq(migration.column_name) expect(json_response.first['status']).to eq(migration.status_name.to_s) expect(json_response.first['progress']).to be_zero end @@ -151,6 +152,7 @@ expect(json_response.first['id']).to eq(ci_database_migration.id) expect(json_response.first['job_class_name']).to eq(ci_database_migration.job_class_name) expect(json_response.first['table_name']).to eq(ci_database_migration.table_name) + expect(json_response.first['column_name']).to eq(ci_database_migration.column_name) expect(json_response.first['status']).to eq(ci_database_migration.status_name.to_s) expect(json_response.first['progress']).to be_zero end