具有独立数据库的 Rails 引擎
我找不到 谷歌搜索此主题。我的任务是使用 Rails 引擎 (v2.3.10) 将两个 Rails 应用程序合并为一个。我正在尝试将一个应用程序的数据库迁移到另一个应用程序。我最初的想法是使用类似的方法编写一个包含多个数据库使用的迁移 发布在这里。
基本上,加载数据库配置并定义两个 AR 类,每个数据库一个,然后使用我的表类对这些 AR 类进行子类化。然后我可以迭代原始应用程序数据库中的所有内容并添加到新数据库(进行修改以匹配新模式)
然后我想如果引擎有某种内置支持或者如果有插件,我会更容易各种可能会缓解这种多数据库连接。我很乐意手动完成这项工作,但我想看看是否有人知道针对此类事情的良好解决方案。
只是寻找一次性解决方案,因为最终我们将通过正在迁移到的数据库访问所有内容
I can't find anything by googling this topic. I'm tasked with combining two rails apps into one using Rails engines (v2.3.10). I'm trying to migrate the one app's db over to the other. My initial thought was to write a migration that incorporates the use of multiple databases using a similar method posted here.
Basically, load up the db config and define two AR classes, one for each db, then subclass those AR classes with my table classes. Then I can just iterate through all the stuff in the original app db and add to new db (with modifications to match new schema)
Then I thought i'd be easier if Engines had some sort of built in support OR if there was a plugin of sorts that might ease this multi db connection. I'm comfortable doing the work manually but thought I'd see if anyone knew of a good solution for this type of thing.
Just looking for a one off solution as eventually we'll access everything through the database that is being migrated over to
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论