Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20201116211829_create_user_permission_export_uploads.rb')
-rw-r--r--db/migrate/20201116211829_create_user_permission_export_uploads.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/db/migrate/20201116211829_create_user_permission_export_uploads.rb b/db/migrate/20201116211829_create_user_permission_export_uploads.rb
new file mode 100644
index 00000000000..d6207fe0c2c
--- /dev/null
+++ b/db/migrate/20201116211829_create_user_permission_export_uploads.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+class CreateUserPermissionExportUploads < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ unless table_exists?(:user_permission_export_uploads)
+ create_table :user_permission_export_uploads do |t|
+ t.timestamps_with_timezone null: false
+ t.references :user, foreign_key: { on_delete: :cascade }, index: false, null: false
+ t.integer :file_store
+ t.integer :status, limit: 2, null: false, default: 0
+ t.text :file
+
+ t.index [:user_id, :status]
+ end
+ end
+ end
+
+ add_text_limit :user_permission_export_uploads, :file, 255
+ end
+
+ def down
+ with_lock_retries do
+ drop_table :user_permission_export_uploads
+ end
+ end
+end