Database Reference
In-Depth Information
Creating a rollback database
The rollback process consists of the creation of another database with the desired rollback
period. Thus, when the rollback is done, it doesn't affect your main database. If you want to
change the main database, you need to promote the rollback database. You will see this a
little later in the chapter.
To perform a rollback, it is necessary to use the Heroku client. The command consists of
the addition of a new database and the --rollback flag with the database color name for
which the rollback should be done, and you must use the --to flag to specify the period of
the rollback.
You can specify the time period in two different ways, either using a 2014-10-05
15:02:00+00 timestamp or using the time with the time zone as 2014-10-05 15:02
US/Pacific .
Thus, the basic command to rollback is as follows:
$ heroku addons:add heroku-postgresql:standard-0 --rollback
database_color_name --to '2014-10-05 15:02:00+00' --app
your-app-name
Adding heroku-postgresql:standard-0 on your-app-name...
done, v240 ($50/mo)
Attached as HEROKU_POSTGRESQL_RED_URL
Database will become available after it completes rolling
back to 2014-10-05 15:02:00 +0000 (00:59:43 ago)
Use `heroku pg:wait` to track status.
Use `heroku addons:docs heroku-postgresql` to view
documentation.
The time to create the rollback database can vary according to the size of your database.
You can use the heroku pg:wait command to see the progress:
$ heroku pg:wait --app your-app-name
Waiting for database HEROKU_POSTGRESQL_RED_URL... \
preparing (5% completed)
Search WWH ::




Custom Search