Skip to content

Remove old migrations - Part II

What does this MR do and why?

In this MR, we are squashing migrations before 2020.12.12.

Part I had an impact of 5 minutes on rspec migration jobs 🎉 🎉 🎉

We still need to have a Part III, where we are going to continue the cleanup :)

I have used the following script to be able to squash the migrations and remove the spec files.

  1. bundle exec rake db:drop db:create db:migrate VERSION=20201211042306 -> Drops the database; Creates a new database; Migrates to a specific version
  2. bundle exec rake db:structure:dump SCHEMA=db/init_structure.sql -> Creates a new structure file with the name init_structure.sql
  3. rake remove_old_migrations[20201211042306] -> Removes all migration files + specs (*) MR
  4. bundle exec rake db:drop db:create db:migrate -> Creates a new database without using the old migrations

(*) We are not removing the init schema migration.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #331248 (closed)

Edited by Diogo Frazão

Merge request reports