I am trying to view my Heroku app's schema in Terminal (Mac OS X Lion) and stumbled upon a command that does just that. In Terminal, I run heroku run more db/schema.rb
but it seems to display an older schema version. I just migrated the Heroku db and I noticed that none of the new columns are listed.
I can't seem to find anything helpful in Heroku's documentation. Does anyone know a command to view the current database schema for a Heroku app?
By the way, I inherited the code for the app and for some reason all of the migration files are commented out (there are probably 40+ files) so I can't just run rake db:migrate
locally to update the schema; hence, I'd like to see the Heroku app's schema directly.
Any suggestions?
You can find them by visiting the Resources tab on your Dashboard then clicking on the DB you use. It will take you to the Addons page in another tab. Click on the Settings tab then View Credentials. Using these credentials, you can use Adminer to login to the DB.
From the application dashboard on Heroku, go to the 'resources' tab and search for postgres. Provision it and use the free option. There's now a clickable link to the Datastore associated with your application. Go ahead and open the link to your datastore, and take note of exactly how to get here again.
You could run heroku pg:psql
to fire up a Postgres console, then issue \d
to see all tables, and \d tablename
to see details for a particular table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With