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
5eabc1da
Commit
5eabc1da
authored
Mar 08, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix post deployment migrations for Geo database
parent
080e52e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
config/initializers/0_post_deployment_migrations.rb
config/initializers/0_post_deployment_migrations.rb
+7
-5
lib/tasks/geo.rake
lib/tasks/geo.rake
+1
-4
No files found.
config/initializers/0_post_deployment_migrations.rb
View file @
5eabc1da
...
...
@@ -2,11 +2,13 @@
# before other initializers as Rails may otherwise memoize a list of migrations
# excluding the post deployment migrations.
unless
ENV
[
'SKIP_POST_DEPLOYMENT_MIGRATIONS'
]
path
=
Rails
.
root
.
join
(
'db'
,
'post_migrate'
).
to_s
Rails
.
application
.
config
.
paths
[
'db'
].
each
do
|
db_path
|
path
=
Rails
.
root
.
join
(
db_path
,
'post_migrate'
).
to_s
Rails
.
application
.
config
.
paths
[
'db/migrate'
]
<<
path
Rails
.
application
.
config
.
paths
[
'db/migrate'
]
<<
path
# Rails memoizes migrations at certain points where it won't read the above
# path just yet. As such we must also update the following list of paths.
ActiveRecord
::
Migrator
.
migrations_paths
<<
path
# Rails memoizes migrations at certain points where it won't read the above
# path just yet. As such we must also update the following list of paths.
ActiveRecord
::
Migrator
.
migrations_paths
<<
path
end
end
lib/tasks/geo.rake
View file @
5eabc1da
...
...
@@ -55,13 +55,11 @@ namespace :geo do
# save current configuration
@previous_config
=
{
config:
Rails
.
application
.
config
.
dup
,
schema:
ENV
[
'SCHEMA'
],
skip_post_deployment_migrations:
ENV
[
'SKIP_POST_DEPLOYMENT_MIGRATIONS'
]
schema:
ENV
[
'SCHEMA'
]
}
# set config variables for geo database
ENV
[
'SCHEMA'
]
=
'db/geo/schema.rb'
ENV
[
'SKIP_POST_DEPLOYMENT_MIGRATIONS'
]
=
'true'
Rails
.
application
.
config
.
paths
[
'db'
]
=
[
'db/geo'
]
Rails
.
application
.
config
.
paths
[
'db/migrate'
]
=
[
'db/geo/migrate'
]
Rails
.
application
.
config
.
paths
[
'db/seeds.rb'
]
=
[
'db/geo/seeds.rb'
]
...
...
@@ -71,7 +69,6 @@ namespace :geo do
task
:restore
do
# restore config variables to previous values
ENV
[
'SCHEMA'
]
=
@previous_config
[
:schema
]
ENV
[
'SKIP_POST_DEPLOYMENT_MIGRATIONS'
]
=
@previous_config
[
:skip_post_deployment_migrations
]
Rails
.
application
.
config
=
@previous_config
[
:config
]
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