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
c98ed42d
Commit
c98ed42d
authored
Jun 12, 2017
by
Bob Van Landuyt
Committed by
Bob Van Landuyt
Jun 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert renames from a migration
parent
152cba56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
db/post_migrate/20170525140254_rename_all_reserved_paths_again.rb
...migrate/20170525140254_rename_all_reserved_paths_again.rb
+1
-0
lib/gitlab/database/rename_reserved_paths_migration/v1.rb
lib/gitlab/database/rename_reserved_paths_migration/v1.rb
+5
-0
spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb
...itlab/database/rename_reserved_paths_migration/v1_spec.rb
+22
-0
No files found.
db/post_migrate/20170525140254_rename_all_reserved_paths_again.rb
View file @
c98ed42d
...
@@ -104,5 +104,6 @@ class RenameAllReservedPathsAgain < ActiveRecord::Migration
...
@@ -104,5 +104,6 @@ class RenameAllReservedPathsAgain < ActiveRecord::Migration
end
end
def
down
def
down
revert_renames
end
end
end
end
lib/gitlab/database/rename_reserved_paths_migration/v1.rb
View file @
c98ed42d
...
@@ -29,6 +29,11 @@ module Gitlab
...
@@ -29,6 +29,11 @@ module Gitlab
paths
=
Array
(
paths
)
paths
=
Array
(
paths
)
RenameNamespaces
.
new
(
paths
,
self
).
rename_namespaces
(
type: :top_level
)
RenameNamespaces
.
new
(
paths
,
self
).
rename_namespaces
(
type: :top_level
)
end
end
def
revert_renames
RenameProjects
.
new
([],
self
).
revert_renames
RenameNamespaces
.
new
([],
self
).
revert_renames
end
end
end
end
end
end
end
...
...
spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb
View file @
c98ed42d
...
@@ -51,4 +51,26 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1, :truncate do
...
@@ -51,4 +51,26 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1, :truncate do
subject
.
rename_root_paths
(
'the-path'
)
subject
.
rename_root_paths
(
'the-path'
)
end
end
end
end
describe
'#revert_renames'
do
it
'renames namespaces'
do
rename_namespaces
=
double
expect
(
described_class
::
RenameNamespaces
).
to
receive
(
:new
).
with
([],
subject
).
and_return
(
rename_namespaces
)
expect
(
rename_namespaces
).
to
receive
(
:revert_renames
)
subject
.
revert_renames
end
it
'renames projects'
do
rename_projects
=
double
expect
(
described_class
::
RenameProjects
).
to
receive
(
:new
).
with
([],
subject
).
and_return
(
rename_projects
)
expect
(
rename_projects
).
to
receive
(
:revert_renames
)
subject
.
revert_renames
end
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