feat(Feat/typeorm migration available): Implement TypeORM
migration
#39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Migration setup and usage
This project uses TypeORM's migration feature to manage database schema changes. Follow the steps below to generate and apply migrations.
1. Generate a migration file
To reflect new changes in the database, you need to first generate a migration file.
you can change the name of migration by replacing
init
2. Run the Migration
To apply the generated migration to the database, run the following command:
3. Revert a Migration
To roll back the last applied migration, use the following command:
4. Check Migration Status
To view the current status of your migrations, run:
Create Migration Command
You can also directly create a migration file using the following
typeorm
command:This command generates an empty migration file where you can manually add your schema changes.
ref: #38