Overview
Comment:Fix issue where there was recursion in wiki_pages tree!
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev | 1.1.0-alpha7
Files: files | file ages | folders
SHA3-256: 262ad12fe65c61e99e2941a096bb83ea85e2cc7eaf32617bf47ae69c90892f58
User & Date: bohwaz on 2021-03-17 20:42:19
Other Links: branch diff | manifest | tags
Context
2021-03-19
21:01
Make sure access to skeletons is possible, but only via Skeleton class check-in: f0156b82a1 user: bohwaz tags: dev, 1.1.0-alpha7
2021-03-17
20:42
Fix issue where there was recursion in wiki_pages tree! check-in: 262ad12fe6 user: bohwaz tags: dev, 1.1.0-alpha7
18:44
Alpha 7 release check-in: 2eab8e08c9 user: bohwaz tags: dev, 1.1.0-alpha7
Changes

Modified src/include/data/1.1.0_migration.sql from [9f5dd59ebe] to [4a2b34a97f].

110
111
112
113
114
115
116

117
118
119
120
121
122
123
124



125
126
127
128
129
130
131
	UNION ALL
	SELECT path.level + 1,
	wiki_as_files.uri,
	wiki_as_files.old_parent,
	path.id
	FROM wiki_as_files
	JOIN path ON wiki_as_files.old_id = path.parent

),
path_from_root AS (
	SELECT group_concat(uri, '/') AS path, id
	FROM (SELECT id, uri FROM path ORDER BY level DESC)
	GROUP BY id
)
UPDATE wiki_as_files SET path = (SELECT path FROM path_from_root WHERE id = wiki_as_files.old_id);




-- Copy into files
INSERT INTO files (path, parent, name, type, mime, modified, size)
	SELECT
		'web/' || path || '/index.txt',
		'web/' || path,
		'index.txt',
		1,







>








>
>
>







110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
	UNION ALL
	SELECT path.level + 1,
	wiki_as_files.uri,
	wiki_as_files.old_parent,
	path.id
	FROM wiki_as_files
	JOIN path ON wiki_as_files.old_id = path.parent
	WHERE level <= 8 -- max level = 8 to avoid recursion
),
path_from_root AS (
	SELECT group_concat(uri, '/') AS path, id
	FROM (SELECT id, uri FROM path ORDER BY level DESC)
	GROUP BY id
)
UPDATE wiki_as_files SET path = (SELECT path FROM path_from_root WHERE id = wiki_as_files.old_id);

-- remove recursion
UPDATE wiki_as_files SET path = uri WHERE path IS NULL OR LENGTH(path) - LENGTH(REPLACE(path, '/', '')) >= 8;

-- Copy into files
INSERT INTO files (path, parent, name, type, mime, modified, size)
	SELECT
		'web/' || path || '/index.txt',
		'web/' || path,
		'index.txt',
		1,