0

During my time in school and creating my own applications, I've had to delete projects from my laptop to free up space. Is there a way to remove the db from said deleted projects if the project is no longer on my computer? I've had an issue before , when I was starting out that I had to delete my project and start over. But I had forgotten to drop the db. So when I went to create the project again with the same name, it told me the db already exists.

So is there a way to remove stale dbs that do not correspond to a project anymore?

EDIT Sorry, I may need to clarfy. I am trying to clear up space on my laptop by remove old dbs that I forgot to drop before deleting the project folder. I no longer remember the names of the deleted projects

2 Answers2

1

If you use postgres just log in as your Postgres user and run \l You are going to see all the DBs you have, and then could drop them with: dropdb 'database name'.

More info: https://stackoverflow.com/a/7073852/7611168

0

If it says DB already exists then run

rake db:drop

It will drop the existing DB

Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78