summaryrefslogtreecommitdiff
path: root/app/models/bulk_import.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/bulk_import.rb')
-rw-r--r--app/models/bulk_import.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/models/bulk_import.rb b/app/models/bulk_import.rb
index cabff86a9f9..5d646313423 100644
--- a/app/models/bulk_import.rb
+++ b/app/models/bulk_import.rb
@@ -1,5 +1,8 @@
# frozen_string_literal: true
+# The BulkImport model links all models required for a bulk import of groups and
+# projects to a GitLab instance. It associates the import with the responsible
+# user.
class BulkImport < ApplicationRecord
belongs_to :user, optional: false
@@ -12,5 +15,20 @@ class BulkImport < ApplicationRecord
state_machine :status, initial: :created do
state :created, value: 0
+ state :started, value: 1
+ state :finished, value: 2
+ state :failed, value: -1
+
+ event :start do
+ transition created: :started
+ end
+
+ event :finish do
+ transition started: :finished
+ end
+
+ event :fail_op do
+ transition any => :failed
+ end
end
end