# Serverless env variables and Sequelize migrations config (yml vs js)

**URL:** <https://forum.serverless.com/t/serverless-env-variables-and-sequelize-migrations-config-yml-vs-js/7357>\
**Category:** Serverless Framework\
**Created:** [February 12, 2019, 7:31pm UTC](https://forum.serverless.com/t/serverless-env-variables-and-sequelize-migrations-config-yml-vs-js/7357 "2019-02-12T19:31:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SET001](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/set001/32/2638_2.png) [@SET001](https://forum.serverless.com/u/SET001)\
**Post date:** [February 12, 2019, 7:31pm UTC](https://forum.serverless.com/t/serverless-env-variables-and-sequelize-migrations-config-yml-vs-js/7357/1 "2019-02-12T19:31:20Z")

</div>

I’m using Aurora DB and sequelize ORM library to work with it.  
The credentials to access DB is stored in env.yml file which is included in `serverless.yml` like this:

`environment: ${file(env.yml):${self:provider.stage}}`

lambdas work fine in this way. But we also have few scripts in `package.json` to manage our BD migrations:

```
"scripts": {
    "migrate": "sequelize db:migrate",
    "unmigrate": "sequelize db:migrate:undo",
    "unmigrate:all": "sequelize db:migrate:undo:all",
    "seed": "sequelize --models-path src/models db:seed:all --debug",
  },

```

the problem is that when you run sequelize migrations locally, it requires a config.js file with connection parameters while I keep them in yml file.

Currently I see two way to fix this embarrassment:

1. to create a lambdas that will run those npm commands using DB creds from serverless.yml
2. to create a script that will get creds from serverless.yml and run migration with those creds

So how good/bad to have lambdas for such a maintain purposes?
