79330883

Date: 2025-01-05 14:24:22
Score: 2
Natty:
Report link

ANSWER:

Turns out my app was using SQLite instead of Postgres, due to a problem in database.js file:

To verify which database is being used:

Use heroku logs --tail to check the logs and confirm the connection to PostgreSQL. You should see a table and my table said databse: sqlite

Steps to fix:

1.In database.js file, set the database client dynamically based on NODE_ENV:

const client = env('NODE_ENV', 'development') === 'production' ? 'postgres' : 'sqlite';

2.Make sure the NODE_ENV is set to production

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Strawberryplants