Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tim Watts 90 posts 395 karma points
    Mar 15, 2017 @ 11:15
    Tim Watts
    0

    Find unused data types

    Hi all,

    I'm looking to clean up my Umbraco installation. Does anyone have a SQL script or package to find unused data types?

    I'm happy to delete them one at a time through the back-end, I just want to find out which ones can go.

    Thanks,

    Tim

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Mar 15, 2017 @ 11:31
    Alex Skrypnyk
    100

    Hi Tim

    I don't know what SQL script can do it, but I would recommend you to try "Diplo God Mode" package - https://our.umbraco.org/projects/developer-tools/diplo-god-mode/

    I can find out which data types are being used (or not)

    Thanks,

    Alex

  • Tim Watts 90 posts 395 karma points
    Mar 15, 2017 @ 11:55
    Tim Watts
    2

    Thanks Alex.

    I've written a SQL script myself. The God Mode package lists a few more as unused but the SQL gets most of them.

    SELECT N.Text AS 'DataTypeName', DT.propertyEditorAlias AS 'EditorType', CT.Alias AS 'ContentTypeAlias', PT.Alias AS 'FieldName'
    FROM [UmbracoDev].[dbo].[umbracoNode] N
    LEFT JOIN [UmbracoDev].[dbo].[cmsPropertyType] PT ON PT.datatypeid = N.id
    LEFT JOIN [UmbracoDev].[dbo].[cmsContentType] CT ON CT.nodeid = PT.ContentTypeId
    INNER JOIN [UmbracoDev].[dbo].[cmsDataType] DT ON DT.nodeId = N.id
    WHERE CT.Alias IS NULL
    ORDER BY N.Text
    

    But the package gives so much more and is built into the back-end so I will use that!

    Tim

  • Daniel Bardi 927 posts 2562 karma points
    Nov 17, 2023 @ 21:35
    Daniel Bardi
    0

    Umbraco v8 version:

    SELECT N.Text AS 'DataTypeName', DT.propertyEditorAlias AS 'EditorType', CT.Alias AS 'ContentTypeAlias', PT.Alias AS 'FieldName'
    FROM [umbracoNode] N
    LEFT JOIN [cmsPropertyType] PT ON PT.datatypeid = N.id
    LEFT JOIN [cmsContentType] CT ON CT.nodeid = PT.ContentTypeId
    INNER JOIN [umbracoDataType] DT ON DT.nodeId = N.id
    WHERE CT.Alias IS NULL
    ORDER BY N.Text
    
  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Mar 15, 2017 @ 11:56
    Alex Skrypnyk
    0

    Hi Tim

    Thank you very much for sharing the script, I will use it on our latest project!

    Have a nice day.

    /Alex

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies