Skip to content
Snippets Groups Projects
Commit 02b398d3 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'dz-check-schema' into 'master'

Add rake task to check db schema is valid

Closes #37568

See merge request gitlab-org/gitlab-ce!14365
parents e0332ecf 9cd0d68f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -516,6 +516,12 @@ db:seed_fu-mysql:
<<: *db-seed_fu
<<: *use-mysql
 
db:check-schema-pg:
<<: *db-migrate-reset
<<: *use-pg
script:
- source scripts/schema_changed.sh
# Frontend-related jobs
gitlab:assets:compile:
<<: *dedicated-runner
Loading
Loading
function schema_changed() {
if [[ ! -z `git diff --name-only -- db/schema.rb` ]]; then
echo "db/schema.rb after rake db:migrate:reset is different from one in the repository"
exit 1
else
echo "db/schema.rb after rake db:migrate:reset matches one in the repository"
fi
}
schema_changed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment