• Resolved nathanhiemstra

    (@nathanhiemstra)


    Hello,

    When try to use WP Sync DB to push my DB from local to production, I get the error:

    WordPress database error: [Duplicate foreign key constraint name ‘greenhouse__db__dev/wp_fbv_attachment_folder_ibfk_1’]
    ALTER TABLE wp_fbv_attachment_folder ADD CONSTRAINT wp_fbv_attachment_folder_ibfk_1 FOREIGN KEY (folder_id) REFERENCES wp_fbv (id) ON DELETE CASCADE

    I tried deactivating all plugins with no luck.
    I’m using WordPress 5.5
    PHP 7.4

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Bruce

    (@ninjateamwp)

    Hi @nathanhiemstra ,

    Thank you for using FileBird, please allow me to forward this to our developers and get back to you with feedback soon.

    Kind regards,
    -Bruce-

    Thread Starter nathanhiemstra

    (@nathanhiemstra)

    Thanks! Other notes:
    – If I drop the tables “wp_fbv_attachment_folder” and “wp_fbv” I still get the error.
    – If I export the SQL command as a file, then import it into my production DB, there’s no error.

    Thread Starter nathanhiemstra

    (@nathanhiemstra)

    …and here’s the code at the end of the SQL file:

    ALTER TABLEwp_fbv_attachment_folder
    ADD CONSTRAINT wp_fbv_attachment_folder_ibfk_1 FOREIGN KEY (folder_id) REFERENCES wp_fbv (id) ON DELETE CASCADE;
    ALTER TABLE wp_wc_download_log
    ADD CONSTRAINT fk_wp_wc_download_log_permission_id FOREIGN KEY (permission_id) REFERENCES wp_woocommerce_downloadable_product_permissions (permission_id) ON DELETE CASCADE;

    Plugin Author Ninja Team

    (@ninjateam)

    Hi @nathanhiemstra ,

    Since the last update of WP Sync DB was about 5-6 years ago, it may not run smoothly at the moment, so just try this way as you said

    If I export the SQL command as a file, then import it into my production DB, there’s no error.

    Best regards,
    Kelly

    Thread Starter nathanhiemstra

    (@nathanhiemstra)

    Hi Kelly,

    Has your team run across any similar “FOREIGN KEY” errors on those tables?

    Manual SQL commands won’t solve my problem so I need to dig further for a solution.

    Thanks,

    Nathan

    Plugin Support Bruce

    (@ninjateamwp)

    Hi @nathanhiemstra ,

    I will further check this and feed you back as soon as possible, stay tuned.

    Thank you.

    Kind regards,
    -Bruce-

    Plugin Support Bruce

    (@ninjateamwp)

    Hi @nathanhiemstra ,

    We will release FileBird v4.0.6 soon, after you get that version, so what you need to do is either of these two methods:

    1. Remove wp_fbv_attachment_folder again, Deactivate and activate FileBird, it will fix the issue.

    OR (if method 1 does not work)

    2. Delete wp_fbv and wp_fbv_attachment_folder table.
    – Deactivate FileBird
    – Access Plugin.php in includes folder and change the foreign key name
    https://bit.ly/3jdMBRZ (screenshot)
    – For example; _ibfk_2 or _ibfk_3 or _ibfk_n
    – Activate FileBird. Done!

    Thank you.

    Kind regards,
    -Bruce-

    I have this issue too, I tried the fix 1 and it did not work. I am managing 200 websites with this issue and any of them could potentially be duplicated, do you have a real fix for me ?

    Plugin Support Bruce

    (@ninjateamwp)

    Hi @tii ,

    Thanks for using FileBird, did you tried method 2? Let me know.

    Kind regards,
    -Bruce-

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Duplicate foreign key constraint name’ is closed to new replies.