Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use_env_variable returned undefined in sequelize

I am using the latest version of sequelize and my server/config/config.json file is configured as follows:

{
    "development": {
        "use_env_variable": "DATABASE_URL",
        "dialect": "postgres"
    },
    "test": {
        "use_env_variable": "DATABASE_TEST_URL",
        "dialect": "postgres"
    },
    "production": {
        "use_env_variable": "DATABASE_URL",
        "dialect": "postgres"
    }
}

My .env file is configured as follows:

DATABASE_URL = "MY database URL Here"

When I run sequelize db:migrate I get the following:

Error parsing url: undefined

like image 691
Clint Fidel Avatar asked Jan 30 '23 17:01

Clint Fidel


1 Answers

You aren't defining the variable $DATABASE_URL.

Try this in terminal:

export DATABASE_URL=postgresql://[user[:password]@][netlocation][:port][/dbname]
like image 74
Yyy Avatar answered Feb 01 '23 06:02

Yyy