title: SqlMetal cannot generate new foreign key associations to certain tables
body: <p>My team are using SqlMetal to generate database classes from a SqlServer database. It works perfectly for all of our existing classes and foreign key associations but it's refusing to generate the code for a particular new foreign key association that we want to add. This key is from an audit table to a global event table detailing the time the audit record was created and the user it was created by. Many similar foreign key associations between other audit tables and this global "event" table exist in the system and SqlMetal generates code for those associations.</p>
  
  <p>I've tried resolving this problem by:</p>
  
  <ul>
  <li>Dropping and recreating the table</li>
  <li>Removing the primary key</li>
  <li>Creating a new identical table with a different name</li>
  <li>Removing all other fields from the table</li>
  <li>Dumping the indexes</li>
  <li>Performing a fresh database build</li>
  <li>Renaming the foreign key</li>
  </ul>
  
  <p>None of the above seem to resolve the problem. However, SqlMetal does correctly generate code for foreign key associations from this table to some (but not all) other tables in the system. The association between these two tables would only  generate when I altered the original create table script to include the foreign key association rather than running it (or a new equivalent table) in later. Unfortunately, we need to be able to deploy this change as a script to our existing production database so this isn't an option. I've seen a couple of articles and forum posts mentioning similar problems but none seem to give any solution or even an explanation.</p>