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
9d6434ac
Commit
9d6434ac
authored
Sep 19, 2018
by
DJ Mountney
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into ce-to-ee-2018-09-19
parents
51927b30
d01079cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
23 deletions
+28
-23
config/initializers/0_post_deployment_migrations.rb
config/initializers/0_post_deployment_migrations.rb
+0
-23
ee/lib/ee/gitlab/database.rb
ee/lib/ee/gitlab/database.rb
+24
-0
lib/gitlab/database.rb
lib/gitlab/database.rb
+4
-0
No files found.
config/initializers/0_post_deployment_migrations.rb
View file @
9d6434ac
# Post deployment migrations are included by default. This file must be loaded
# before other initializers as Rails may otherwise memoize a list of migrations
# excluding the post deployment migrations.
<<<<<<<
HEAD
unless
ENV
[
'SKIP_POST_DEPLOYMENT_MIGRATIONS'
]
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 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
migrate_paths
=
Rails
.
application
.
config
.
paths
[
'db/migrate'
].
to_a
migrate_paths
.
each
do
|
migrate_path
|
absolute_migrate_path
=
Pathname
.
new
(
migrate_path
).
realpath
(
Rails
.
root
)
ee_migrate_path
=
Rails
.
root
.
join
(
'ee/'
,
absolute_migrate_path
.
relative_path_from
(
Rails
.
root
))
Rails
.
application
.
config
.
paths
[
'db/migrate'
]
<<
ee_migrate_path
.
to_s
ActiveRecord
::
Migrator
.
migrations_paths
<<
ee_migrate_path
.
to_s
end
=======
Gitlab
::
Database
.
add_post_migrate_path_to_rails
>>>>>>>
upstream
/
master
ee/lib/ee/gitlab/database.rb
0 → 100644
View file @
9d6434ac
module
EE
module
Gitlab
module
Database
extend
::
Gitlab
::
Utils
::
Override
override
:add_post_migrate_path_to_rails
def
add_post_migrate_path_to_rails
(
force:
false
)
super
migrate_paths
=
Rails
.
application
.
config
.
paths
[
'db/migrate'
].
to_a
migrate_paths
.
each
do
|
migrate_path
|
relative_migrate_path
=
Pathname
.
new
(
migrate_path
).
realpath
(
Rails
.
root
).
relative_path_from
(
Rails
.
root
)
ee_migrate_path
=
Rails
.
root
.
join
(
'ee/'
,
relative_migrate_path
)
next
if
relative_migrate_path
.
to_s
.
start_with?
(
'ee/'
)
||
Rails
.
application
.
config
.
paths
[
'db/migrate'
].
include?
(
ee_migrate_path
.
to_s
)
Rails
.
application
.
config
.
paths
[
'db/migrate'
]
<<
ee_migrate_path
.
to_s
ActiveRecord
::
Migrator
.
migrations_paths
<<
ee_migrate_path
.
to_s
end
end
end
end
end
lib/gitlab/database.rb
View file @
9d6434ac
...
...
@@ -9,6 +9,10 @@ module Gitlab
# https://dev.mysql.com/doc/refman/5.7/en/datetime.html
MAX_TIMESTAMP_VALUE
=
Time
.
at
((
1
<<
31
)
-
1
).
freeze
class
<<
self
prepend
EE
::
Gitlab
::
Database
end
def
self
.
config
ActiveRecord
::
Base
.
configurations
[
Rails
.
env
]
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