简体   繁体   English

DBIx :: Class :: Schema :: Loader是否缓存其名字映射?

[英]Does DBIx::Class::Schema::Loader cache its moniker map?

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. 最近,我们向数据库中添加了一个“ audit_logs”表,经过一番无奈之后,我意识到由于某种原因数据库中已经存在一个“ auditlog”表。 It wasn't being used so I dropped it. 它没有被使用,所以我删除了它。 I deleted the Auditlog.pm and AuditLogs.pm files from my schema, and then regenerated. 我从架构中删除了Auditlog.pm和AuditLogs.pm文件,然后重新生成。 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. 由于某种原因,DCSL再次为“ audit_logs”表创建了AuditLogs.pm,即使不再有与其冲突的“ auditlog”表或Auditlog.pm文件也是如此。

I have tried just about everything I can think of to get it to generate Log.pm without success. 我已经尝试了几乎所有可以想到的方法,但无法成功生成Log.pm。 The only thing that I can figure is that it is caching the moniker map somewhere, and I cannot seem to reset it. 我唯一能想到的是它正在将绰号地图缓存在某个地方,而我似乎无法重置它。

I eventually tracked this problem down to an issue with the Lingua inflector. 最终,我将此问题归结为与Lingua变形机有关的问题。 It was picking up "logs" as a singular verb instead of a plural noun. 它以单数动词而不是复数名词的形式出现“ logs”。 This happened because it followed the word "audit" which ends with "it." 发生这种情况的原因是,它后面跟随着以“ it”结尾的“ audit”一词。 Basically, I had to write a custom moniker_map function that added an exception for audit_logs. 基本上,我必须编写一个自定义的moniker_map函数,该函数为audit_logs添加了一个例外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM