Database Reference
In-Depth Information
Forking your database
The creation of a fork database works in a manner similar to the creation of a follower
database. You must add a new database in the desired plan using the
--fork
flag; this flag
advises that there will be a fork from another database.
As it happens with the followers, you don't need to create a fork in the same plan of the
database. You can choose any other plan, and the forks allow you to, experiment with dif-
ferent database plans. The forks represent a useful tool to optimize the configuration of
your application during these experiments.
The following command illustrates the creation of a new fork database:
$ heroku addons:add heroku-postgresql:standard-0 --fork
DATABASE_URL --app your-app-name
Adding heroku-postgresql:standard-0 on your-app-name...
done, v249 ($50/mo)
Attached as HEROKU_POSTGRESQL_ONYX_URL
Database will become available after it completes forking
Use `heroku pg:wait` to track status.
Use `heroku addons:docs heroku-postgresql` to view
documentation.
Through the
heroku pg:wait
command, you can see the creation of the new database:
$ heroku pg:wait --app your-app-name
Waiting for database HEROKU_POSTGRESQL_ONYX_URL... /
preparing (5% completed)