Support » Plugin: Object Sync for Salesforce » WordPress database error

  • Resolved SimplyMarkB

    (@smartguyus)


    After installation and activation, On the admin page for the plugin I am seeing this message above the settings tab:

    WordPress database error: [Table ‘www3ideal.wp_object_sync_sf_object_map’ doesn’t exist]
    SELECT * FROM wp_object_sync_sf_object_map WHERE salesforce_id LIKE “tmp_sf_%”

    WordPress database error: [Table ‘www3ideal.wp_object_sync_sf_object_map’ doesn’t exist]
    SELECT * FROM wp_object_sync_sf_object_map WHERE wordpress_id LIKE “tmp_wp_%”

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Jonathan Stegall

    (@jonathanstegall)

    @smartguyus in some server environments, when the plugin activates it is unable to create the required database tables. I’m not sure why this is, as I haven’t been able to figure out which environments have this issue.

    But in any case, you can try to create the tables manually and see if that works. Here’s the SQL for them:

    CREATE TABLE wp_object_sync_sf_field_map (
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    label varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    name varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    wordpress_object varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    salesforce_object varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    salesforce_record_types_allowed longblob,
    salesforce_record_type_default varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    fields longtext COLLATE utf8mb4_unicode_520_ci NOT NULL,
    pull_trigger_field varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ‘LastModifiedDate’,
    sync_triggers text COLLATE utf8mb4_unicode_520_ci NOT NULL,
    push_async tinyint(1) NOT NULL DEFAULT ‘0’,
    push_drafts tinyint(1) NOT NULL DEFAULT ‘0’,
    weight tinyint(1) NOT NULL DEFAULT ‘0’,
    version varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    pull_to_drafts tinyint(1) NOT NULL DEFAULT ‘0’,
    PRIMARY KEY (id),
    UNIQUE KEY name (name),
    KEY name_sf_type_wordpress_type (wordpress_object,salesforce_object(191))
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

    CREATE TABLE wp_object_sync_sf_object_map (
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    wordpress_id varchar(32) COLLATE utf8mb4_unicode_520_ci NOT NULL,
    salesforce_id varbinary(32) NOT NULL DEFAULT ”,
    wordpress_object varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    created datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    object_updated datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    last_sync datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    last_sync_action varchar(128) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
    last_sync_status tinyint(1) NOT NULL DEFAULT ‘0’,
    last_sync_message varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
    PRIMARY KEY (id),
    UNIQUE KEY salesforce (salesforce_id),
    UNIQUE KEY salesforce_wordpress (wordpress_object,wordpress_id),
    KEY wordpress_object (wordpress_object,wordpress_id),
    KEY salesforce_object (salesforce_id)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

    It’s possible you’ll need to reactivate the plugin after doing this.

    Hello,
    the CREATE TABLEwp_object_sync_sf_field_map` (
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    label varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    name varchar(64) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    wordpress_object varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    salesforce_object varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    salesforce_record_types_allowed longblob,
    salesforce_record_type_default varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    fields longtext COLLATE utf8mb4_unicode_520_ci NOT NULL,
    pull_trigger_field varchar(128) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ‘LastModifiedDate’,
    sync_triggers text COLLATE utf8mb4_unicode_520_ci NOT NULL,
    push_async tinyint(1) NOT NULL DEFAULT ‘0’,
    push_drafts tinyint(1) NOT NULL DEFAULT ‘0’,
    pull_to_drafts tinyint(1) NOT NULL DEFAULT ‘0’,
    weight tinyint(1) NOT NULL DEFAULT ‘0’,
    version varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT ”,
    PRIMARY KEY (id),
    UNIQUE KEY name (name),
    KEY name_sf_type_wordpress_type (wordpress_object,salesforce_object)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;`
    give me the error:
    #1709 - Index column size too large. The maximum column size is 767 bytes.

    Any idea to solved?

    Plugin Contributor Jonathan Stegall

    (@jonathanstegall)

    @sebastienserre I do not know how to solve that. What version of PHP and MySQL are you using, and who is your host?

    Sorry,
    https://stackoverflow.com/questions/30761867/mysql-error-the-maximum-column-size-is-767-bytes
    should solve.
    I didn’t test on my mutualized hoster.

    I’ve migrated to another dedicated server…. where I didn’t reproduced…

    Plugin Contributor Jonathan Stegall

    (@jonathanstegall)

    @sebastienserre I don’t think we’re likely to add this into the plugin. From everything I’ve been able to find, it appears to be an issue on older MySQL versions, and it’s unlikely that we can devote much energy to supporting that.

    However if there’s a pull request someone submits that fixes the issue without harming more current versions of MySQL, I’d be happy to look at it.

    I understand, no problem.
    I will push a PR if i ‘ll find a solution 😉

    I had the same problem on MySQL 5.5

    I switched the created, object_updated, and last_sync columns to the following:

    $object_map_sql   = "CREATE TABLE $object_map_table (
                id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
                wordpress_id varchar(32) NOT NULL,
                salesforce_id varbinary(32) NOT NULL DEFAULT '',
                wordpress_object varchar(128) NOT NULL DEFAULT '',
                created timestamp NULL,
                object_updated timestamp NULL,
                last_sync timestamp NULL,
                last_sync_action varchar(128) DEFAULT NULL,
                last_sync_status tinyint(1) NOT NULL DEFAULT '0',
                last_sync_message varchar(255) DEFAULT NULL,
                PRIMARY KEY  (id),
                KEY wordpress_object (wordpress_object,wordpress_id),
                KEY salesforce_object (salesforce_id)
            ) $charset_collate";

    Source: https://stackoverflow.com/questions/4851672/one-mysql-table-with-multiple-timestamp-columns

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.