summaryrefslogtreecommitdiff
path: root/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20191216183532_insert_project_hooks_plan_limits.rb')
-rw-r--r--db/migrate/20191216183532_insert_project_hooks_plan_limits.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb b/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb
new file mode 100644
index 00000000000..b2c0121dd24
--- /dev/null
+++ b/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class InsertProjectHooksPlanLimits < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ return unless Gitlab.com?
+
+ create_or_update_plan_limit('project_hooks', 'free', 10)
+ create_or_update_plan_limit('project_hooks', 'bronze', 20)
+ create_or_update_plan_limit('project_hooks', 'silver', 30)
+ create_or_update_plan_limit('project_hooks', 'gold', 100)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ create_or_update_plan_limit('project_hooks', 'free', 0)
+ create_or_update_plan_limit('project_hooks', 'bronze', 0)
+ create_or_update_plan_limit('project_hooks', 'silver', 0)
+ create_or_update_plan_limit('project_hooks', 'gold', 0)
+ end
+end