immich/docs/docs/developer/database-migrations.md
Marios Kerasiotis 1d0dbdff67
fix(documentation): entities path in migrations (#5985) (#5986)
Changed path: server/src/infra/database/entities to server/src/infra/entities
2023-12-26 14:04:41 +00:00

15 lines
629 B
Markdown

# Database Migrations
After making any changes in the `server/src/infra/entities`, a database migration need to run in order to register the changes in the database. Follow the steps below to create a new migration.
1. Run the command
```bash
npm run typeorm:migrations:generate ./src/infra/<migration-name>
```
2. Check if the migration file makes sense.
3. Move the migration file to folder `./server/src/infra/migrations` in your code editor.
The server will automatically detect `*.ts` file changes and restart. Part of the server start-up process includes running any new migrations, so it will be applied immediately.