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
cc8ba45b
Commit
cc8ba45b
authored
May 19, 2020
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add schema version check
See
https://gitlab.com/gitlab-org/gitlab/-/issues/207458
parent
1b06aa95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
config/initializers/fill_shards.rb
config/initializers/fill_shards.rb
+2
-3
No files found.
config/initializers/fill_shards.rb
View file @
cc8ba45b
# The
`table_exists?`
check is needed because during our migration rollback testing,
# The
explicit schema version
check is needed because during our migration rollback testing,
# `Shard.connected?` could be cached and return true even though the table doesn't exist
return
unless
Shard
.
connected?
return
unless
Shard
.
table_exists?
return
unless
Shard
.
connection
.
index_exists?
(
:shards
,
:name
,
unique:
true
)
return
unless
ActiveRecord
::
Migrator
.
current_version
>=
20190402150158
return
if
Gitlab
::
Database
.
read_only?
Shard
.
populate!
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