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
f4232d84
Commit
f4232d84
authored
Jun 20, 2019
by
DJ Mountney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix db:migrate for fresh installs
parent
f4e15535
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
lib/tasks/migrate/schema_check.rake
lib/tasks/migrate/schema_check.rake
+6
-1
No files found.
lib/tasks/migrate/schema_check.rake
View file @
f4232d84
desc
'Configures the database by running migrate, or by loading the schema and seeding if needed'
desc
'Configures the database by running migrate, or by loading the schema and seeding if needed'
task
schema_version_check: :environment
do
task
schema_version_check: :environment
do
if
ActiveRecord
::
Migrator
.
current_version
<
Gitlab
::
Database
::
MIN_SCHEMA_VERSION
schema_version
=
ActiveRecord
::
Migrator
.
current_version
# Ensure migrations are being run from a supported schema version
# A schema verison of 0 is a fresh db, and should be safe to run migrations
# But a database with existing migrations less than our min version is not
if
schema_version
>
0
&&
schema_version
<
Gitlab
::
Database
::
MIN_SCHEMA_VERSION
raise
"Your current database version is too old to be migrated. "
\
raise
"Your current database version is too old to be migrated. "
\
"You should upgrade to GitLab
#{
Gitlab
::
Database
::
MIN_SCHEMA_GITLAB_VERSION
}
before moving to this version. "
\
"You should upgrade to GitLab
#{
Gitlab
::
Database
::
MIN_SCHEMA_GITLAB_VERSION
}
before moving to this version. "
\
"Please see https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations"
"Please see https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations"
...
...
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