Draft: Removes database migrations up to 15-6-stable-ee
What does this MR do and why?
-
Should be merged after !133370 (closed)
Remove database migrations up to 20220824082427 – until 15-6-stable-ee
.
Changes in this MR:
- Delete
db/migrate
up to20220811092253
- Delete
db/post_migrate
up to20220810093742
- Delete related specs
- Move
15-3-stable-ee db/structure.sql
changes toinit_structure.sql
We decided not to rename the 20211202041233_init_schema.rb
file, to avoid problems with migrations
How did I perform the squash:
I used the squash script: bundle exec rake gitlab:db:squash[15-6-stable-ee]:
- Compare de diff from
master
with15-6-stable-ee
- Delete all migrations up to
15-6-stable-ee
version - Copy
init_structure.sql
to thestructure.sql
file (from15-6-stable-ee
version)
How to set up and validate locally
master
branch
Generate a diff file from - Checkout
master
branch
git checkout master
- Re-create the database
gdk stop && gdk start db && bin/rails db:drop db:create
- Migration to version
20220824082427
bin/rails db:migrate:main VERSION=20220824082427
- Store
structure.sql
the diff in a temp file
cat db/structure.sql > tmp/master.diff
- Reset the changes
git reset --hard origin
409574-remove-old-migrations-before-20220824082427
branch
Generate a diff file from - Checkout
master
branch
git checkout 409574-remove-old-migrations-before-20220811092253
- Re-create the database
gdk stop && gdk start db && bin/rails db:drop db:create
- Migration to version
20211202041233
(only the init_schema migration)
bin/rails db:migrate:main VERSION=20211202041233
- Store
structure.sql
the diff in a temp file
cat db/structure.sql > tmp/squash.diff
- Reset the changes
git reset --hard origin/409574-remove-old-migrations-before-20220824082427
Check the changes between files
git diff tmp/master.diff tmp/squash.diff
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #409574 (closed)
Edited by Leonardo da Rosa