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
5b6a7b1c
Commit
5b6a7b1c
authored
Nov 02, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove down method in migration
parent
0aa33c7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
26 deletions
+1
-26
db/migrate/20201027002551_migrate_services_to_http_integrations.rb
...e/20201027002551_migrate_services_to_http_integrations.rb
+1
-10
spec/migrations/20201027002551_migrate_services_to_http_integrations_spec.rb
...01027002551_migrate_services_to_http_integrations_spec.rb
+0
-16
No files found.
db/migrate/20201027002551_migrate_services_to_http_integrations.rb
View file @
5b6a7b1c
...
...
@@ -46,15 +46,6 @@ class MigrateServicesToHttpIntegrations < ActiveRecord::Migration[6.0]
end
def
down
sql
=
<<~
SQL
SELECT project_id FROM services
WHERE type = '
#{
ALERT_SERVICE_TYPE
}
'
SQL
select_values
(
sql
).
each
do
|
project_id
|
HttpIntegration
.
where
(
project_id:
project_id
,
endpoint_identifier:
SERVICE_NAMES_IDENTIFIER
[
:identifier
])
.
delete_all
end
# no-op
end
end
spec/migrations/20201027002551_migrate_services_to_http_integrations_spec.rb
View file @
5b6a7b1c
...
...
@@ -23,20 +23,4 @@ RSpec.describe MigrateServicesToHttpIntegrations do
expect
(
http_integration
.
endpoint_identifier
).
to
eq
(
described_class
::
SERVICE_NAMES_IDENTIFIER
[
:identifier
])
end
end
describe
'#down'
do
before
do
http_integrations
.
create!
(
project_id:
project
.
id
,
name:
described_class
::
SERVICE_NAMES_IDENTIFIER
[
:name
],
endpoint_identifier:
described_class
::
SERVICE_NAMES_IDENTIFIER
[
:identifier
],
encrypted_token:
'test'
,
encrypted_token_iv:
'test'
)
end
it
'removes the existing http integrations'
do
expect
{
described_class
.
new
.
down
}.
to
change
{
http_integrations
.
count
}.
from
(
1
).
to
(
0
)
end
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