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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-07 03:08:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-07 03:08:25 +0300
commit3e31cffa203fd718381421e8035f7161a9f0338e (patch)
tree5d37928bebf08ddc931efe04a85d66217c8a0cea /doc/development/application_limits.md
parent1c25ac983cd1e4335faa1ec4922c314d6321e224 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development/application_limits.md')
-rw-r--r--doc/development/application_limits.md24
1 files changed, 17 insertions, 7 deletions
diff --git a/doc/development/application_limits.md b/doc/development/application_limits.md
index 81ccebbd690..c378019c4f6 100644
--- a/doc/development/application_limits.md
+++ b/doc/development/application_limits.md
@@ -33,18 +33,28 @@ limit values. It's recommended to create separate migration script files.
`create_or_update_plan_limit` migration helper, eg:
```ruby
- 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)
+ def up
+ return unless Gitlab.com?
+
+ create_or_update_plan_limit('project_hooks', 'free', 100)
+ create_or_update_plan_limit('project_hooks', 'bronze', 100)
+ create_or_update_plan_limit('project_hooks', 'silver', 100)
+ 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
```
NOTE: **Note:** Some plans exist only on GitLab.com. You can check if the
migration is running on GitLab.com with `Gitlab.com?`.
-NOTE: **Note:** The test environment doesn't have any plans. You can check if a
-migration is running in a test environment with `Rails.env.test?`
-
### Plan limits validation
#### Get current limit