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/20200617000757_clean_up_file_store_lfs_objects.rb')
-rw-r--r--db/migrate/20200617000757_clean_up_file_store_lfs_objects.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20200617000757_clean_up_file_store_lfs_objects.rb b/db/migrate/20200617000757_clean_up_file_store_lfs_objects.rb
new file mode 100644
index 00000000000..a1a86355d02
--- /dev/null
+++ b/db/migrate/20200617000757_clean_up_file_store_lfs_objects.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class CleanUpFileStoreLfsObjects < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ # rubocop:disable Migration/UpdateColumnInBatches
+ update_column_in_batches(:lfs_objects, :file_store, 1) do |table, query|
+ query.where(table[:file_store].eq(nil))
+ end
+ # rubocop:enable Migration/UpdateColumnInBatches
+ end
+
+ def down
+ # no-op
+ end
+end