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
aadee592
Commit
aadee592
authored
Dec 13, 2021
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New scripts/db_migrate to handle DB migrations
parent
06bae34e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
.gitlab/ci/rails.gitlab-ci.yml
.gitlab/ci/rails.gitlab-ci.yml
+4
-7
scripts/db_migrate
scripts/db_migrate
+11
-0
No files found.
.gitlab/ci/rails.gitlab-ci.yml
View file @
aadee592
...
@@ -342,9 +342,8 @@ rspec fast_spec_helper minimal:
...
@@ -342,9 +342,8 @@ rspec fast_spec_helper minimal:
db:rollback:
db:rollback:
extends
:
.db-job-base
extends
:
.db-job-base
script
:
script
:
-
if [[ -d "ee/" ]]; then task="db:migrate:main"; else task="db:migrate"; fi
-
scripts/db_migrate VERSION=20181228175414
-
bundle exec rake "${task}" VERSION=20181228175414
-
scripts/db_migrate SKIP_SCHEMA_VERSION_CHECK=true
-
bundle exec rake "${task}" SKIP_SCHEMA_VERSION_CHECK=true
db:migrate:reset:
db:migrate:reset:
extends
:
.db-job-base
extends
:
.db-job-base
...
@@ -369,8 +368,7 @@ db:migrate-from-previous-major-version:
...
@@ -369,8 +368,7 @@ db:migrate-from-previous-major-version:
-
git checkout -f $CI_COMMIT_SHA
-
git checkout -f $CI_COMMIT_SHA
-
SETUP_DB=false USE_BUNDLE_INSTALL=true bash scripts/prepare_build.sh
-
SETUP_DB=false USE_BUNDLE_INSTALL=true bash scripts/prepare_build.sh
script
:
script
:
-
if [[ -d "ee/" ]]; then task="db:migrate:main"; else task="db:migrate"; fi
-
run_timed_command "scripts/db_migrate"
-
run_timed_command "bundle exec rake ${task}"
db:check-schema:
db:check-schema:
extends
:
extends
:
...
@@ -379,8 +377,7 @@ db:check-schema:
...
@@ -379,8 +377,7 @@ db:check-schema:
variables
:
variables
:
TAG_TO_CHECKOUT
:
"
v14.4.0"
TAG_TO_CHECKOUT
:
"
v14.4.0"
script
:
script
:
-
if [[ -d "ee/" ]]; then task="db:migrate:main"; else task="db:migrate"; fi
-
run_timed_command "scripts/db_migrate"
-
run_timed_command "bundle exec rake ${task}"
-
scripts/schema_changed.sh
-
scripts/schema_changed.sh
-
scripts/validate_migration_timestamps
-
scripts/validate_migration_timestamps
...
...
scripts/db_migrate
0 → 100755
View file @
aadee592
#!/bin/bash
root_path
=
"
$(
cd
"
$(
dirname
"
$0
"
)
/.."
||
exit
;
pwd
-P
)
"
if
[[
-d
"
${
root_path
}
/ee/"
]]
;
then
task
=
"db:migrate:main"
else
task
=
"db:migrate"
fi
eval
"bundle exec rake
${
task
}
${
*
}
"
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