Removes database migrations up to 16-2-stable-ee
What does this MR do and why?
Remove database migrations up to 20230717200940
– until 16-2-stable-ee
.
Follow up from !139940 (merged)
Changes in this MR:
- Delete
db/migrate
anddb/post_migrate
introduced in16-2-stable-ee
up to20230717200940
- Delete related specs
- Move
16-1-stable-ee db/structure.sql
changes toinit_structure.sql
- db:rollback job was updated with the first migration from
16.3 - 20230718020825
NOTE 1
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\[16-1-stable-ee\]
:
- Compared the diff between
master
and16-2-stable-ee
- Deleted all migrations up to
16-2-stable-ee
version - Copied the
structure.sql
file toinit_structure.sql
(from16-2-stable-ee
version)
How to set up and validate locally
master
branch
Generate a diff file from - Checkout
master
branch (revision14b8b0416a0f27be331ae34b151b2702f4c80723
) — This revision makes sure that the same migrations are present in both branches,master
and409574-remove-old-migrations-to-16-2
git checkout 14b8b0416a0f27be331ae34b151b2702f4c80723
- Re-create the database
gdk stop && gdk start db && bin/rails db:drop db:create
- Migrate the database
bin/rails db:migrate:main
- 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-to-16-2
branch
Generate a diff file from - Checkout current branch
git checkout 409574-remove-old-migrations-to-16-2
- Re-create the database
gdk stop && gdk start db && bin/rails db:drop db:create
- Migrate the database
bin/rails db:migrate:main
- 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-to-16-2
Check the changes between files
git diff --no-index 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