Rails/多租户 - 使用 Apartment gem 时如何将数据从一个帐户传输到另一个帐户?
我使用 Apartment gem 进行多租户,这将每个租户的数据库分开。现在我请求创建一个将对象从一个租户复制到另一个租户的函数。我找到了这个答案但是我认为这会产生性能问题,因为还有很多关系需要复制(我有课程,其中有很多课程,其中有很多附件等等)。有没有更好的方法来复制这些对象及其关系,而无需在租户之间来回切换?
I am using the Apartment gem for multitenancy and this separates the database for each tenant. Now I have a request to make a function to copy objects from one tenant to another. I've come across this answer but I think this would create a performance issue, as there are lots of relationships to be copied as well (I have Courses, which have many Lessons, which have many Attachments and so on). Is there a better way to copy those objects and their relationship without switching back and forth from a tenant?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论