Skip to content

Migration

Rocky edited this page Jan 5, 2023 · 9 revisions

What is migration?

Migration is a process in which we can add some data to the Database, design schema of DB, indexes etc. Migration scripts are run before starting the application. You can also use these scripts to migrate data from one database to another one.

When do I need to Create Migrations?

Migrations are needed when an application needs some pre-loaded data to get started. Elevate services need email templates, forms, and entities. This data is added to DB through migration which the frontend app can utilize.

You can create Migrations inside the migration folder.

Files for migration: Each service has a modules folder within which you can find a migration folder for creating a migration. If this migration folder is present in modules, add the following line in the package.json file:

Commands for Migration in Elevate.

To create a migration file.

npm run elevate-migrations create migration-file-name

To check migration status

npm run elevate-migrations status

To run migration

npm run elevate-migrations up

To revert migration

npm run elevate-migrations down

Clone this wiki locally