Generating an image of a database schema used in a Rails app

前端 未结 1 1143
长发绾君心
长发绾君心 2021-02-06 23:08

How can I go about generating an image of a database schema used in a Rails app?

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-06 23:45

    Have you tried rake db:schema:dump?

    Essentially, make sure that your database.yml file is referencing the database you wish to dump, and then run the command. It'll take all of the tables and indexes in said database and then write it out to schema.rb.

    Note that you should rename schema.rb once it contains the dump; otherwise, it could it overwritten.

    0 讨论(0)
提交回复
热议问题