summaryrefslogtreecommitdiff
path: root/db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb')
-rw-r--r--db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb b/db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb
new file mode 100644
index 00000000000..50fcf6fd113
--- /dev/null
+++ b/db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddRegistrySizeEstimatedToNamespaceRootStorageStatistics < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_ns_root_stor_stats_on_registry_size_estimated'
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ add_column :namespace_root_storage_statistics, :registry_size_estimated, :boolean, default: false, null: false
+ end
+
+ add_concurrent_index :namespace_root_storage_statistics, :registry_size_estimated, name: INDEX_NAME
+ end
+
+ def down
+ with_lock_retries do
+ remove_column :namespace_root_storage_statistics, :registry_size_estimated
+ end
+ end
+end