Files
sm-sitemap-plugin/scripts/winter-export-definitions.sql
Jakub Zych 4a82240429 feat(17-03): full sitemap generation, settings, hooks and import commands
- generator in Definition::addItemToSet order: 50000 URL cap, lastmod from
  the record or the updates manifest (regular file, 5 MiB cap, fail safe),
  BeforeAddItem (skip) and AddItem (extra XML) festival events, tier or item
  priority, per-alternate expansion of list type children
- priority tiers from golem15.sitemap.priority_tiers, compiled at boot,
  defaults equal to the PHP getPriorityForUrl rules
- frontend_url rewrite of loc, xhtml:link href and the stylesheet href;
  GET /sitemap.xsl serves the PHP stylesheet byte for byte
- golem15_sitemap_settings singleton and Settings model
- sitemap:import (PHP ImportCommand) and sitemap:import-winter with the
  read-only Winter export SQL
- urlto and full goldens generated from PHP; TestSitemapImportSmoke
2026-10-12 17:07:39 +02:00

28 lines
1.0 KiB
SQL

-- Sitemap definitions of a WinterCMS site with the Golem15.Sitemap plugin,
-- one JSON object per line: the --definitions input of
-- sitemap:import-winter.
--
-- mysql -N -B --raw <database> < winter-export-definitions.sql > sitemap-definitions.jsonl
--
-- Read-only: it selects from the definitions 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 '%sitemap_definitions';
-- This file assumes golem15_sitemap_definitions. A site still on the
-- Winter.Sitemap or RainLab.Sitemap plugin uses winter_sitemap_definitions
-- or rainlab_sitemap_definitions; change the FROM line to match.
--
-- data is the stored item list as text; the command decodes it. A site with
-- several themes exports one row per theme; pass --theme to the command to
-- pick the one to copy.
SELECT JSON_OBJECT(
'id', d.id,
'theme', d.theme,
'data', d.data,
'created_at', d.created_at,
'updated_at', d.updated_at
)
FROM golem15_sitemap_definitions d
ORDER BY d.id;