Skip Navigation

[Resolved] database structure

This support ticket is created 3 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 3 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1974467

Hello,
I'm using custom database-queries to get the results needed. After updating to the latest toolset-version this queries don't work anymore. The result is empty. When I remove the WHERE-part I got a result but it's not equal to the former output.

Here's on of the queries:
SELECT distinct(wp_zbdj_postmeta.meta_value) FROM wp_zbdj_posts left join wp_zbdj_toolset_associations on wp_zbdj_posts.id = wp_zbdj_toolset_associations.child_id right join wp_zbdj_posts as wp_zbdj_posts_parent on wp_zbdj_posts_parent.id = wp_zbdj_toolset_associations.parent_id left join wp_zbdj_postmeta on wp_zbdj_postmeta.post_id=wp_zbdj_posts.id and wp_zbdj_postmeta.meta_key='wpcf-product-size-drw' left join wp_zbdj_icl_translations on wp_zbdj_icl_translations.trid = parent_id where wp_zbdj_posts.post_status='publish' and wp_zbdj_icl_translations.element_id=8122 and wp_zbdj_posts.post_type='installation-drawing' and wp_zbdj_postmeta.meta_key is not null order by convert(wp_zbdj_postmeta.meta_value, signed) ASC

That's the output of the old (but correct) version: hidden link
That's after updating to the latest toolset version: hidden link

Did toolset change the database-structure or names? Any idea or hints?

Regards,
Richard

#1974847

Hello, yes there have been some changes to the way post relationships are stored recently to support more flexible translation features in WPML when content does not exist in the primary language. Types 3.4 introduced a database upgrade process for supporting those features. Subsequent versions iteratively improved on the database upgrade process.
https://toolset.com/download/toolset-types/#changelog
I don't have technical specs for that upgrade, but I can see at least one new Toolset-specific table exists now in my local environment:
- [prefix]_toolset_associations_old

Unfortunately we do not support custom SQL queries here in the forums, so adjustments to your custom SQL fall outside the scope of the services I can offer here. If I wanted more information about this upgrade, I would consider installing a backup of the site from before the upgrade in another database for comparision. If no backup exists, I would create a fresh site using the older versions of Toolset and WPML that were installed on the site before your latest update. Create similar post types and relationships, then create some similar content (scaled down for testing). Create a db backup with that similar content, then run the upgrade on the scaled-down version and do a DB comparison of before-and-after. That might be the best way to get insight into the changes that were implemented in the DB, and understand why your queries no longer function as expected.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.