Commit de93bf1f authored by DJ Mountney's avatar DJ Mountney

Update comments and docs around min schema version

Fixed some spelling
Dropped rake task description for a prefix only task
Added note on skipping the check to the postgres debugging dev doc
parent e793f96c
......@@ -85,3 +85,21 @@ eric 37709 0.0 0.0 2518640 7524 s006 S Wed11AM 0:00.79 s
$ kill 87304
$ kill 37709
```
### db:migrate `database version is too old to be migrated` error
Users receive this error when `db:migrate` detects that the current schema version
is older than the `MIN_SCHEMA_VERSION` defined in the `Gitlab::Database` library
module.
Over time we cleanup/combine old migrations in the codebase, so it is not always
possible to migrate GitLab from every previous version.
In some cases you may want to bypass this check. For example, if you were on a version
of GitLab schema later than the `MIN_SCHEMA_VERSION`, and then rolled back the
to an older migration, from before. In this case, in order to migrate forward again,
you should set the `SKIP_SCHEMA_VERSION_CHECK` environment variable.
```sh
bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true
```
......@@ -11,7 +11,7 @@ module Gitlab
# https://dev.mysql.com/doc/refman/5.7/en/datetime.html
MAX_TIMESTAMP_VALUE = Time.at((1 << 31) - 1).freeze
# Minimum schema version from which migrations are be supported
# Minimum schema version from which migrations are supported
# Migrations before this version may have been removed
MIN_SCHEMA_VERSION = 20190506135400
MIN_SCHEMA_GITLAB_VERSION = '11.11.0'
......
# frozen_string_literal: true
desc 'Configures the database by running migrate, or by loading the schema and seeding if needed'
# Configures the database by running migrate, or by loading the schema and seeding if needed
task schema_version_check: :environment do
next if ENV['SKIP_SCHEMA_VERSION_CHECK']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment