Removes database migrations up to 15-6-stable-ee
What does this MR do and why?
Remove database migrations up to 20221111070314
– until 15-6-stable-ee
.
Follow up from !136253 (merged)
Changes in this MR:
- Delete
db/migrate
introduced in15-6-stable-ee
up to20221110150942
- Delete
db/post_migrate
introduced in15-6-stable-ee
up to20221111070314
- Delete related specs
- Move
15-6-stable-ee db/structure.sql
changes toinit_structure.sql
NOTE 1
We decided not to rename the 20211202041233_init_schema.rb
file, to avoid problems with migrations
NOTE 2
You will notice that I didn't remove some migrations that have the timestamp before 20221111070314
. This is because these migrations were introduced in another release (like 15-7-stable-ee
).
NOTE 3
A new post migration (20230117114739
) was backported to 15-6-stable-ee
trough !109844 (merged). I did not exclude this migration file to not break the migration order because the timestamp is set to 2023-01-17 11:47:39
.
How did I perform the squash:
I used the squash script: bundle exec rake gitlab:db:squash\[15-6-stable-ee\]
:
- Compared the diff between
master
and15-6-stable-ee
- Deleted all migrations up to
15-6-stable-ee
version - Copied the
structure.sql
file toinit_structure.sql
(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
20221111070314
bin/rails db:migrate:main VERSION=20221111070314
- 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-15-6
branch
Generate a diff file from - Checkout
master
branch
git checkout 409574-remove-old-migrations-before-20220824082427-15-6
- Re-create the database
gdk stop && gdk start db && bin/rails db:drop db:create
- Migrate to version
20211202041233
(only the init_schema migration)
bin/rails db:migrate:main VERSION=20221111070314
- 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-15-6
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)