Update config workbook to use new projects_contents mapping table
Closed this issue · 7 comments
Determining which piece of content resides in a specific project is done via the project_id column in today's PostgreSQL schema. However, Tableau 2023.1 will change that, relying instead upon the projects_contents table. The database views built around these content tables should be updated to contain the correct mapping, which could be the best way for us to avoid breaking compatibility with older versions of Tableau by explicitly referencing the new table (I've avoided using the views at times in the past due to the fact that I needed columns that were not exposed in those views).
This should be a fix for it, but need to test on a 2023.1 Tableau Server instance to be sure.
This does not work, as the _workbooks view does not appear to have been updated with the new project mapping logic. (sigh).
The SQL joins necessary will look like this:
INNER JOIN workbooks w ON v.workbook_id = w.id INNER JOIN sites st ON v.site_id = st.id INNER JOIN projects_contents pc ON w.id = pc.content_id AND pc.content_type = 'workbook' INNER JOIN projects p ON pc.project_id = p.id
Is the above INNER JOIN statement in addition to the list of ones near the bottom of the SQL or does it replace the existing ones near the bottom at
` INNER JOIN workbooks w
ON v.workbook_id = w.id
INNER JOIN sites st
ON v.site_id = st.id
INNER JOIN projects p
ON w.project_id = p.id`
It replaces it. Using the workbooks.project_id field is no longer valid, as of 2023.1, so you have to join to projects_contents. Not sure why the code formatter won't let me add line breaks properly...but basically you're
Replacing this:
INNER JOIN workbooks w
ON v.workbook_id = w.id
INNER JOIN sites st
ON v.site_id = st.id
INNER JOIN projects p
ON w.project_id = p.id
...with this:
INNER JOIN workbooks w
ON v.workbook_id = w.id
INNER JOIN sites st
ON v.site_id = st.id
INNER JOIN projects_contents pc
ON w.id = pc.content_id
AND pc.content_type = 'workbook'
INNER JOIN projects p
ON pc.project_id = p.id
Those changes could be written more concisely, I know, but I wanted to show how workbooks related to projects in its entirety.
Perfect, just as I thought. Thanks!
Yeah, I couldn't get the code formatting to work either, thus the messy looking message o' mine.
Thank you so much for contributing to this. Looks like Tableau no longer populates the project_id column in the workbook table in version 2023.1? Due to this, VizAlert specification workbooks published after upgrading to Tableau version 2023.1 do not send VizAlerts (since the inner join to the project table on workbook_id filters out workbooks and therefore the VizAlert specifications do not show in the VizAlertsConfig workbook).
Summary: VizAlerts is not compatible with Tableau 2023.1 at least due to this issue.
Do you have an estimate on when this fix will be merged to main?
Thanks!
This is fixed in the v2.2.1 release