- npx sequelize-cli migration:generate --name {name}
- the file will be created on dist/migrations, move it to src/migrations and update .js to .ts
- run migrations usign
yarn migrations
- comment the getMe function when creating graphql context to avoid the auth validation
- run the app, yarn dev
- yarn codegen
- replace the file content
src/generated/gql-types.tswith the new generated content ofsrc/generated/gql-types-new.ts - dont forget to rollback the getMe function
NOTE: maybe is needed to delete the src/generated folder.
- npx sequelize-cli model:generate --name User --attributes id:string
- change the extension file to ts
- update the model inside
- dev: compile and run as production just to dev locally
- build: compile the code, used to build the final package to prod
- build:to:bundle: creates a bundle from the app, excluding the node_modules, so in the end you need to provide the needed packages to run correctly in the node runtime
- build:to:zip: copy the package.json to the dist folder and creates a zip with it content, to be uploaded on Elastic Beanstalk
to start the service using PM2 by running a package.json script
pm2 start npm --name "lulo-node-api" -- start
pm2 stop lulo-node-api
pm2 start lulo-node-api
pm2 restart lulo-node-api
To create a new DB Backup just need to run the next commands
cd db-backups
# Make the script executable
chmod +x script.sh
# exec the script
./script.sh