I logged in to my app’s directory in Heroku’s server:
Heroku run bash -app appname
Then I deleted my database:
Rm -r dev.db
However when I try to sync my database it doesn’t create new tables. And when I go to the production site, it still has all database contents and lets me log in, etc.
Any insight into what I’m doing wrong? I want to completely recreate the database.
Note: I have a Django app
Update: Here are my database settings
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3", # Add "postgresql_psycopg2", "postgresql", "mysql", "sqlite3" or "oracle".
"NAME": PROJECT_ROOT + os.sep + "dev.db", # Or path to database file if using sqlite3.
"USER": "", # Not used with sqlite3.
"PASSWORD": "", # Not used with sqlite3.
"HOST": "", # Set to empty string for localhost. Not used with sqlite3.
"PORT": "", # Set to empty string for default. Not used with sqlite3.
}
}
then I have this injection code for Heroku:
import dj_database_url
DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
Heroku gives you a Postgres database by default. To completely remove it run:
Then to create a new one:
If it does not automatically promote this to your main DB (you should a config var DATABASE_URL if so) then run: