> ## Documentation Index
> Fetch the complete documentation index at: https://v0.x-docs.novu.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Migrations

> Learn how to update your database data through migrations.

On occasion, Novu may introduce features that require changes to the database schema or data.
This usually happens when a feature has a hard dependency on some data being available on a database entity.
You can use migrations to make these changes to your database.

## Running Migrations

To run data migrations, enter the following sequence of commands in your terminal from the [`novuhq/novu`](https://github.com/novuhq/novu) repository root:

```bash theme={null}
npm run setup:project
cd apps/api
npm run migration -- ./migrations/<MIGRATION_PATH>.ts
# e.g. npm run migration -- ./migrations/add-user-contact/add-user-phone.ts
```

Some features may have multiple migrations, in which case you will need to run each migration in the order shown below.

## Migrations History

Below you will find a list of migrations introduced in previous versions of Novu, alongside the migration path to use in the script above.

| Version                                                      | Feature                 | Migration Path(s)                                                                                                                          |
| ------------------------------------------------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| [v0.23](https://github.com/novuhq/novu/releases/tag/v0.23.0) | API keys encryption     | `./encrypt-api-keys/encrypt-api-keys-migration.ts`                                                                                         |
| [v0.18](https://github.com/novuhq/novu/releases/tag/v0.18.0) | Multi-Provider          | `./integration-scheme-update/add-primary-priority-migration.ts`<br />`./integration-scheme-update/add-integration-identifier-migration.ts` |
|                                                              | Integration Store       | `./novu-integrations/novu-integrations.migration.ts`                                                                                       |
| [v0.16](https://github.com/novuhq/novu/releases/tag/v0.16.0) | In-App Integration      | `./in-app-integration/in-app-integration.migration.ts`                                                                                     |
|                                                              | Secure Flag Fix         | `./secure-to-boolean/secure-to-boolean-migration.ts`                                                                                       |
| [v0.15](https://github.com/novuhq/novu/releases/tag/v0.15.0) | Database TTL            | `./expire-at/expire-at.migration.ts`                                                                                                       |
| [v0.12](https://github.com/novuhq/novu/releases/tag/v0.12.0) | Organization Invite Fix | `./normalize-users-email/normalize-users-email.migration.ts`                                                                               |
| [v0.9](https://github.com/novuhq/novu/releases/tag/v0.9.0)   | Seen/Read Support       | `./seen-read-support/seen-read-support.migration.ts`                                                                                       |
| [v0.8](https://github.com/novuhq/novu/releases/tag/v0.8.0)   | Secure Credentials      | `./fcm-credentials/fcm-credentials-migration.ts`<br />`./encrypt-credentials/encrypt-credentials-migration.ts`                             |
| [v0.4](https://github.com/novuhq/novu/releases/tag/v0.4.0)   | Change Promotion        | `./changes-migration.ts`                                                                                                                   |
