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
5c5015f2
Commit
5c5015f2
authored
Jul 24, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Gitlab::Geo::DatabaseTasks.pending_migrations method
parent
12eb567d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
ee/lib/gitlab/geo/database_tasks.rb
ee/lib/gitlab/geo/database_tasks.rb
+10
-6
No files found.
ee/lib/gitlab/geo/database_tasks.rb
View file @
5c5015f2
...
@@ -40,13 +40,13 @@ module Gitlab
...
@@ -40,13 +40,13 @@ module Gitlab
end
end
def
pending_migrations
def
pending_migrations
migration_context
.
open
.
pending_migrations
with_geo_db
do
migration_context
.
open
.
pending_migrations
end
end
end
def
migration_context
def
migration_context
with_geo_db
do
ActiveRecord
::
MigrationContext
.
new
(
ActiveRecord
::
Migrator
.
migrations_paths
)
ActiveRecord
::
MigrationContext
.
new
(
ActiveRecord
::
Migrator
.
migrations_paths
)
end
end
end
def
abort_if_no_geo_config!
def
abort_if_no_geo_config!
...
@@ -79,14 +79,18 @@ module Gitlab
...
@@ -79,14 +79,18 @@ module Gitlab
version
=
ENV
[
'VERSION'
]
?
ENV
[
'VERSION'
].
to_i
:
nil
version
=
ENV
[
'VERSION'
]
?
ENV
[
'VERSION'
].
to_i
:
nil
raise
'VERSION is required'
unless
version
raise
'VERSION is required'
unless
version
Gitlab
::
Geo
::
DatabaseTasks
.
migration_context
.
run
(
:up
,
version
)
Gitlab
::
Geo
::
DatabaseTasks
.
with_geo_db
do
Gitlab
::
Geo
::
DatabaseTasks
.
migration_context
.
run
(
:up
,
version
)
end
end
end
def
down
def
down
version
=
ENV
[
'VERSION'
]
?
ENV
[
'VERSION'
].
to_i
:
nil
version
=
ENV
[
'VERSION'
]
?
ENV
[
'VERSION'
].
to_i
:
nil
raise
'VERSION is required - To go down one migration, run db:rollback'
unless
version
raise
'VERSION is required - To go down one migration, run db:rollback'
unless
version
Gitlab
::
Geo
::
DatabaseTasks
.
migration_context
.
run
(
:down
,
version
)
Gitlab
::
Geo
::
DatabaseTasks
.
with_geo_db
do
Gitlab
::
Geo
::
DatabaseTasks
.
migration_context
.
run
(
:down
,
version
)
end
end
end
def
status
def
status
...
...
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