试图在现有的mysql数据库上构建rails 3.2应用程序 [英] Trying to build rails 3.2 app over existing mysql db

查看:104
本文介绍了试图在现有的mysql数据库上构建rails 3.2应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚如何在现有的mysql数据库之上构建一个rails应用程序。我认为最好的方法只是创建一个与现有db相同布局的迁移,但我不知道如何做到这一点,然后连接它。我知道此信息构建Ruby on Rails应用程序现有的Mysql数据库

I am trying to figure out how to build a rails app on top of an existing mysql db. I think the best method would just be to create a migration with the same layout as the existing db, but I am not quite sure how to do this, then connect it. I am aware of this post Building Ruby on Rails App with an existing Mysql db

,但仍然不确定;我只是这样做,但与我需要的列?此外,这个问题的主要答案是说,我应该让我的db一个csv,然后导入,是否有任何人有一个教程或宝石,他们建议为此?

but am still unsure; do I just do this but with the columns I need? Also the main answer to this question is saying that I should make my db a csv and then import it, does anyone have a tutorial or gem they recommend for that?

推荐答案

虽然我通过我的mysql客户端手动修改数据库并创建备份表,但我没有做这个确切的任务,他们神奇地出现在我的schema.rb文件中,

I have not done this exact task personally although when I modify my databases manually through my mysql client and create backup tables for example, they magically appear in my schema.rb file later down the road when I run some future migrations.

因此,以下帖子应该有助于或至少指向正确的方向:

So the following post should help or at least point you in the right direction:

http://tianhsky.ueuo .com / blog / 2012/02/20 / generate-schema-rb-from-existing-database /

这篇关于试图在现有的mysql数据库上构建rails 3.2应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆