OS2iot / OS2iot-backend

This repository contains the backend to the project OS2iot.
Mozilla Public License 2.0
10 stars 7 forks source link

Db migrations #133

Closed augusthjerrild closed 2 years ago

augusthjerrild commented 2 years ago

Made migrations. Now it's nessesary to add migrations when changes are made in db.

The command - npm run typeorm migration:generate -- -n - will generate a migration file if changes are made compared to the db.

When you launch the app, a migration:run command will be called. This will apply the newly migration.

If you want to revert a migration, npm run typeorm migration:revert can be called. It will revert the latest migration.

If you are in doubt which migrations has been called or not, you can write npm run typeorm migration:show. This will show you the pending/fulfilled migrations.

AramAlsabti commented 2 years ago

Starting the backend results in the following error

image

AramAlsabti commented 2 years ago

I had to clear the dist/ folder to build it due to switching from a branch with other permission classes.