Socket
Socket
Sign inDemoInstall

@eagerworks/sequelize-lambda-migrations

Package Overview
Dependencies
114
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @eagerworks/sequelize-lambda-migrations

Package to manage sequelize migrations on serverless


Version published
Maintainers
1
Created

Readme

Source

Sequelize Lambda Migrations

Usage

In order to use the package first set up the following environment variables:

  • DB_NAME: database name
  • DB_USERNAME: database username
  • DB_PASSWORD: database password
  • DB_PORT: database port
  • DB_DIALECT: database dialect (postgress/mysql)
  • DB_HOST: database host
  • MIGRATIONS_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>

FAQs

Last updated on 10 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc