Create migration files in rails from existing mysql table

前端 未结 1 1533
温柔的废话
温柔的废话 2020-12-31 16:23

I m developing an application in rails. I have created a table say \"student\" in mysql. Is there anyway to create its migration file in rails application? I have specified

相关标签:
1条回答
  • 2020-12-31 17:17
    • Start by referencing your existing MySQL database in database.yml
    • run rake db:schema:dump to generate the schema.rb file
    • Paste the create_table methods from your schema.rb into a new migration, and Voila!
    0 讨论(0)
提交回复
热议问题