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
c3f711f7
Commit
c3f711f7
authored
Feb 24, 2020
by
David Fernandez
Committed by
Adam Hegyi
Feb 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update npm_package_requests_forwarding default
It will be true by default
parent
c5e2288b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
2 deletions
+57
-2
db/migrate/20200221105436_update_application_setting_npm_package_requests_forwarding_default.rb
...cation_setting_npm_package_requests_forwarding_default.rb
+17
-0
db/schema.rb
db/schema.rb
+2
-2
spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb
...n_setting_npm_package_requests_forwarding_default_spec.rb
+38
-0
No files found.
db/migrate/20200221105436_update_application_setting_npm_package_requests_forwarding_default.rb
0 → 100644
View file @
c3f711f7
# frozen_string_literal: true
class
UpdateApplicationSettingNpmPackageRequestsForwardingDefault
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
def
up
change_column_default
:application_settings
,
:npm_package_requests_forwarding
,
true
execute
(
'UPDATE application_settings SET npm_package_requests_forwarding = TRUE'
)
end
def
down
change_column_default
:application_settings
,
:npm_package_requests_forwarding
,
false
execute
(
'UPDATE application_settings SET npm_package_requests_forwarding = FALSE'
)
end
end
db/schema.rb
View file @
c3f711f7
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_02_2
0_180944
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_02_2
1_105436
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"pg_trgm"
...
...
@@ -351,7 +351,7 @@ ActiveRecord::Schema.define(version: 2020_02_20_180944) do
t
.
boolean
"prevent_merge_requests_committers_approval"
,
default:
false
,
null:
false
t
.
boolean
"email_restrictions_enabled"
,
default:
false
,
null:
false
t
.
text
"email_restrictions"
t
.
boolean
"npm_package_requests_forwarding"
,
default:
fals
e
,
null:
false
t
.
boolean
"npm_package_requests_forwarding"
,
default:
tru
e
,
null:
false
t
.
index
[
"custom_project_templates_group_id"
],
name:
"index_application_settings_on_custom_project_templates_group_id"
t
.
index
[
"file_template_project_id"
],
name:
"index_application_settings_on_file_template_project_id"
t
.
index
[
"instance_administration_project_id"
],
name:
"index_applicationsettings_on_instance_administration_project_id"
...
...
spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb
0 → 100644
View file @
c3f711f7
# frozen_string_literal: true
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'migrate'
,
'20200221105436_update_application_setting_npm_package_requests_forwarding_default.rb'
)
describe
UpdateApplicationSettingNpmPackageRequestsForwardingDefault
,
:migration
do
# Create test data - pipeline and CI/CD jobs.
let
(
:application_settings
)
{
table
(
:application_settings
)
}
before
do
application_settings
.
create!
(
npm_package_requests_forwarding:
false
)
end
# Test just the up migration.
it
'correctly migrates the application setting'
do
expect
{
migrate!
}.
to
change
{
current_application_setting
}.
from
(
false
).
to
(
true
)
end
# Test a reversible migration.
it
'correctly migrates up and down the application setting'
do
reversible_migration
do
|
migration
|
# Expectations will run before the up migration,
# and then again after the down migration
migration
.
before
->
{
expect
(
current_application_setting
).
to
eq
false
}
# Expectations will run after the up migration.
migration
.
after
->
{
expect
(
current_application_setting
).
to
eq
true
}
end
end
def
current_application_setting
ApplicationSetting
.
current_without_cache
.
npm_package_requests_forwarding
end
end
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