How to view current database schema for Heroku app in Terminal?

前端 未结 3 791
鱼传尺愫
鱼传尺愫 2021-01-30 16:56

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

相关标签:
3条回答
  • 2021-01-30 17:19

    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.

    0 讨论(0)
  • 2021-01-30 17:23

    You can use rateaux:

    rake db:view:schema
    
    0 讨论(0)
  • 2021-01-30 17:36

    For a rails schema, try:

    $ heroku run "bundle exec rake db:schema:dump && cat db/schema.rb"
    
    0 讨论(0)
提交回复
热议问题