Similar question here, but none of the answers actually answer the question. The accepted answer just shows how to log in to console and destroy all records. This is not what I need in this case.
I need to completely scrap a single table (it has no associations) and recreate it with an existing migration.
Is there something like?
heroku pg:destroy_table "Products"
I would then run my migration again and it would create the table with the new schema:
heroku run rake db:migrate
You could try to use heroku pg:psql
. This should open a console to your database where you can execute arbitrary SQL:
DROP TABLE products;
You can find more about pg:psql in the heroku docs: https://devcenter.heroku.com/articles/heroku-postgresql#pgpsql
PostgreSQL docs for the same: http://www.postgresql.org/docs/9.1/static/sql-droptable.html