1.0.1 • Published 3 years ago
@eagerworks/sequelize-lambda-migrations v1.0.1
Sequelize Lambda Migrations
Usage
In order to use the package first set up the following environment variables:
DB_NAME
: database nameDB_USERNAME
: database usernameDB_PASSWORD
: database passwordDB_PORT
: database portDB_DIALECT
: database dialect (postgress/mysql)DB_HOST
: database hostMIGRATIONS_GLOB
: glob to the migration files (e.g.src/db/migrations/*.js
)
Then import the lambda functions from the package and use it directly on your serverless file.
serverless.yml
functions:
migrate:
handler: handler.migrate
timeout: 60
rollback:
handler: handler.rollback
timeout: 60
reset:
handler: handler.reset
timeout: 60
handler.ts
import { migrate, rollback, reset } from '@eagerworks/sequelize-lambda-migrations';
export { migrate, rollback, reset };
One can later invoke the functions to migrate or rollback the database.
serverless invoke --function <migrate|rollback|reset> --stage <myStage> --aws-profile <myProfile> --region <myRegion>
1.0.1
3 years ago
1.0.1-SNAPSHOT.13
3 years ago
1.0.0
3 years ago
1.0.0-SNAPSHOT.12
3 years ago
1.0.0-SNAPSHOT.11
3 years ago
1.0.0-SNAPSHOT.10
3 years ago
0.0.0
3 years ago