Hi Jamal
1) I think I solved the issue with the Relationships.
I installed the toolset plugins on another clean environment and exported the SQL structure of the following tables, then used the SQL to create the tables, indices etc on our dev environment.
- wp_toolset_relationships
- wp_toolset_associations
- wp_toolset_connected_elements
Now I can see the Relationships in the GUI, the related Job Ads and related Nanny Ads are working again in Messages.
Can you please verify that what I have done is correct?
2) Regarding my previous question (2) that you wanted clarification on:
When we are post referencing fields from different post types, it would seem logical to me that we should only be able to post reference fields from post types for which there exists a Relationship between them.
So if we go to Toolset > Custom Fields > (open some Field Group, as an example in our environment Messages) > Add New Field.
When creating a new field to store a post reference from another Post Type, surely when the picklist "Post Type to connect" drops down, we should only get Post Types for which there exists a relationship. At the moment, all the Post Types are available.
Kind regards
Simon
Below is the SQL I used to re-create the tables:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Table structure for table `wp_toolset_relationships`
--
CREATE TABLE `wp_toolset_relationships` (
`id` bigint(20) UNSIGNED NOT NULL,
`slug` varchar(190) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`display_name_plural` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`display_name_singular` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`driver` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`parent_domain` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`parent_types` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
`child_domain` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`child_types` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
`intermediary_type` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`ownership` varchar(8) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT 'none',
`cardinality_parent_max` int(10) NOT NULL DEFAULT '-1',
`cardinality_parent_min` int(10) NOT NULL DEFAULT '0',
`cardinality_child_min` int(10) NOT NULL DEFAULT '0',
`cardinality_child_max` int(10) NOT NULL DEFAULT '-1',
`is_distinct` tinyint(1) NOT NULL DEFAULT '0',
`scope` longtext COLLATE utf8mb4_unicode_520_ci NOT NULL,
`origin` varchar(50) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`role_name_parent` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`role_name_child` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`role_name_intermediary` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`role_label_parent_singular` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`role_label_child_singular` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`role_label_parent_plural` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`role_label_child_plural` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`needs_legacy_support` tinyint(1) NOT NULL DEFAULT '0',
`is_active` tinyint(1) NOT NULL DEFAULT '0',
`autodelete_intermediary` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `wp_toolset_relationships`
--
ALTER TABLE `wp_toolset_relationships`
ADD PRIMARY KEY (`id`),
ADD KEY `slug` (`slug`),
ADD KEY `is_active` (`is_active`),
ADD KEY `needs_legacy_support` (`needs_legacy_support`),
ADD KEY `parent` (`parent_domain`,`parent_types`),
ADD KEY `child` (`child_domain`,`child_types`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `wp_toolset_relationships`
--
ALTER TABLE `wp_toolset_relationships`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;COMMIT;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Table structure for table `wp_toolset_associations`
--
CREATE TABLE `wp_toolset_associations` (
`id` bigint(20) UNSIGNED NOT NULL,
`relationship_id` bigint(20) UNSIGNED NOT NULL,
`parent_id` bigint(20) UNSIGNED NOT NULL,
`child_id` bigint(20) UNSIGNED NOT NULL,
`intermediary_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `wp_toolset_associations`
--
ALTER TABLE `wp_toolset_associations`
ADD PRIMARY KEY (`id`),
ADD KEY `relationship_id` (`relationship_id`),
ADD KEY `parent_id` (`parent_id`,`relationship_id`),
ADD KEY `child_id` (`child_id`,`relationship_id`),
ADD KEY `intermediary_id` (`intermediary_id`,`relationship_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `wp_toolset_associations`
--
ALTER TABLE `wp_toolset_associations`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;COMMIT;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Table structure for table `wp_toolset_connected_elements`
--
CREATE TABLE `wp_toolset_connected_elements` (
`id` bigint(20) UNSIGNED NOT NULL,
`element_id` bigint(20) UNSIGNED NOT NULL,
`domain` varchar(20) COLLATE utf8mb4_unicode_520_ci NOT NULL DEFAULT '',
`wpml_trid` bigint(20) UNSIGNED DEFAULT NULL,
`lang_code` varchar(7) COLLATE utf8mb4_unicode_520_ci DEFAULT '',
`group_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `wp_toolset_connected_elements`
--
ALTER TABLE `wp_toolset_connected_elements`
ADD PRIMARY KEY (`id`),
ADD KEY `group_id` (`group_id`),
ADD KEY `element` (`domain`,`element_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `wp_toolset_connected_elements`
--
ALTER TABLE `wp_toolset_connected_elements`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;COMMIT;