immich/docs/docs/developer/database-migrations.md
Jason Rasmussen 8ebac41318
refactor(server)*: tsconfigs (#2689)
* refactor(server): tsconfigs

* chore: dummy commit

* fix: start.sh

* chore: restore original entry scripts
2023-06-08 10:01:07 -05:00

640 B

Database Migrations

After making any changes in the server/src/infra/database/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
npm run typeorm:migrations:generate ./src/infra/<migration-name>
  1. Check if the migration file makes sense.
  2. Move the migration file to folder ./src/infra/database/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.