<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Vinit Gavankar</title><link href="http://world.optimizely.com" /><updated>2026-08-20T11:58:26.0000000Z</updated><id>https://world.optimizely.com/blogs/vinit-gavankar/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>Error FK_tblContentSoftlink_tblPropertyDefinition in CMS</title><link href="https://world.optimizely.com/blogs/vinit-gavankar/dates/2026/8/error-fk_tblcontentsoftlink_tblpropertydefinition-in-cms/" /><id>&lt;p&gt;&lt;strong&gt;Example Error :&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&amp;nbsp;Microsoft.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint &quot;FK_tblContentSoftlink_tblPropertyDefinition&quot;. The conflict occurred in database &quot;XYZ-epicms&quot;, table &quot;dbo.tblContentSoftlink&quot;, column &#39;fkOwnerPropertyDefinitionID&#39;.&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Description&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;This is happening because you&amp;rsquo;re attempting to remove a property definition, and during model sync on initialization, it tries to delete that row from &lt;strong&gt;tblPropertyDefinition&lt;/strong&gt;. However, there are still rows in&amp;nbsp;&lt;strong&gt;tblContentSoftlink&lt;/strong&gt;&amp;nbsp;that reference this property definition.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;First, I will ask you to try &quot;Restart one instance at a time&quot; from the &quot;Troubleshoot&quot; tab of the&lt;strong&gt; PAAS Portal&lt;/strong&gt;&amp;nbsp;and check again.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;If the issue continues, this query will give you all property definitions that have rows in &lt;strong&gt;tblContentSoftlink&lt;/strong&gt;, along with their property definition type:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SELECT *&lt;br /&gt;FROM tblPropertyDefinition pd&lt;br /&gt;INNER JOIN tblPropertyDefinitionType pdtype&lt;br /&gt;    ON pdtype.pkid = pd.fkPropertyDefinitionTypeID&lt;br /&gt;WHERE EXISTS (&lt;br /&gt;    SELECT 1&lt;br /&gt;    FROM tblContentSoftlink cs&lt;br /&gt;    WHERE cs.fkOwnerPropertyDefinitionID = pd.pkid&lt;br /&gt;);&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once you know the property definition to remove, you can delete the dependent softlink rows first (replace&amp;nbsp;&lt;code&gt;X&lt;/code&gt;&amp;nbsp;with the&amp;nbsp;&lt;code&gt;pkid&lt;/code&gt;&amp;nbsp;of the property definition):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;DELETE FROM tblContentSoftlink&lt;br /&gt;WHERE fkOwnerPropertyDefinitionID = X;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;br /&gt;After that, the modelsync should be able to remove the property definition.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;I&amp;rsquo;d recommend testing this&amp;nbsp;&lt;strong&gt;locally first, using a copy of the preproduction database,&lt;/strong&gt;&amp;nbsp;to ensure it behaves as expected.&lt;/p&gt;</id><updated>2026-08-20T11:58:26.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Get count of pages, blocks , Assets from the CMS.</title><link href="https://world.optimizely.com/blogs/vinit-gavankar/dates/2026/8/get-count-of-pages-blocks--assets-from-the-cms/" /><id>&lt;p&gt;The following queries retrieve details from the CMS database. Make sure to try these queries locally first.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1 &amp;mdash; Discover your content type bases first:&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```&lt;br /&gt;SELECT Base, COUNT(*) AS TypeCount&lt;br /&gt;FROM tblContentType&lt;br /&gt;GROUP BY Base&lt;br /&gt;ORDER BY TypeCount DESC;&lt;br /&gt;```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 2 &amp;mdash; Count all content grouped by base type (single query):&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```&lt;br /&gt;SELECT &lt;br /&gt;    ct.Base         AS ContentBase,&lt;br /&gt;    ct.Name         AS ContentTypeName,&lt;br /&gt;    COUNT(c.pkID)   AS ContentCount&lt;br /&gt;FROM tblContent c&lt;br /&gt;INNER JOIN tblContentType ct ON c.fkContentTypeID = ct.pkID&lt;br /&gt;GROUP BY ct.Base, ct.Name&lt;br /&gt;ORDER BY ct.Base, ContentCount DESC;&lt;br /&gt;```&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Step 3 &amp;mdash; Individual counts per category:&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```&lt;br /&gt;-- Pages&lt;br /&gt;SELECT COUNT(*) AS PageCount&lt;br /&gt;FROM tblContent c&lt;br /&gt;INNER JOIN tblContentType ct ON c.fkContentTypeID = ct.pkID&lt;br /&gt;WHERE ct.Base = &#39;Page&#39;;&lt;br /&gt;&lt;br /&gt;-- Blocks&lt;br /&gt;SELECT COUNT(*) AS BlockCount&lt;br /&gt;FROM tblContent c&lt;br /&gt;INNER JOIN tblContentType ct ON c.fkContentTypeID = ct.pkID&lt;br /&gt;WHERE ct.Base = &#39;Block&#39;;&lt;br /&gt;&lt;br /&gt;-- Images (adjust base value based on Step 1 results)&lt;br /&gt;SELECT COUNT(*) AS ImageCount&lt;br /&gt;FROM tblContent c&lt;br /&gt;INNER JOIN tblContentType ct ON c.fkContentTypeID = ct.pkID&lt;br /&gt;WHERE ct.Base = &#39;Image&#39;;&lt;br /&gt;&lt;br /&gt;-- Documents / Files&lt;br /&gt;SELECT COUNT(*) AS DocumentCount&lt;br /&gt;FROM tblContent c&lt;br /&gt;INNER JOIN tblContentType ct ON c.fkContentTypeID = ct.pkID&lt;br /&gt;WHERE ct.Base IN (&#39;File&#39;, &#39;Video&#39;, &#39;Media&#39;);&lt;br /&gt;```&lt;/code&gt;&lt;/pre&gt;</id><updated>2026-08-20T11:52:59.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>