summaryrefslogtreecommitdiff
path: root/db/migrate/20200513234502_fill_file_store_lfs_objects.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20200513234502_fill_file_store_lfs_objects.rb')
-rw-r--r--db/migrate/20200513234502_fill_file_store_lfs_objects.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20200513234502_fill_file_store_lfs_objects.rb b/db/migrate/20200513234502_fill_file_store_lfs_objects.rb
new file mode 100644
index 00000000000..74066afbd83
--- /dev/null
+++ b/db/migrate/20200513234502_fill_file_store_lfs_objects.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class FillFileStoreLfsObjects < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ update_column_in_batches(:lfs_objects, :file_store, 1) do |table, query|
+ query.where(table[:file_store].eq(nil))
+ end
+ end
+
+ def down
+ # no-op
+ end
+end