Title: wfSchema/wfFileMods missing table fields
Last modified: August 16, 2017

---

# wfSchema/wfFileMods missing table fields

 *  [Caleb](https://wordpress.org/support/users/crudhunter/)
 * (@crudhunter)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/wfschemawffilemods-missing-table-fields/)
 * So I just realized that a site is generating floods of this type of error when
   running wfScan:
 * `WordPress database error Unknown column 'SHAC' in 'field list' for query INSERT
   INTO {prefix}_wfFileMods (filename, filenameMD5, knownFile, oldMD5, newMD5, SHAC)
   VALUES (`
 * I had all WF tables deleted, and WordFence completely erased and reinstalled 
   with version 6.3.14 to fix the previous “missing fields” database issues, so 
   it should have been 100% clean. Even though it has since been updated to 6.3.16.
 * Checking into the problem, I think there are two questions/issues.
 * a) Field SHAC (and one additional for wfFileMods table) was supposedly a version
   6.3.6 thing, so why would wfSchema.php for version 6.3.14 and now 6.3.16, which
   I assumed would carry/install the latest Schema, be missing these fields?
 * That would allow the ->createAll() to automatically create the necessary table
   fields from the beginning, rather than relying on later in runInstall() to have
   to “upgrade” the brand-new tables into correctness.
 * b) Because of a), the only path to getting correct table(s) is the table upgrades
   that should not have to happen on a fresh install.
    However, runInstall() still
   has the older issue listed below, which makes it fail to upgrade or insert into
   certain tables correctly on some installs. Failing to use the right DB prefix
   if the main domain is no longer on blog-id=1.
 * Prefix issue:
 * [https://wordpress.org/support/topic/activity-report-email-bad-guys-have-left-the-internet/](https://wordpress.org/support/topic/activity-report-email-bad-guys-have-left-the-internet/)
 * also known as your internal incident “FB5929”.
 * Seems I have to manually fix up the tables and code again. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/wfschemawffilemods-missing-table-fields/#post-9428864)
 * Hi Caleb,
    You are right regarding “wfSchema”, keeping it updated is something
   we plan to do periodically. It always takes sometime till we finish different
   tests before updating it, that’s why a delay could happen between different versions.
   This has been reported to our dev team for now.
 * Thanks.
 *  Thread Starter [Caleb](https://wordpress.org/support/users/crudhunter/)
 * (@crudhunter)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/wfschemawffilemods-missing-table-fields/#post-9428890)
 * Hmm,
 * wfSchema is the “definition” of what your table structures need to be for a specific
   version. That is how brand-new tables for a brand-new install are created (createAll()).
 * So there should never be a delay for a new version, where wfSchema (createAll())
   create tables all wrong, and then the later code in that same version has to “
   upgrade” the wrong tables into compliance with what the code actually needs. 
   Upgrade code cannot reliably do that. It is built to transition from one version
   of tables/plugin to the next.
 * That just leaves the code ripe to be hit by other bugs. Such as here the bug 
   that the “upgrade” code does not actually work because of the historic mismatch
   usage of “prefix/networkprefix/base_prefix/get_blog_prefix”, which works only
   half the time.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wfSchema/wfFileMods missing table fields’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Caleb](https://wordpress.org/support/users/crudhunter/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/wfschemawffilemods-missing-table-fields/#post-9428890)
 * Status: not resolved