diff options
Diffstat (limited to 'db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb')
-rw-r--r-- | db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb b/db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb new file mode 100644 index 00000000000..de0286f27ed --- /dev/null +++ b/db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddBatchForeignKeyToBulkImportExportUploads < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :bulk_import_export_uploads, :bulk_import_export_batches, column: :batch_id + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :bulk_import_export_uploads, column: :batch_id + end + end +end |