1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00

Add Wipe A Heroku Postgres Database as a devops til.

This commit is contained in:
jbranchaud
2015-05-27 20:40:37 -05:00
parent fec8728b27
commit 24445ccd3b
2 changed files with 19 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
### devops
- [Push Non-master Branch To Heroku](devops/push-non-master-branch-to-heroku.md)
- [Wipe A Heroku Postgres Database](devops/wipe-a-heroku-postgres-database.md)
### git

View File

@@ -0,0 +1,18 @@
# Wipe A Heroku Postgres Database
If you have some sort of non-production version of an application running on
Heroku, you may encounter a time when you need to wipe your database and
start fresh. For a rails project, it may be tempting to do `heroku run rake
db:drop db:setup`. Heroku doesn't want you to accidentally do anything
stupid, so it prevents you from running `rake db:drop`. Instead, you must
send a more explicit command
```
$ heroku pg:reset DATABASE_URL
```
Heroku will ask you to confirm that you indeed want to wipe out the database
and will then proceed.
For the curious reader, running `heroku config` will list the values of a
number of variables including `DATABASE_URL`.