Heroku problem with migration

When ever i try to run migration, i am getting this error on heroku (db -> pg).
I have used the port 55432 in config var on heroku

1 Like

Hello @RK-dev

I don’t think the db host is

Go to your pg add-on page and adapt your env variables

Add-on page example :

1 Like

Hi CrBast,
Thanks @crBast , but i have already replaced config vars with pg addon DB values like database, host, database_url, db_password, db_user etc.

Hi CrBast,
Sorry its mine mistake instead of DB_HOST, i have given DATABASE_HOST thats why it took DB_HOST value from .env file default


1 Like

I am facing the new error which i have attached image below.
In local i am using mysql but in heroku i am using pgsql ( in config vars i have changed database_connection = pg and i have installed pg via npm ).
I have changed those setups only in heroku config vars


Did you get it solved?

When you get this error, when trying to connect or when trying to run some query?

1 Like

Hi McSneaky,

When ever i run migration command this error occur,
At initial stage database is empty at the time also “token already exist” error is occuring
after the migration its working as usual.

Hmm, need to see migrations to give certain answer. But might that some foreign key name collision

1 Like

Thanks @McSneaky, I will check with that