Squashing Migrations

  1. Get the schema (dump) of the database, which contains the data of the countries table
    and the entry in the users table for qa@tunex.io with a preset password.
    To get a dump, you need to execute the initial deploy in a new environment, that is,
    install Marionette right out of the box.

  2. Shut services down and start service db:
    docker-compose down && docker-compose up -d db

  3. Dump the database:
    docker-compose exec db mysqldump -u root --password=theSTRONGpassword marionette > schema.sql

  4. Next, in the Backend project, do the following:
    Save the database dump obtained in step 3 as schema/schema.sql.
    Zip all js-files in api/migrations directory (look, it's just in case) and then delete them:
    cd api/migrations && tar -czvf migrations.tar.gz *.js && rm *.js

  5. Release the updated backend and test it in a live database environment.

Note: This functionality was implemented in this commit https://gitlab.tunex.io/marionette-develop/backend/-/commit/e1f44f871804396ed05e2c36774b664aa2c01bc8

Â