-- Menus of a WinterCMS site with the Golem15.Menu plugin, one JSON object -- per line: the --menus input of menu:import-winter. -- -- mysql -N -B --raw < winter-export-menus.sql > menus.jsonl -- -- Read-only: it selects from the menus table and changes nothing. -- JSON_OBJECT needs MySQL 5.7.8+ or MariaDB 10.2.3+. -- -- Check the table name on the server before running: -- SHOW TABLES LIKE '%menu_menus'; -- This file assumes golem15_menu_menus. -- -- Export the entries with winter-export-entries.sql in the same run: the -- entries refer to these ids, and the command keeps both. SELECT JSON_OBJECT( 'id', m.id, 'name', m.name, 'code', m.code, 'is_active', m.is_active, 'css_class', m.css_class, 'created_at', m.created_at, 'updated_at', m.updated_at ) FROM golem15_menu_menus m ORDER BY m.id;