Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ac8165cc
Commit
ac8165cc
authored
Mar 06, 2020
by
Kamil Trzciński
Committed by
Mayra Cabrera
Mar 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ci_project_subscriptions plan limits
Do not try to create default yet. Update to refer only to `Gitlab.com?`
parent
7f052e3e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
25 deletions
+27
-25
db/migrate/20200225123228_insert_project_subscriptions_plan_limits.rb
...0200225123228_insert_project_subscriptions_plan_limits.rb
+10
-18
doc/development/application_limits.md
doc/development/application_limits.md
+17
-7
No files found.
db/migrate/20200225123228_insert_project_subscriptions_plan_limits.rb
View file @
ac8165cc
...
@@ -6,28 +6,20 @@ class InsertProjectSubscriptionsPlanLimits < ActiveRecord::Migration[6.0]
...
@@ -6,28 +6,20 @@ class InsertProjectSubscriptionsPlanLimits < ActiveRecord::Migration[6.0]
DOWNTIME
=
false
DOWNTIME
=
false
def
up
def
up
return
if
Rails
.
env
.
test
?
return
unless
Gitlab
.
com
?
if
Gitlab
.
com?
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'free'
,
2
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'free'
,
2
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'bronze'
,
2
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'bronze'
,
2
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'silver'
,
2
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'silver'
,
2
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'gold'
,
2
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'gold'
,
2
)
else
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'default'
,
2
)
end
end
end
def
down
def
down
return
if
Rails
.
env
.
test
?
return
unless
Gitlab
.
com
?
if
Gitlab
.
com?
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'free'
,
0
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'free'
,
0
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'bronze'
,
0
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'bronze'
,
0
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'silver'
,
0
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'silver'
,
0
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'gold'
,
0
)
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'gold'
,
0
)
else
create_or_update_plan_limit
(
'ci_project_subscriptions'
,
'default'
,
0
)
end
end
end
end
end
doc/development/application_limits.md
View file @
ac8165cc
...
@@ -33,18 +33,28 @@ limit values. It's recommended to create separate migration script files.
...
@@ -33,18 +33,28 @@ limit values. It's recommended to create separate migration script files.
`create_or_update_plan_limit`
migration helper, eg:
`create_or_update_plan_limit`
migration helper, eg:
```
ruby
```
ruby
create_or_update_plan_limit
(
'project_hooks'
,
'free'
,
10
)
def
up
create_or_update_plan_limit
(
'project_hooks'
,
'bronze'
,
20
)
return
unless
Gitlab
.
com?
create_or_update_plan_limit
(
'project_hooks'
,
'silver'
,
30
)
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
)
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
NOTE:
**Note:**
Some plans exist only on GitLab.com. You can check if the
migration is running on GitLab.com with
`Gitlab.com?`
.
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
### Plan limits validation
#### Get current limit
#### Get current limit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment