Skip to content

Remove old migrations

What does this MR do and why?

In this MR, we are squashing migrations of the year 2019.

I have decided to only squash migrations for this year because we have a limitation in the number of files that we can change/remove. I will open a new MR for the year 2020.

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

  1. bundle exec rake db:drop db:create db:migrate VERSION=20190909141517 -> 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[20190909141517] -> 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

Loading