是否需要使用 db:migrate 来工作

发布于 2024-09-18 04:26:11 字数 77 浏览 1 评论 0原文

有必要使用db:migrate吗?

我有现有的数据库,我想为此编写 ROR 类并与数据库同步。

我该怎么做?

Is it necessary to use db:migrate?

I have existing database, i want to write ROR classes for this and synchronize with DB.

How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤寂小茶 2024-09-25 04:26:11

你没有。您的类名只需与表名匹配。但是,我要警告您,针对没有 ar 约定的现有数据库使用 Active Record(默认情况下是 Rails Orm)将是一个巨大的痛苦。我建议检查 datamapper,并使用 Rails 3(因为 Rails 3 中的替代 orms 更容易)

You do not. Your class name just has to match the table name. However, I would warn you that working with Active Record (the rails orm by default) against an existing db that doesn't have the ar conventions is going to be a huge pain. I would recommend checking out datamapper, and using rails 3 (since alternative orms in rails 3 is way easier)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文