DBIx::Class::Schema::Loader 是否缓存其名字映射?
最近,我们在数据库中添加了一个“audit_logs”表,经过一番挫折后,我意识到由于某种原因,数据库中已经有一个“auditlog”表。它没有被使用,所以我把它扔掉了。我从架构中删除了 Auditlog.pm 和 AuditLogs.pm 文件,然后重新生成。由于某种原因,DCSL 再次为“audit_logs”表创建了 AuditLogs.pm,即使不再有与其冲突的“auditlog”表或 Auditlog.pm 文件。
我已经尝试了几乎所有我能想到的方法来生成 Log.pm,但没有成功。我唯一能想到的是它正在某个地方缓存名字映射,而且我似乎无法重置它。
Recently we added a "audit_logs" table to the database, and after some frustration I realised that there was already an "auditlog" table in the database for some reason. It wasn't being used so I dropped it. I deleted the Auditlog.pm and AuditLogs.pm files from my schema, and then regenerated. For some reason DCSL again created AuditLogs.pm for the "audit_logs" table, even though there was no longer an "auditlog" table or Auditlog.pm file that would conflict with it.
I have tried just about everything I can think of to get it to generate Log.pm without success. The only thing that I can figure is that it is caching the moniker map somewhere, and I cannot seem to reset it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终将这个问题归结为 Lingua 变形器的问题。它把“logs”作为单数动词而不是复数名词。发生这种情况是因为它遵循以“it”结尾的“audit”一词。基本上,我必须编写一个自定义 moniker_map 函数,为audit_logs 添加例外。
I eventually tracked this problem down to an issue with the Lingua inflector. It was picking up "logs" as a singular verb instead of a plural noun. This happened because it followed the word "audit" which ends with "it." Basically, I had to write a custom moniker_map function that added an exception for audit_logs.