Put all Mautic Custom fields into alphabetical order by label.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE lead_fields AS f | |
CROSS JOIN ( | |
SELECT @cnt := 0 | |
) AS dummy | |
JOIN ( | |
SELECT (@cnt := @cnt + 1) AS cnt, id | |
FROM lead_fields | |
CROSS JOIN (SELECT @cnt := 0) AS dummy | |
ORDER BY label ASC | |
) AS c | |
SET f.field_order = c.cnt | |
WHERE f.id = c.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment