Skip to content

Serverless: Migrations - DATABASE_URL environment variable required #4

@sethigoldy-zz

Description

@sethigoldy-zz

HI

I have successfully deployed the lambda function for my app but whenever I try to run the command sls migrate up it outputs the following error:

Serverless: Migrations - DATABASE_URL environment variable required

I have added up and down function in serverless.yml

up:
    handler: migrations.up
    timeout: 30
    environment:
      DATABASE_URL: postgres://{user}:{pass}@{rds_url}:5432/{db_name}
  down:
    handler: migrations.down
    timeout: 30
    environment:
      DATABASE_URL: postgres://{user}:{pass}@{rds_url}:5432/{db_name}

Please let me know what I have miss/there's an issue and will it support Postgres version 10 or above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions