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
f607b1f9
Commit
f607b1f9
authored
Mar 26, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the shards table has its index created before populating it
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
bc1f926e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
config/initializers/fill_shards.rb
config/initializers/fill_shards.rb
+6
-3
No files found.
config/initializers/fill_shards.rb
View file @
f607b1f9
# The `table_exists?` check is needed because during our migration rollback testing,
# The `table_exists?` check is needed because during our migration rollback testing,
# `Shard.connected?` could be cached and return true even though the table doesn't exist
# `Shard.connected?` could be cached and return true even though the table doesn't exist
if
Shard
.
connected?
&&
Shard
.
table_exists?
&&
!
Gitlab
::
Database
.
read_only?
return
unless
Shard
.
connected?
Shard
.
populate!
return
unless
Shard
.
table_exists?
end
return
unless
Shard
.
connection
.
index_exists?
(
:shards
,
:name
,
unique:
true
)
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