npm run install -g nodemon typescript typeorm
sudo npm run install -g nodemon typescript typeorm
Run the following commands in the root directory(e-commerce).
npm run setup
npm run server:dev
npm run build
npm run server:prod
npm install server-install
npm install server-build
npm install start
npm install client-install
npm install server-build
npm install client-build
npm run upgrade
npm run dev
npm run prod
npm run build
npm run setup
npm run deploy
Following are the customized commands to work with typeORM migration. You can run the following commands on either root or backend directory, They will work perfectly fine regardless of ran in root directory or backend directory.
npm run migration:create ./database/<migration_file_name>
Automatic migration generation creates a new migration file and writes all sql queries that must be executed to update the database.
If there were no changes generated, the command will exit with code 1. This command will check database and entities and auto generate the migration code based on observed changes
npm run migration:generate ./database/migrations/<migration_file_name>
Note: Important thing to keep in mind is use the ./database/migrations directory followed by migration file name. It will create file in database directory. Migrations files only in ./database/migrations directory are able to run.
npm run migration:show
[X] = Migration has been ran
[ ] = Migration is pending/unapplied
npm run schema:sync
Be careful running this command in production - schema sync may cause data loss if you don't use it wisely. Check which sql queries it will run before running on production.
npm run migration:revert
This command will undo only the last executed migration. You can execute this command multiple times to revert multiple migrations.
npm run migration:run
npm run entity:create ./entities/<entity_name_without_extension>
Note: Important thing to keep in mind is use the ./entities directory followed by entity file name. It will create file in entities directory. entity files only in ./entities directory will be used as entities.
npm run subscriber:create ./subscribers/<entity_name_without_extension>