summaryrefslogtreecommitdiff
path: root/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb')
-rw-r--r--db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb b/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
new file mode 100644
index 00000000000..7f90b3293d8
--- /dev/null
+++ b/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class DropWebHookCallsHighColumn < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ if column_exists?(:plan_limits, :web_hook_calls_high) # rubocop:disable Style/IfUnlessModifier
+ remove_column :plan_limits, :web_hook_calls_high
+ end
+ end
+ end
+
+ def down
+ with_lock_retries do
+ unless column_exists?(:plan_limits, :web_hook_calls_high)
+ # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ add_column :plan_limits, :web_hook_calls_high, :integer, default: 0
+ # rubocop:enable Migration/SchemaAdditionMethodsNoPost
+ end
+ end
+ end
+end